[maemo-developers] [maemo-developers] GtkUIManager and HildonAppView
From: Kaj Grönholm kaj.gronholm at nomovok.comDate: Wed Nov 16 15:18:21 EET 2005
- Previous message: [maemo-developers] GtkUIManager and HildonAppView
- Next message: [maemo-developers] GtkUIManager and HildonAppView
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
On Wed, 2005-11-16 at 13:25 +0200, Jorn Baayen wrote:
> Hi,
>
> I am working on an application where being able to use a GtkUIManager
> would be a big help. However, as far as I can tell, there is no way to
> bind a GtkUIManager-created menu to a HildonAppView ? If there indeed is
> no such possibility presently, is such a feature planned ?
>
> Thanks,
>
> Jorn
>
Using GtkUIManager with Hildon is indeed possible, so no need to create
menus & toolbars manually. Just use GtkUIManager normally, create XML
description, GtkActionEntry set and then use them with something like
this:
---
HildonAppView *app_view;
GtkUIManager *ui_manager;
GtkActionGroup *actions;
GtkMenu *menu_appview;
GtkWidget *menu_created;
...
/* Create action group */
actions = gtk_action_group_new("Actions");
gtk_action_group_set_translation_domain(actions, GETTEXT_PACKAGE);
gtk_action_group_add_actions(actions, action_entries,
n_action_entries, user_data);
/* Create new UI manager */
ui_manager = gtk_ui_manager_new();
gtk_ui_manager_insert_action_group(ui_manager, actions, 0);
/* Transfer menu items to app_view menu */
menu_appview = hildon_appview_get_menu(app_view);
menu_created = gtk_ui_manager_get_widget(ui_manager, "/MenuBar");
gtk_container_foreach(GTK_CONTAINER(menu_created), (GtkCallback)
gtk_widget_reparent, menu_appview);
...
---
Not a full source, but hopefully you'll get the point =)
- Kaitsu -
--
Kaj Grönholm
phone: +358 50 5308 233
fax: +358 9 4365 8712
kaj.gronholm[at]nomovok.com
- Previous message: [maemo-developers] GtkUIManager and HildonAppView
- Next message: [maemo-developers] GtkUIManager and HildonAppView
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
