|
|
Figured it out. Its weird O_o.
So the extending chain is:
Fl_Sys_Menu_Bar -> Fl_Menu_Bar -> Fl_Menu_ ->…
Fl_Menu_ defines two add() methods - with a different signature.
In normality, Fl_Sys_Menu_Bar should have access to that method too…but it doesn’t. I had to copy the second method into it’s header in order to have it work correctly. Dirty kind of patch, but works…I dunno why the extending isn’t working as it should O.o
Am Mo. Jan. 13 2014 12:48:05 schrieb Kevin Ingwersen:
> Hey there. In one of the examples, I changed Fl_Menu to Fl_Sys_Menu to have it work with OS X. Result:
>
> *** Compile menubar-add.cxx...
> menubar-add.cxx:59:29: error: cannot initialize a parameter of type 'int' with an lvalue of type 'const char [3]'
> menu->add("&File/&Open", "^o", MyMenuCallback);
> ^~~~
> ../FL/Fl_Sys_Menu_Bar.H:47:34: note: passing argument to parameter 'shortcut' here
> int add(const char* label, int shortcut, Fl_Callback*, void *user_data=0, int flags=0);
> ^
> menubar-add.cxx:60:29: error: cannot initialize a parameter of type 'int' with an lvalue of type 'const char [3]'
> menu->add("&File/&Save", "^s", MyMenuCallback, 0, FL_MENU_DIVIDER);
> ^~~~
> ../FL/Fl_Sys_Menu_Bar.H:47:34: note: passing argument to parameter 'shortcut' here
> int add(const char* label, int shortcut, Fl_Callback*, void *user_data=0, int flags=0);
> ^
> menubar-add.cxx:61:29: error: cannot initialize a parameter of type 'int' with an lvalue of type 'const char [3]'
> menu->add("&File/&Quit", "^q", MyMenuCallback);
> ^~~~
> ../FL/Fl_Sys_Menu_Bar.H:47:34: note: passing argument to parameter 'shortcut' here
> int add(const char* label, int shortcut, Fl_Callback*, void *user_data=0, int flags=0);
> ^
> menubar-add.cxx:62:29: error: cannot initialize a parameter of type 'int' with an lvalue of type 'const char [3]'
> menu->add("&Edit/&Copy", "^c", MyMenuCallback);
> ^~~~
> ../FL/Fl_Sys_Menu_Bar.H:47:34: note: passing argument to parameter 'shortcut' here
> int add(const char* label, int shortcut, Fl_Callback*, void *user_data=0, int flags=0);
> ^
> menubar-add.cxx:63:29: error: cannot initialize a parameter of type 'int' with an lvalue of type 'const char [3]'
> menu->add("&Edit/&Paste", "^v", MyMenuCallback, 0, FL_MENU_DIVIDER);
> ^~~~
> ../FL/Fl_Sys_Menu_Bar.H:47:34: note: passing argument to parameter 'shortcut' here
> int add(const char* label, int shortcut, Fl_Callback*, void *user_data=0, int flags=0);
> ^
> 5 errors generated.
> make: *** [menubar-add.o] Error 1
>
> I am going to look into that issue myself later. but I thought i should post it.
> This is from the current SVN tree.
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
[ Direct Link to Message ] | |
|
| |