create_new_window((GtkWidget*)menuitem, user_data, TRUE);
}
-
-void
-on_tab_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
+void create_new_tab(GtkWidget* widget, gpointer user_data){
gchar label[PATH_LENGTH];
- MainWindow * mw_data = get_window_data_struct((GtkWidget*)menuitem);
- GtkNotebook * notebook = (GtkNotebook *)lookup_widget((GtkWidget*)menuitem, "MNotebook");
+ MainWindow * mw_data = get_window_data_struct(widget);
+ GtkNotebook * notebook = (GtkNotebook *)lookup_widget(widget, "MNotebook");
if(notebook == NULL){
g_printf("Notebook does not exist\n");
return;
create_tab (mw_data, mw_data, notebook, label);
}
+void
+on_tab_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ create_new_tab((GtkWidget*)menuitem, user_data);
+}
+
void
on_open_activate (GtkMenuItem *menuitem,
create_new_window((GtkWidget*)button, user_data, FALSE);
}
+void
+on_button_new_tab_clicked (GtkButton *button,
+ gpointer user_data)
+{
+ create_new_tab((GtkWidget*)button, user_data);
+}
void
on_button_open_clicked (GtkButton *button,
GtkWidget *MToolbar1;
GtkWidget *tmp_toolbar_icon;
GtkWidget *tlbEmptyTraceset;
+ GtkWidget *tlbTab;
// GtkWidget *tlbOpenTraceset;
GtkWidget *tlbAddTrace;
GtkWidget *tlbRemoveTrace;
gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (MToolbar1)->children)->data))->label), TRUE);
gtk_widget_show (tlbEmptyTraceset);
gtk_container_set_border_width (GTK_CONTAINER (tlbEmptyTraceset), 1);
+
+ tmp_toolbar_icon = create_pixmap (MWindow, "filenew.png");
+ tlbTab = gtk_toolbar_append_element (GTK_TOOLBAR (MToolbar1),
+ GTK_TOOLBAR_CHILD_BUTTON,
+ NULL,
+ "",
+ "New tab", NULL,
+ tmp_toolbar_icon, NULL, NULL);
+ gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (MToolbar1)->children)->data))->label), TRUE);
+ gtk_widget_show (tlbTab);
+ gtk_container_set_border_width (GTK_CONTAINER (tlbTab), 1);
+
/*
tmp_toolbar_icon = create_pixmap (MWindow, "fileopen.png");
tlbOpenTraceset = gtk_toolbar_append_element (GTK_TOOLBAR (MToolbar1),
g_signal_connect ((gpointer) tlbEmptyTraceset, "clicked",
G_CALLBACK (on_button_new_clicked),
NULL);
+ g_signal_connect ((gpointer) tlbTab, "clicked",
+ G_CALLBACK (on_button_new_tab_clicked),
+ NULL);
/*
g_signal_connect ((gpointer) tlbOpenTraceset, "clicked",
G_CALLBACK (on_button_open_clicked),
GLADE_HOOKUP_OBJECT (MWindow, About, "About");
GLADE_HOOKUP_OBJECT (MWindow, MToolbar1, "MToolbar1");
GLADE_HOOKUP_OBJECT (MWindow, tlbEmptyTraceset, "tlbEmptyTraceset");
+ GLADE_HOOKUP_OBJECT (MWindow, tlbTab, "tlbTab");
// GLADE_HOOKUP_OBJECT (MWindow, tlbOpenTraceset, "tlbOpenTraceset");
GLADE_HOOKUP_OBJECT (MWindow, tlbAddTrace, "tlbAddTrace");
GLADE_HOOKUP_OBJECT (MWindow, tlbRemoveTrace, "tlbRemoveTrace");