Help with writing dynamic menus in gnome panel applets
- From: dbaker 0bits com
- To: gnome-devel-list gnome org
- Subject: Help with writing dynamic menus in gnome panel applets
- Date: Wed, 25 Oct 2006 01:48:55 +0400
Hi all,
I'm trying in vain to finish the last bit of my applet but can't seem to
figure it out. Rather than spending more time reading i thought i may
short circuit the learning process and ask for help.
I fundamentally need to build a dynamic menu on the panel. This i've
done and it comes up fine and i can click on items and correct actions
happen. I've also read the 'writing panel applets' tutorial, but what
i'm requiring is not covered.
So what i currently have is a menu like below that appears in the panel
when i right click on my applet icon.
+-------------------+
| AAAAA |
+-------------------+
| BBBBB |
| CCCCC |
+-------------------+
| Remove from Panel |
| Move |
+-------------------+
| Lock to Panel |
+-------------------+
The items AAAAA, BBBBB and CCCCC are created by me and the rest are the
default panel items.
Now i need to programatically add new menu items at a specific location
in the menu, like just after AAAAA and before BBBBB. If i use
bonobo_ui_component_set_translate(uic, "/popups/popup", xml, ev);
it always *appends* to my previously crated items and appears after the
CCCCC menu item.
So how do i add an item at a specific index in the menu ? Do i need to
rebuild the complete menu xml every time by doing a thaw() and then
bonobo_ui_component_rm() followed by a bonobo_ui_component_set_translate() ?
Am i missing something ?
Thanks
Dave
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]