SF.net SVN: geany: [480] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Sun Jun 25 12:48:44 UTC 2006


Revision: 480
Author:   ntrel
Date:     2006-06-25 05:48:38 -0700 (Sun, 25 Jun 2006)
ViewCVS:  http://svn.sourceforge.net/geany/?rev=480&view=rev

Log Message:
-----------
Fix close tab button bug introduced in last commit

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/notebook.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-06-25 12:13:35 UTC (rev 479)
+++ trunk/ChangeLog	2006-06-25 12:48:38 UTC (rev 480)
@@ -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 at uvena.de>

Modified: trunk/src/notebook.c
===================================================================
--- trunk/src/notebook.c	2006-06-25 12:13:35 UTC (rev 479)
+++ trunk/src/notebook.c	2006-06-25 12:48:38 UTC (rev 480)
@@ -44,7 +44,10 @@
 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
  * Scintilla widget will cause a strange selection bug.
@@ -231,8 +234,8 @@
 			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 @@
 	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);
+}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Commits mailing list