MacArthur, Ian (SELEX GALILEO, UK) wrote:
>
>> for( int t = 0; t < _menuBar->size(); ++t )
>> { Fl_Menu_Item *m = (Fl_Menu_Item*)&(_menuBar->menu()[t]);
>> std::cout << m->label() << std::endl;
>> }
>
> I think your for loop is wrong - you are dereferencing NULL values.
Good point. When I tested the partial code parts, I did not only
replace variable names, but I also replaced std::cout with
printf(), and that's why it worked for me.
Interesting observation(s) on Windows/Cygwin:
The first std::cout with a Null pointer seem to "close" the output
channel. No more output reaches the console terminal window.
However, printf() still works. printf() with %s and a Null pointer
writes "(null)" to stdout, and I saw similar output on Linux.
When I added a printf() to the callback(s), the printf() worked,
although the cout didn't. That explained why the callbacks seemed
"not to work" for the OP.
Does anybody know if this is defined behavior of std::cout ? Or
is it a bug? Maybe Windows only?
Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk