Re: how to remove the tear-off line in a menu (context-menu) in gtk1



did you try the function
gtk_menu_set_tearoff_state(GtkMenu*, gboolean);


Best regards,
---
Jean-Christophe Berthon

Cap Gemini Ernst & Young
France
Skill IS -- Image Quality
e-mail: Jean-Christophe Berthon cgey com
Tel: (+33) 561 31 6671


----- Original Message -----
From: "Joergen Scheibengruber"
<Joergen Scheibengruber informatik uni-ulm de>
To: <gtk-app-devel-list gnome org>
Sent: Friday, May 31, 2002 4:05 PM
Subject: Re: how to remove the tear-off line in a menu (context-menu) in
gtk1


Am Don, 2002-05-30 um 14.43 schrieb Joergen Scheibengruber:
Hi!

I have a little problem: What I have is a GtkClist with a contextmenu
created by libglade. I show the context_menu with gtk_menu_popup(), and
unfortunatly it has a tear-off line. (I don't think a context-menu
should have one). So my question is how to get rid of it. I did not find
anything in the properties of the menu in glade and there doesn't seem
to be a function in the gtk_menu doc either.

In case someone has the same problem, I'll post my solution here. It's a
little hack, but I think the only solution. However I think there should
be an option in glade, which allows you to specify if a menu has a
tearoff-item or not.

static void
context_menu_remove_tearoff(void)
{
    GtkWidget *context_menu;
    GList *tearoff, *children;

    context_menu = glade_xml_get_widget(MYPROJECT, "context_menu");
    g_assert(context_menu);
    children = GTK_MENU_SHELL(context_menu)->children;
    g_assert(children);
    tearoff = g_list_first(children);
    g_assert(GTK_IS_TEAROFF_MENU_ITEM(tearoff->data));

    /* I hide the tearoff-item instead of destroying
     * it, thats more simple
     */
    gtk_widget_hide(tearoff->data);
}

Jörgen

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




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