SF.net SVN: geany-plugins:[465] trunk/spellcheck

eht16 at users.sourceforge.net eht16 at xxxxx
Sun Feb 8 21:04:50 UTC 2009


Revision: 465
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=465&view=rev
Author:   eht16
Date:     2009-02-08 21:04:50 +0000 (Sun, 08 Feb 2009)

Log Message:
-----------
If the toolbar item is disabled, just hide it instead of destroying it.

Modified Paths:
--------------
    trunk/spellcheck/ChangeLog
    trunk/spellcheck/src/gui.c

Modified: trunk/spellcheck/ChangeLog
===================================================================
--- trunk/spellcheck/ChangeLog	2009-02-08 20:57:41 UTC (rev 464)
+++ trunk/spellcheck/ChangeLog	2009-02-08 21:04:50 UTC (rev 465)
@@ -2,6 +2,8 @@
 
  * src/gui.c:
    Remove unnecessary gpointer casts.
+   If the toolbar item is disabled, just hide it instead of destroying
+   it.
 
 
 2009-02-02  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>

Modified: trunk/spellcheck/src/gui.c
===================================================================
--- trunk/spellcheck/src/gui.c	2009-02-08 20:57:41 UTC (rev 464)
+++ trunk/spellcheck/src/gui.c	2009-02-08 21:04:50 UTC (rev 465)
@@ -101,8 +101,7 @@
 	{
 		if (sc->toolbar_button != NULL)
 		{
-			gtk_widget_destroy(GTK_WIDGET(sc->toolbar_button));
-			sc->toolbar_button = NULL;
+			gtk_widget_hide(GTK_WIDGET(sc->toolbar_button));
 		}
 	}
 	else
@@ -114,13 +113,13 @@
 			gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(sc->toolbar_button),
 				_("Toggle spell check while typing"));
 #endif
-			gtk_widget_show(GTK_WIDGET(sc->toolbar_button));
 			plugin_add_toolbar_item(geany_plugin, sc->toolbar_button);
 			ui_add_document_sensitive(GTK_WIDGET(sc->toolbar_button));
 
 			g_signal_connect(sc->toolbar_button, "toggled",
 				G_CALLBACK(toolbar_item_toggled_cb), NULL);
 		}
+		gtk_widget_show(GTK_WIDGET(sc->toolbar_button));
 
 		ignore_sc_callback = TRUE;
 		gtk_toggle_tool_button_set_active(


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



More information about the Plugins-Commits mailing list