Re: GtkUIManager questions.
- From: "Nils O." Selåsdal <noselasd frisurf no>
- To: Archit Baweja <bighead users sourceforge net>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: GtkUIManager questions.
- Date: Mon, 28 Jun 2004 14:19:30 +0200
On Thu, 2004-06-24 at 19:41, Archit Baweja wrote:
Hey Nils,
I'm guessing you didn't have previous experience with libbonoboui menus.
None.
"Nils O." SelÃsdal <noselasd frisurf no> writes:
I have a few GtkUIManager questions, first, is there
some nice tutorials/guides anywhere ?
1 With the following:
<ui><popup name="ProjectPopup>
<menuitem name="Build" action="Build"/>
<menuitem name="Execute" action="Execute"/>
<separator/>
<menuitem name="MoveUp" action="MoveUp"/>
<menuitem name="MoveDown" action="MoveDown"/>
<separator/>
<menuitem name="Remove" action="Remove"/>
</popup>
</ui>
Only the first separator shows, not the second !
Hmm, I don't know why it isn't showing. Is it showing the "Remove" menuitem?
Yes.
It seems to work if I give each separator a diffrent name attribute
though.
2. What's the <placeholder> for ?
placeholder is for menu merging. For example if you have
"<ui>"
" <menubar name='MainMenu'>"
" <menu name='FileMenu' action='FileMenu'>"
" <menuitem action='New'/>"
" <placeholder name='FileMenuAdditions'/>"
" <menuitem action='Exit'/>"
" </menu>"
" </menubar>"
"</ui>"
once you create a GtkUIManager etc with it. you can do something like
gtk_ui_manager_add_ui_from_string with a new string
<ui>
<menubar name='MainMenu'>
<menu name='FileMenu' action='FileMenu'
<placeholder name='FileMenuAdditions'/>
<menuitem action='Save'/>
</placeholder>
</menu>
</menubar>
</ui>
So the Save menuitem will show up after 'New' and before 'Exit' menuitem.
3. Constructing a menubar, how can I replace (and later
reenable) an entire menu, say I want to replace
a top "File" menu at a time, and later put it back.
after constructing GtkUIManager etc, you can do something like
GtkWidget *foo;
foo = gtk_ui_manager_get_widget (ui_manager, "/MainMenu/FileMenu");
gtk_widget_hide (foo);
to hide the menu.
Ok, and now I can just add another menu where the "FileMenu" was ?
4. Wouldn't a
GtkActionGroup gtk_ui_manager_get_action_by_name(GtkUIManager *self,
const gchar *name);
be nice ?
I think ur looking.
GtkAction* gtk_ui_manager_get_action (GtkUIManager *self,
const gchar *path);
Well, I'd like to get an action group in the gtkuimanager from
the name used when constructing the actiongroup as well.
Anyway, thanks for the answers.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]