[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

2850.0. "Help with icons?" by VOGON::ODONNELL () Fri Jun 01 1990 05:34

	Can anybody out there help me with, what I am sure, is a trivial
	problem but one that I can not seem to find an answer to.

	I have two icons defined in a UIL file.  I create a push button
	and use one of the icons as its label.  Now what I want to do is
	to replace this icon with the other icon whenever the button
	is activated.
	Now I know how to do this with text (using XtSetArg and XtSetValues)
	but how can I indicate that its an icon that I wish for it to use?

	Any help would be gratefully appreciated,

	Kevin.
T.RTitleUserPersonal
Name
DateLines
2850.1Use "highlight_pixmap" argumentSCAM::DIALFri Jun 01 1990 10:424
    In the UIL, you use "highlight_pixmap = <your_pixmap_name>".
    This pixmap is used while the mouse button is down.
    
    Barry
2850.2VOGON::ODONNELLFri Jun 01 1990 12:2711
	Actually what I wanted to do was to change the pushbutton 
	label permanently and not just when the mouse button was down.
	Also, eventually, to select which icon will be placed into the 
	pushbutton label from within the C code.
	I'm trying to achieve a similar effect as that of the helloworld
	application except instead of a text string I wish to display 
	a simple icon.

	Kevin.

2850.3Here's what I useATSE::DMILLERCecil B D&#039;Miller, the esotericFri Jun 01 1990 13:3614
	I used DwtFetchSetValues() in my Yahtzee game, which changes the
	pixmap of a "die" push button when the dice are rolled.

	-Dave

	static String Die_Icon[] = {	"Blank_Icon",	"Ace_Icon",
					"Two_Icon",	"Three_Icon,
					"Four_Icon",	"Five_Icon",
					"Six_Icon"	}
		:
		:

	XtSetArg(al[0], DwtNpixmap, Die_Icon[v]);	/* v is die value */
	DwtFetchSetValues(s_DRMHierarchy, Die_Widget[die], al, 1);
2850.4Pixmap leak?DECWIN::KLEINFri Jun 01 1990 15:4213
>	static String Die_Icon[] = {	"Blank_Icon",	"Ace_Icon",
>					"Two_Icon",	"Three_Icon,
>					"Four_Icon",	"Five_Icon",
>					"Six_Icon"	}
>		:
>		:
>
>	XtSetArg(al[0], DwtNpixmap, Die_Icon[v]);	/* v is die value */
>	DwtFetchSetValues(s_DRMHierarchy, Die_Widget[die], al, 1);

Won't this create a new instance of the icon pixmap each time it is loaded?

-steve-
2850.5VOGON::ODONNELLFri Jun 01 1990 15:5134
	I tried DwtFetchSetValues but it complained that my icon could not 
	be found!

	Am I setting up the icon in the UIL O.K.?  This what I do:


value
	o_icon 		:	icon(color_table = o_ct,
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++',
				:
				:
'+.....................................................+',
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++');


object TL_square : push_button {
	arguments {
		x = 0;
		y = 0;
		border_width = 2;
		label_label_type = DwtPixmap;
		label_pixmap = n_icon;
	};
	callbacks {
		activate = procedure pushed_proc(k_TL_label);
	};
};


	Am I doing anything obviously wrong here?

	Kevin.

2850.6value o_icon : exported icon ...ATSE::DMILLERCecil B D&#039;Miller, the esotericFri Jun 01 1990 17:269
	The .UIL file should define the pixmaps as EXPORTED icons.  Then
	the fetch will succeed.

	RE: Memory leakage.

	I don't know.  I do seem to have a slow leak, but couldn't pin
	down the cause.  How (and what) should I free the old pixmap?

	-Dave
2850.7VOGON::ODONNELLMon Jun 04 1990 05:067
	That did the trick.

	Thanks for all your help.

	Kevin.