ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-bugs: [Wireshark-bugs] [Bug 6207] Add the ability to save filters from the Filter Tool

Date: Sun, 11 Sep 2011 22:13:51 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6207

--- Comment #29 from Anders Broman <anders.broman@xxxxxxxxxxxx> 2011-09-11 22:13:47 PDT ---
>> It should be easy to remove a button directly from the toolbar, and maybe be
>> able to edit the title and display filter without having to open the
>> preferences.  We have this functionality for columns, where you can
>> left-click the column header to change settings, show/hide and remove
>>columns.
>
>This would add a menu to a button, something which I don't know how to do.

Hi,
How about using a menu_tool_button? the button is a bit large but it seems
the simplest approach. Something like this:
ndex: filter_expression_save_dlg.c
===================================================================
--- filter_expression_save_dlg.c        (revision 38950)
+++ filter_expression_save_dlg.c        (working copy)
@@ -189,16 +189,18 @@
                return(0);

        /* Create the "Label" button */
-       fe->button = gtk_tool_button_new(NULL, fe->label);
+       fe->button = gtk_menu_tool_button_new(NULL, fe->label);
        g_signal_connect(fe->button, "clicked", G_CALLBACK(filter_button_cb),
            NULL);
        gtk_widget_set_sensitive(GTK_WIDGET(fe->button), FALSE);
        gtk_widget_show(GTK_WIDGET(fe->button));

+       //gtk_menu_tool_button_set_menu( (GTK_MENU_TOOL_BUTTON(fe->bu
tton, GtkWidget *
menu);
+
        gtk_toolbar_insert(GTK_TOOLBAR(_filter_tb), fe->button, -1);
        gtk_widget_set_sensitive(GTK_WIDGET(fe->button), TRUE);
        gtk_widget_set_tooltip_text(GTK_WIDGET(fe->button), fe->expression);
-
+       gtk_menu_tool_button_set_arrow_tooltip_text
(GTK_MENU_TOOL_BUTTON(fe->bu
tton), "Open edit filter button menu");
        return(0);
}

/Anders

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.