Re: signal functions in a package module file




On Aug 3, 2008, at 9:42 AM, Torsten Schoenfeld wrote:

Kevin Ryde wrote:
hide_on_delete() is mostly a C convenience function because C does not have closures: I wouldn't bind that inside an high-level language that
does have them.

Don't forget the principle "why can't someone else do it" -- as
Springfield's most famous sanitation inspector said.  I for instance
have to check almost every time whether it's true or false to propagate
/ not propagate.

I don't have much of an opinion about wrapping gtk_widget_hide_on_delete. muppet?

If we bound it conventionally, that would look like this:

$window->signal_connect (delete_event => \&Gtk2::Widget::hide_on_delete);

which is actually *longer* than just writing out the closure, and you still wouldn't be able to specify "gtk_widget_hide_on_delete" in a glade xml file. But, there's less chance of messing up and letting the window be destroyed, so that's a good thing.

If that looks alright, then I say go for it.


What about adding new constants DO_PROPAGATE and DO_NOT_PROPAGATE to Glib, though?

They are not glib constants --- they would be part of gtk+, to complement the semantics of GtkWidget event functions, which use _gtk_boolean_handled_accumulator().



--
Diane, ten-oh-three, Great Northern Hotel.
Sheriff Truman and I have just been with the one-armed man, or what's left of him. In another time, another culture, he may have been a seer, or a shaman priest, but in our world, he's a shoe salesman, and lives among the shadows.
-- Special Agent Dale Cooper




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