Re: Callback from which window???
- From: Paul Davis <pbd Op Net>
- To: pzn terra com br
- Cc: gtk-list gnome org
- Subject: Re: Callback from which window???
- Date: Wed, 25 Jul 2001 22:07:26 -0400
> GtkWidget *winA;
> GtkWidget *winB;
> winA = create_winmon (); // <- creates my window with a button
> gtk_widget_show (winA);
> winB = create_winmon (); // <- creates another window just like the other
> gtk_widget_show (winB);
> gtk_main();
> ...
>
> But there is a problem... both windows have a button1 with "clicked" event
>that calls function "on_button1_clicked".
>
> If I click the button1 in winA it calls on_button1_clicked.
> If I click the button1 in winB it calls on_button1_clicked.
>
> How can I know inside on_button1_clicked function which window was it calle
>d from?
gtk_signal_connect (GTK_OBJECT(winA->button1), "clicked",
(GtkSignalFunc) on_button1_clicked,
winA);
void on_button1_clicked (GtkWidget *widget, gpointer data)
{
GtkWidget *which_window = (GtkWidget *) data;
.
.
.
}
all clear?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]