removing toolbars from an app




 Hi,

Have you tried to call get_dock(self)?

This is in python, but it certainly exist in C.

Query the whole dock and destroy it!

You shouldn't even need to destroy anything else!

Also, doesn't create_toolbar(toolbarinfo) return the widget?

In this case you could also reference it then kill it with destroy!

I hope this helps!
 

On Mon, 10 Jan 2000 19:12:11 Edwin Young wrote:
> Hi,
> 
> I have a couple of different toolbars, and I'd like the user to be
> able to switch each of them on or off independently. Removing
> them is causing me some headaches. First, I tried
> hiding the GnomeDockItem for that toolbar. That worked, but
> unfortunately even if all the toolbars in a band are hidden, the band
> stays visible, so the app has a big grey  bar across the top. Next,
> I tried the function below. remove_item_by_name returns true,
> but it doesn't seem to do anything. Any suggestions?
> 
> void
> hide_move_toolbar_cb(GtkMenuItem *widget, gpointer user_data)
> {
>  GtkWidget *dock = GNOME_APP(app)->dock;
>  static GnomeDockPlacement place;
>  static guint band,pos,off;
>  GnomeDockItem *item =
>   gnome_dock_get_item_by_name(GNOME_DOCK(dock),"move",
>          &place,&band,&pos,&off);
> 
>  if(item) {
>   GnomeDockLayout *layout = gnome_dock_get_layout(GNOME_DOCK(dock));
>   gnome_dock_layout_remove_item_by_name(GNOME_DOCK_LAYOUT(layout),
>             "move");
>  } else {
>   gnome_app_add_toolbar(GNOME_APP (app),
>           GTK_TOOLBAR(toolbar_move),
>           "move",
>           GNOME_DOCK_ITEM_BEH_NORMAL,
>           place,
>           band,pos,off);
>  }
>  gtk_item_toggle(GTK_ITEM(widget));
> }
> 
> Thanks,
> 
> --
> Edwin Young
> 
> 
> -- 
> To unsubscribe: mail gnome-devel-list-request@gnome.org with "unsubscribe"
> as the Subject.
> 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]