[maemo-developers] [maemo-developers] GTK UI Manager and Maemo
From: Kalle Vahlman kalle.vahlman at gmail.comDate: Mon Dec 5 18:39:54 EET 2005
- Previous message: [maemo-developers] GTK UI Manager and Maemo
- Next message: [maemo-developers] GTK UI Manager and Maemo
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
2005/12/5, Luca Donaggio <donaggio at gmail.com>: > I'm Hildonizing a GTK2 application which uses ui_manager_* functions to > build its menu and I'm having the following problem: > > each menu, upon its creation, is attached to a parent GtkMenuBar and It > seems that I can't re-assign it to the GtkMenu built in in my HildonAppView. > That's what I do: > > mainmenu = hildon_appview_get_menu (HILDON_APPVIEW (window)); > gtk_menu_append (mainmenu, GTK_MENU (gtk_ui_manager_get_widget (ui, > "/MenuBar/FileMenu"))); The File menu is inside the MenuBar when you get_widget() it, which means it has a parent already, thus the error: > GLIB WARNING ** Gtk - Can't set a parent on widget which has a parent You could try with gtk_widget_reparent(), but I don't know how it will affect the ui manager finding it's widgets (and thus working). > looking at the on-line tutorials on maemo.org, it seems that ui_manager > method to build menu is supported, but it's not explained hot to get it to > work! Where does it state that? Didn't find a reference to it in the development Howto at least... It's true that the svn repository holds a ui-manager supporting version of hildonapp and hildonappview but those were added recently, and I won't even try to guess when they'll be in the product images... > P.S.: adding toolbars created with this very same method works pretty well! That's different, you're just packing the toolbar somewhere instead of replacing it as is the case with the menubar. Some wacky hacker has[1] noted that since the menu happens to be the first element in the _private_ structure of hildonappview, you can actually hack your own widget there and the appview won't know the difference, but that hack is so gruesom that I won't even try to reconstruct it here ;) [1] Hi, Mr. Vire :) -- Kalle Vahlman, zuh at iki.fi Powered by http://movial.fi
- Previous message: [maemo-developers] GTK UI Manager and Maemo
- Next message: [maemo-developers] GTK UI Manager and Maemo
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]