Hi Andy,

> I've read on how to do this for FLTK 1.*, but not FLTK 2.0. Basically,
> instead of writing seperate functions for items to callback, they will all
> call one. This one function will 'know' what was calling it and then
> perform the specific functions accordingly.

good idea, see CallbackBase http://www.fltk.org/links.php?V314
 
> I'm still unfamiliar with FLTK, let alone FLTK 2.0, so I keep on getting
> difficult errors while making a bunch of code snippets I can use for my
> programs.
> 
> I've tried making the following code: 
<snip />
> void app::m_cbAll(){}

AFAIK your callback function is dereferenced as plain function pointer
and has to be declared static.

<snip />
> I get the following build errors:
> -=-=-=-=-=-=-=-=-=-=
> ..\memorspace\main.cpp:33: error: `COMMAND' undeclared ...

COMMAND is unknown to the compiler, i guess you mean fltk::COMMAND
(or try using namespace fltk)

> The code isn't complete, since I have to find out why I keep on getting
> that COMMAND error in the fltk::Item. It's worked for my other code
> snippets, so I'm trying to figure out why it doesn't for this particular
> example. It might be something obvious, or that I've misunderstood a
> concept...

to handle all menu callbacks, it's enough to set the callback function
for the menu. the emitting widget will be accesible through
        fltk::Widget* m=((fltk::Menu*)origin)->item();

good luck!
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to