Hi,

I would like to ask you for help using the Fl_Menu_Bar class.

More specifically, my problem is that the code:

Fl_Menu_Bar* _menuBar = new Fl_Menu_Bar( 0, 0, _mainWindowWidth, 30 );
_menuBar->add( "&File", 0, 0, 0, FL_SUBMENU );
_menuBar->add( "File/&Open sequence",  FL_CTRL + 'o',
               (Fl_Callback*)openSequence_handler, this, 0 );
_menuBar->add( "File/&Close sequence", FL_CTRL + 'w',
               (Fl_Callback*)closeSequence_handler, this, 0 );
_menuBar->add( "File/&Save",           FL_CTRL + 's',
               (Fl_Callback*)saveFile_cb, this, 0 );
_menuBar->add( "File/&Save as",        FL_CTRL + FL_SHIFT + 's',
               (Fl_Callback*)saveAsFile_handler, this, 0 );
_menuBar->add( "File/&Quit",           FL_CTRL + 'q',
               (Fl_Callback*)quit_cb, this, 0 );
_menuBar->add( "&Edit", 0, 0, 0, FL_SUBMENU );
_menuBar->add( "Edit/&Copy",           FL_CTRL + 'c',
               (Fl_Callback*)copySequence_handler, this, 0 );

for( int i = 0; i < _menuBar->size(); ++i )
{ Fl_Menu_Item* m = (Fl_Menu_Item*)&(_menuBar->menu()[i]);
  std::cout << m->label() << std::endl;
}

produces _only_ the output

&File
&Open sequence
&Close sequence
&Save
&Save as
&Quit

and nothing else. On top of that, the menu does not work at all. If I comment 
out the for() loop, then the menu works.

Any tip will be very much appreciated. Thanks!

Best regards,
p.

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

Reply via email to