1. EuGTK - get_active?
- Posted by Jerry_Story Sep 11, 2010
- 1289 views
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
2. Re: EuGTK - get_active?
- Posted by irv Sep 12, 2010
- 1391 views
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.
3. Re: EuGTK - get_active?
- Posted by Jerry_Story Sep 12, 2010
- 1324 views
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.
4. Re: EuGTK - get_active?
- Posted by irv Sep 12, 2010
- 1342 views
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.
5. Re: EuGTK - get_active?
- Posted by Jerry_Story Sep 12, 2010
- 1240 views
ck1 = create(GtkCheckMenuItem,"new_with_label=>Open"),
The above creates a check menu item with the label "Open"
Thanks. That works.