Setting up interface from glade file



I'm currently using the following method to retrieve a Glib::RefPtr to a Gtk::ActionGroup:

  action_group = Glib::RefPtr<Gtk::ActionGroup>::cast_dynamic(
    builder()->get_object("actiongroup_main"));

I was wondering if there is a specific method for retrieving an ActionGroup RefPtr in a similar way to get_widget? If not, and purely out of curiosity, why not?; the above just looks so ugly and hackish.

Also, maybe I've missed something but because I'm loading a glade file via Gtk::Builder I couldn't find a better way of connecting activate signals to actions other than to:

 * get RefPtr to action group
 * for every action, connect signal

Is there a better way of doing this?

Lastly, does anybody know of a reference on the net to a tutorial/guide on how to define global shortcuts in Glade? I just can't for the life of me get global keyboard shortcuts to work - as in, show up in the menus and trigger action when pressed.

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