FLTK logo

[fltk.general] Re: Fl_Sys_Menu's add method throws errors.

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Fl_Sys_Menu's add method throws errors. Kevin Ingwersen Jan 13, 2014  
 
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 ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.