I'm again grateful to you for your quick and effective help.

It was not clear to me from the docs that null pointers to menu items were 
interspersed in the menu. That explains the effect very well.

I took the loop literally from the tips page without realizing that it was 
meant as a toy example.

I also take your tip on the use of shortcuts. As I do not use them myself, I 
cut'n'pasted too much, did not test them... embarrasing. I guess it is ok to 
use the same shortcut for entries on different submenus, as "File/&Close" and 
"Edit/&Copy". At least the german version of Firefox has plenty of those cases.

Thanks again,
p.

>
>
> >     for( int t =3D 0; t < _menuBar->size(); ++t )
> >     { Fl_Menu_Item *m =3D (Fl_Menu_Item*)&(_menuBar->menu()[t]);
> >       std::cout << m->label() << std::endl;
> >     }
>
> I think your for loop is wrong - you are dereferencing NULL values.
>
> Try this instead:
>
>     for(int t =3D 0; t < _menuBar->size(); t++) {
>       Fl_Menu_Item *m =3D (Fl_Menu_Item *)&(_menuBar->menu()[t]);
>       if((m) && (m->label())) {
>          std::cout << m->label() << std::endl;
>       }
>     }
>
> Note that your menu shorcuts are probably broken too - you have
> liberally littered your menu items names with "&" symbols, which fltk
> will try and convert into global shortcuts - so a menu item named
> "&Save" will be allocated a shortcut of <key>-s but you have used the
> same symbols in multiple places (e.g. &Copy, &Close or &Save and "&Save
> As", etc...) AND you have allocated specific shortcuts to the keys...
> Confusing and probably inclined to giving inconsistent behaviours.
>
> Also - I'm sure you have your reasons, but that seem to be a very
> complicated way to set your callbacks up...
>
>
> SELEX Galileo Ltd
> Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS=
> 14 3EL
> A company registered in England & Wales.  Company no. 02426132
> ********************************************************************
> This email and any attachments are confidential to the intended
> recipient and may also be privileged. If you are not the intended
> recipient please delete it from your system and notify the sender.
> You should not copy it or use it for any purpose nor disclose or
> distribute its contents to any other person.
> ********************************************************************
>

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

Reply via email to