[Gd-hackers] gtk interface: shorten identifiers, ... ?

Andreas Bogk andreas at andreas.org
Tue Nov 28 12:28:16 CET 2006


Danny Milosavljevic schrieb:
> Well, I know of no other gtk binding that keeps the prefixes (not the
> python bindings and not the dotnet bindings; I didn't check the java
> bindings yet).

If this is common practice, it's ok, I'd think. :)

> Of course all this is only doable if dylan supports folding the 
> functions that arise from that into a generic function. e. g. "clear"
> would have:

It works, except for the case where the number of arguments varies.

> <widget>:
>   destroy :: <g-signal>
>   ...
> 
> To use object-oriented-speak. :)

Erm, be careful with your steps here. Dylan is object-oriented, even
though it doesn't have the notion of methods belonging to classes,

>> But still, this construction generates overhead for almost no value.
> Overhead? Like where? Connecting signals isn't in the critical path, anyway ;)

Like the extra function calls to retrieve the stub object?  And the stub
object itself?  But of course, you're right that it's not the critical path.

> I wonder why they were made strings in the first place (in the gtk/C
> interface), as opposed to published constants. (ok, so there is _one_
> special case "notify::<property>")

So that you can dynamically create signals, of course.

> It's not like new signals are created on a class dynamically while the
> program is executing, either. At least not in all of gtk and Xfce (of what
> I can remember... yeah yeah).

This might be true for the GTK widgets you're interested in, but
generally, googling for g_signal_new shows that it is quite a popular API.

Andreas




More information about the hackers mailing list