В Срд, 25/10/2006 в 01:48 +0400, [EMAIL PROTECTED] пишет:
> 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() ?

Yes, you need to remove older items from the component and append new
items with set_translate.

To make things easier, you can add named placeholder with <placeholder>,
then you'll operate only on /popups/popup/removable_placeholder. For
reference please read
http://cvs.gnome.org/viewcvs/libbonoboui/doc/ui-xml.txt?rev=1.5&view=markup

And please note that removable menu items are bad thing in the usability
view, it's much better to mark unused actions as insensitive.

> 
> Am i missing something ?
> Thanks
> Dave
> _______________________________________________
> gnome-devel-list mailing list
> gnome-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gnome-devel-list

Attachment: signature.asc
Description: Эта часть сообщения подписана цифровой подписью

_______________________________________________
gnome-devel-list mailing list
gnome-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-devel-list

Reply via email to