FLTK logo

Re: [fltk.coredev] macOS Fl_Sys_Menu_Bar's clear()

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.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: macOS Fl_Sys_Menu_Bar's clear() Gonzalo Garramuno May 13, 2022  
 

> El 13 may. 2022, a las 11:01, Manolo <manolo.gouy@gmail.com> escribió:
> 
> The menubar demo program calls Fl_Sys_Menu_Bar::clear() when switching from the Fl_Sys_Menu_bar mode
> to the Fl_Menu_Bar mode. The effect is that all macOS menus do disappear. Only the application menu remains, but that's a feature because an app should always have an application menu.
> 
> Please, describe in more detail the program you use that create the problem you report.

I confirm that the demo program works.  However, in my use case, it doesn’t.  I have a function that is used to fill both a RMB Fl_Menu_Button and the Fl_Menu_Bar (in this case Fl_Sys_Menu_Bar).  I fill the menu using the base class Fl_Menu_, like:


 void ImageView::fill_menu( Fl_Menu_* menu )
 {
     menu->clear();

     int idx = 1;

     menu->add( _("File/Open/Movie or Sequence"),
                      kOpenImage.hotkey(),
                      (Fl_Callback*)open_cb, browser() );

     menu->add( _("File/Open/Single Image"), kOpenSingleImage.hotkey(),
                (Fl_Callback*)open_single_cb, browser() );

     mrv::media fg = foreground();
     if ( !fg )
     {
         menu->add( _("File/Open/Directory"), kOpenDirectory.hotkey(),
                          (Fl_Callback*)open_dir_cb, browser() );
         menu->add( _("File/Open/Session"),
                    kOpenSession.hotkey(),
                    (Fl_Callback*)open_session_cb, browser() );
     }

….etc….
}


What happens is that the Fl_Sys_Menu_Bar is filled once, but when the function is called again, it does not clear it.

-- 
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/148D4A4F-1F61-433C-AA8D-6B0700AA7E8E%40gmail.com.
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'.