Fix close tab button bug introduced in last commit

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@480 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2006-06-25 12:48:38 +00:00
parent efe658834e
commit 93a9a2bd8a
2 changed files with 14 additions and 2 deletions

View File

@ -6,6 +6,7 @@
workaround for GTK+2.6.
Add notebook_new_tab and update document_create_new_sci to use it;
also remove on_tab_close_clicked.
* src/notebook.c: Fix close tab button bug introduced in last commit.
2006-06-24 Enrico Troeger <enrico.troeger@uvena.de>

View File

@ -44,6 +44,9 @@ notebook_motion_notify_event_cb(GtkWidget *widget, GdkEventMotion *event,
static gint
notebook_find_tab_num_at_pos(GtkNotebook *notebook, gint x, gint y);
static void
notebook_tab_close_clicked_cb(GtkButton *button, gpointer user_data);
/* There is a bug with drag reordering notebook tabs.
* Clicking (not dragging) on a notebook tab, then making a selection in the
@ -231,8 +234,8 @@ gint notebook_new_tab(gint doc_idx, gchar *title, GtkWidget *page)
GTK_WIDGET(page), hbox, this->tabmenu_label, 0);
// signal for clicking the tab-close button
g_signal_connect_swapped(G_OBJECT(but), "clicked",
G_CALLBACK(document_remove), GINT_TO_POINTER(tabnum));
g_signal_connect(G_OBJECT(but), "clicked",
G_CALLBACK(notebook_tab_close_clicked_cb), page);
// motion notify for GTK+2.6 (workaround child widgets don't pass on signal)
// doesn't seem to work
//g_signal_connect(G_OBJECT(this->tab_label), "motion-notify-event",
@ -240,3 +243,11 @@ gint notebook_new_tab(gint doc_idx, gchar *title, GtkWidget *page)
return tabnum;
}
static void
notebook_tab_close_clicked_cb(GtkButton *button, gpointer user_data)
{
gint cur_page = gtk_notebook_page_num(GTK_NOTEBOOK(app->notebook),
GTK_WIDGET(user_data));
document_remove(cur_page);
}