>> 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 ...
}                       

_______________________________________________
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list

Reply via email to