Re: [gtk-list] closing windows
- From: Michael Elkins <Michael_Elkins nai com>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] closing windows
- Date: Mon, 28 Jun 1999 14:09:11 -0700
On Mon, Jun 28, 1999 at 02:24:17PM -0400, Alexandre Sagala wrote:
> I have a problem I have a main window and a another window that pops-up
> ( call it wondow2) on top when the user clicks a button. In window2 I
> have a ok button and a cancel button . To kill the window when cnacle
> is clicked I do a
>
>
> gtk_signal_connect_object (GTK_OBJECT (button2),
> "clicked",GTK_SIGNAL_FUNC (gtk_widget_destroy),GTK_OBJECT (window));
>
> and it works but for the ok button on the click event I call up a
> function to check if all the info entered is ok but I wnt to kill the
> window and the same fucniton how can I do that????????????
Just pass the window you want to close after clicking the "ok" button as a
parameter to the fucntion you are calling, eg.
ok_cb (GtkWidget *widget, gpointer window)
{
/* check data in widget... */
...
/* close window */
gtk_widget_destroy (GTK_WIDGET (window));
}
gtk_signal_connect (GTK_OBJECT (ok_button), "clicked", ok_cb, (gpointer) window);
me
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]