[PATCH] Delete event on pref dialog

Emmanuel Saracco <[email protected]>
Newsgroups gmane.comp.audio.jamin.devel
Message-ID <[email protected]>
Hi all,

First of all: Happy new year :-)

Here is a patch for "delete_event" management on preferences dialog.

* Issue:

	When you close preferences dialog with the top right window close 
button you can not reopen it anymore:

-----
(jamin:21602): Gtk-CRITICAL **: gtk_widget_show: assertion 
`GTK_IS_WIDGET (widget)' failed
-----

* Solution:

	Add a "delete_event" callback.

-> You will need to regenerate "interface.*" files with glade 2 after 
applying this patch.

Bye

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

_______________________________________________
Jamin-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jamin-devel
jamin-pref-dialog-delete-event.patch (text/x-patch, 1.7 KB)
diff -BruNa jamin_orig/jam-ui.glade jamin/jam-ui.glade
--- jamin_orig/jam-ui.glade	2007-07-01 17:33:17.000000000 +0200
+++ jamin/jam-ui.glade	2008-01-09 14:26:07.000000000 +0100
@@ -7927,6 +7927,7 @@
   <property name="focus_on_map">True</property>
   <property name="urgency_hint">False</property>
   <property name="has_separator">True</property>
+  <signal name="delete_event" handler="on_pref_dialog_delete_event" last_modification_time="Wed, 09 Jan 2008 14:16:35 GMT"/>
 
   <child internal-child="vbox">
     <widget class="GtkVBox" id="dialog-vbox1">
diff -BruNa jamin_orig/src/callbacks.c jamin/src/callbacks.c
--- jamin_orig/src/callbacks.c	2007-11-05 18:52:01.000000000 +0100
+++ jamin/src/callbacks.c	2008-01-09 14:26:20.000000000 +0100
@@ -3273,3 +3273,14 @@
 {
   s_set_value_ui (S_LIM_LOGSCALE, gtk_range_get_adjustment (GTK_RANGE (range))->value);
 }
+
+gboolean
+on_pref_dialog_delete_event            (GtkWidget       *widget,
+                                        GdkEvent        *event,
+                                        gpointer         user_data)
+{
+  popup_pref_dialog (0);
+
+  return TRUE;
+}
+
diff -BruNa jamin_orig/src/callbacks.h jamin/src/callbacks.h
--- jamin_orig/src/callbacks.h	2007-11-05 18:52:01.000000000 +0100
+++ jamin/src/callbacks.h	2008-01-09 14:26:21.000000000 +0100
@@ -1313,3 +1313,8 @@
 void
 on_logscale_scale_value_changed        (GtkRange        *range,
                                         gpointer         user_data);
+
+gboolean
+on_pref_dialog_delete_event            (GtkWidget       *widget,
+                                        GdkEvent        *event,
+                                        gpointer         user_data);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.