1. EuGTK - GtkImageMenuItem - Is it checked?

In EuGTK, how do you test whether a GtkImageMenuItem has a check mark beside it?

In wxEuphoria, it is done like this:
is_menuitem_checked( a_menu_item)

Perhaps adding some code to 'test40.ex' in the EuGTK demos would suffice.

Thanks.

new topic     » topic index » view message » categorize

2. Re: EuGTK - GtkImageMenuItem - Is it checked?

Jerry_Story said...

In EuGTK, how do you test whether a GtkImageMenuItem has a check mark beside it?

In wxEuphoria, it is done like this:
is_menuitem_checked( a_menu_item)

Perhaps adding some code to 'test40.ex' in the EuGTK demos would suffice.

Thanks.

Is this correct?
get(menu_item,"get_active",1)

It doesn't produce an error so I'm going to go with it for now.

new topic     » goto parent     » topic index » view message » categorize

3. Re: EuGTK - GtkImageMenuItem - Is it checked?

item_x = create(GtkCheckMenuItem,"with_mnemonic=>_About") 
--- 
-- alternate: create(GtkCheckMenuItem,"with_label=>My Label Text") 
--- 
if get(item_x,"active") then .... 

However, I left out GtkCheckMenuItem from the wrapper: you can easily add the following anywhere in the control method declarations section of GtkRoutines.e

control[GtkCheckMenuItem] = {"gtk_check_menu_item",GtkMenuItem, 
	{"new_with_mnemonic",{S},P}, 
	{"new_with_label",{S},P}, 
	{"new",{},P}, 
	{"get_active",{P},B}, 
	{"set_active",{P,B}}, 
	{"toggled",{P}}, 
	{"get_inconsistent",{P},B}, 
	{"set_inconsistent",{P,B}}, 
	{"set_draw_as_radio",{P,B}}, 
	{"get_draw_as_radio",{P},B} 
} 
new topic     » goto parent     » topic index » view message » categorize

4. Re: EuGTK - GtkImageMenuItem - Is it checked?

irv said...
item_x = create(GtkCheckMenuItem,"with_mnemonic=>_About") 
--- 
-- alternate: create(GtkCheckMenuItem,"with_label=>My Label Text") 
--- 
if get(item_x,"active") then .... 

However, I left out GtkCheckMenuItem from the wrapper: you can easily add the following anywhere in the control method declarations section of GtkRoutines.e

control[GtkCheckMenuItem] = {"gtk_check_menu_item",GtkMenuItem, 
	{"new_with_mnemonic",{S},P}, 
	{"new_with_label",{S},P}, 
	{"new",{},P}, 
	{"get_active",{P},B}, 
	{"set_active",{P,B}}, 
	{"toggled",{P}}, 
	{"get_inconsistent",{P},B}, 
	{"set_inconsistent",{P,B}}, 
	{"set_draw_as_radio",{P,B}}, 
	{"get_draw_as_radio",{P},B} 
} 

Thanks.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu