File-selection cancel button and ...



	This is a strange behavior, my poor knowledge in computing can't let me
understand.

	See, I was doing a

void selection_du_fichier(void) /* using some french name to prevent
incompatibility ;-) */
{
  static  GtkWidget *window;
  window = gtk_file_selection_new ("select tree file");

	So, the cancel button would not work

gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION
(window)->cancel_button),  "clicked", (GtkSignalFunc) gtk_widget_destroy,
			     GTK_OBJECT(window))

until I put in my program (before it):

 gtk_signal_connect (GTK_OBJECT (window), "destroy",(GtkSignalFunc)
destroy_window, &window);
  gtk_signal_connect (GTK_OBJECT (window), "delete_event",(GtkSignalFunc)
destroy_window, &window);

	Don't know which one of the two is used by gtk_widget_destroy. So
gtk_widget_destroy destroy all the childs of window and then send the "destroy"
or "delete_event" to my program? In which I have to put the

void
destroy_window (GtkWidget  *widget,
		GtkWidget **window)
{
  *window = NULL;
}

	Which I don't like so much (don't know why ;-).

	So, I think there is reasons why you want the app to do things before
destroying the parent window. So, I have two questions :

	-Why (and save the answer for the doc ;-). I think I begin to
understand that you want to let the programmer do things before destroying the
parent (savings, checks or so).

	Is *window==NULL enough to free memory?

						Thanks for any tips,

								Francois.
P.S.: Please include in the doc that gtk_widget_destroy destroy the childs and
then send the destroy signal to the parent. Thanks ;-). If the guys who should
make the doc need it, I can send such comments if you think it can help...

-- 
Francois Jeanmougin     | groupe de bioinformatique / bioinformatics groupe
tel:(+33) 3 88 65 32 71 | IGBMC BP 163 67404 Illkirch France
e-mail: jeanmougin@igbmc.u-strasbg.fr
"Ce sont des desespoirs d'intellectuels ennuyes, ou des ennuis 
d'intellectuels desesperes, comme vous voulez, comme vous voulez" M. Benin



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]