[Vala] Application Menu



I want convert my application to use the Gnome 3 style menu instead of
having a menubar. Gnome 3 has been out forever, so it's about time.

Anyway, I can't seem to get it to work. Here's what I've got so far.

I have this code as a class level variable:

private const ActionEntry[] action_entries =
      {
         { "view_log", view_log_cb },
         { "help", help_cb },
         { "about", about_cb },
         { "quit", quit_cb },
      } ;

During startup, I call this:

add_action_entries (action_entries, this) ;

Followed by this:

var builder = new Gtk.Builder () ;
 try {
    builder.add_from_resource ("/org/gnome/balistica/menu.ui") ;
 } catch ( Error e ){
    logger.publish (new LogMsg (e.message)) ;
 }

 var menu = builder.get_object ("appmenu") as MenuModel ;
 set_app_menu (menu) ;

Finally, I have my menu.ui file in my resources.xml file. I know that
my resources.xml is working otherwise because that's where my glade
files are listed and the GUI comes up otherwise. Does anyone have any
idea what I'm missing?

Steven N. Oliver


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]