make notebook tabs scrollable, if not all fits into the pane,
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 9 May 2004 07:01:07 +0000 (07:01 +0000)
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 9 May 2004 07:01:07 +0000 (07:01 +0000)
enable a popup menu on the notebook tabs, with the tab labels

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10828 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/menu.c
gtk/proto_draw.c

index aab64acbd001e06881942106f7e42d55ff7d4ba6..2b5a8744382ff117efe90ff872e4054635ea6ac6 100644 (file)
@@ -1,7 +1,7 @@
 /* menu.c
  * Menu routines
  *
- * $Id: menu.c,v 1.192 2004/05/07 12:15:24 ulfl Exp $
+ * $Id: menu.c,v 1.193 2004/05/09 07:01:06 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -1386,7 +1386,8 @@ popup_menu_handler(GtkWidget *widget, GdkEvent *event, gpointer data)
         byte_view_select(widget, (GdkEventButton *) event);
     }
 
-    if(event->type == GDK_BUTTON_PRESS) {
+    /* context menu handler (but the byte view notebook pages have their own handler) */
+    if(event->type == GDK_BUTTON_PRESS && widget != byte_nb_ptr) {
         event_button = (GdkEventButton *) event;
 
         /* To qoute the "Gdk Event Structures" doc:
index e145a5897514b5ed647b2f121976c3443d85a838..0c3e91b8823545f51d8788389540ade0512bd277 100644 (file)
@@ -1,7 +1,7 @@
 /* proto_draw.c
  * Routines for GTK+ packet display
  *
- * $Id: proto_draw.c,v 1.93 2004/05/01 15:15:08 ulfl Exp $
+ * $Id: proto_draw.c,v 1.94 2004/05/09 07:01:07 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -631,6 +631,12 @@ byte_view_new(void)
   /* this will only have an effect, if no tabs are shown */
   gtk_notebook_set_show_border(GTK_NOTEBOOK(byte_nb), FALSE);
 
+  /* set the tabs scrollable, if they don't fit into the pane */
+  gtk_notebook_set_scrollable(GTK_NOTEBOOK(byte_nb), TRUE);
+
+  /* enable a popup menu containing the tab labels, will be helpful if tabs don't fit into the pane */
+  gtk_notebook_popup_enable(GTK_NOTEBOOK(byte_nb));
+
   /* Add a placeholder byte view so that there's at least something
      displayed in the byte view notebook. */
   add_byte_tab(byte_nb, "", NULL, NULL, NULL);