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

Danny Milosavljevic danny_milo at yahoo.com
Tue Nov 28 19:54:18 CET 2006


Hi,

On Tue, 28 Nov 2006 12:28:16 +0100, Andreas Bogk wrote:

> Danny Milosavljevic schrieb:
[...]
>> 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.

Hmm, that needs special handling, then...

>> <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,

Good point.

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

I might be misunderstanding what you mean by "dynamically create", but in
gtk, the only use of signals is as "event slots" in the object. It's not
at all like a Twisted Deferred, if you meant that. It's pretty much
exactly like an "event" in dotnet.

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

Well, that would be: all of GTK's widgets. :)

I'd wager a bet that not a single g_signal_new call is outside of
class_init (which "constructs" the class, not the instance).

That is, the only way a signal can be created is g_signal_new, so it's not
surprising that it is used much ;)

cheers,
  Danny




More information about the hackers mailing list