Re: gtk_widget_event()
- From: Paul Barton-Davis <pbd Op Net>
- To: gtk-list gnome org
- Subject: Re: gtk_widget_event()
- Date: Sun, 10 Dec 2000 20:01:36 -0500
>> The context is a custom file selection thingy. I'd like for
>> double-clicking on a file to accomplish the same as selecting
>> the file then clicking "OK". gtk_widget_activate(ok_button,
>> "clicked") achieves part of this: it selects the file and closes
>> the file selection window, like the OK button does. But it
>> seems that the doubleclick is not cleaning up properly. When
>> you close the window with a real click on "OK" everything's
>> alright, but doubleclicking on a file gives a spew of warnings
>> about failed casts and unrefs, after the file selector closes.
is there a reason why this approach will not work ?
void all_done ()
{
... wrap up ...
}
gint ok_clicked_handler (GtkWidget *w, GdkEventButton *ev)
{
all_done ();
return TRUE;
}
gint button_press_handler (GtkWidget *w, GdkEventButton *ev)
{
if (ev->type == GDK_EVENT_2BUTTON_PRESS) {
all_done ();
return TRUE;
}
... normal mouse button handling ...
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]