Re: why are signals strings instead of integer constants?




Elliot Lee writes:
>Because it's more flexible.
>
>Internally, signals are represented as numbers to speed up signal
>emissions and such, but stuff that humans can read (i.e. character
>strings) is so much easier to deal with, and infinitely more flexible ;-)

In particular, gtk widgets that are not part of the gtk+ distribution
can add new signals without having to have a central signal ID
registry.

Because signal names are translated internally to numbers, the cost
of using them is minimal; they are translated when signal handlers
are set up, not when the signal handlers are called.

michaelkjohnson

"Magazines all too frequently lead to books and should be regarded by the
 prudent as the heavy petting of literature."            -- Fran Lebowitz
 Linux Application Development       http://www.redhat.com/~johnsonm/lad/



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