1. EuGTK - get_active?

What is the problem here?

./GtkEngine.e:297 in function lookup_method()  
Error in lookup method for name: get_active, class: 0 
  
... called from ./GtkEngine.e:294 in function lookup_method()   
 
... called from ./GtkEngine.e:494 in function get()   
 
... called from ./dmak_actions.e:824 in procedure setStatusBar()   

This line 824:

if get(MenuRaw,"active") then
new topic     » topic index » view message » categorize

2. Re: EuGTK - get_active?

Jerry_Story said...

What is the problem here?

./GtkEngine.e:297 in function lookup_method()  
Error in lookup method for name: get_active, class: 0 

The class: 0 line indicates that EuGTK has tried to lookup the "get_active" method for whatever control "MenuRaw" was declared as, and then tried all the controls from which it inherits methods, and finally got to the end of the line without finding a method by that name. So, what is "MenuRaw"? IOW, what was it created as?

This line 824:

if get(MenuRaw,"active") then

I should probably change the error message to something more informative.

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

3. Re: EuGTK - get_active?

irv said...

The class: 0 line indicates that EuGTK has tried to lookup the "get_active" method for whatever control "MenuRaw" was declared as, and then tried all the controls from which it inherits methods, and finally got to the end of the line without finding a method by that name. So, what is "MenuRaw"? IOW, what was it created as?

MenuRaw is a GtkImageMenuItem and it's supposed to optionally have a check mark beside it.

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

4. Re: EuGTK - get_active?

I don't see any mention of an optional checkbox, just an optional image: http://library.gnome.org/devel/gtk/unstable/GtkImageMenuItem.html

This would be the check menu item here: http://library.gnome.org/devel/gtk/unstable/gtk3-gtkcheckmenuitem.html#GtkCheckMenuItem

ck1 = create(GtkCheckMenuItem,"new_with_label=>Open"), 

The above creates a check menu item with the label "Open"

"new_with_mnemonic=>Hello _World!" creates one with a hotkey = W

I've looked for examples which use both a checkbox and an image, and haven't found any. If you need something that implements both an image and a checkbox, you may have to create a plain GtkMenuItem and then pack your own image and checkbox into it.

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

5. Re: EuGTK - get_active?

irv said...
ck1 = create(GtkCheckMenuItem,"new_with_label=>Open"), 

The above creates a check menu item with the label "Open"

Thanks. That works.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu