Re: Finding out the signal detail from a handler



On Sun, 2004-06-27 at 12:44 +0200, Daniel Brockman wrote:
> Hi folks,
> 
> I've been looking through the GSignal documentation and source in vain
> for a way to find out what detail a signal was emitted with within a
> signal handler that was connected without a detail.
> 
> For example, let's say I want to connect a handler to the "notify"
> signal, and perform different actions depending on which property was
> changed.  Alternatively, let's say I want to print the name of the
> property that was changed.
> 
> The reason I want to do this is in fact to avoid having to create lots
> of small signal handlers to do similar tasks.
> 
> Is this at all possible?  If it isn't, could it and should it be?

For the exact case of GObject::notify, you can use the GParamSpec*
argument in the signal prototype to get that info... I *think* most
other detailed signals somehow or other include the detail as an
argument somewhere.

-- 
Peace,

    Jim Cape
    http://ignore-your.tv

    "We still name our military helicopter gunships after victims
     of genocide. Nobody bats an eyelash about that: Blackhawk.
     Apache. And Comanche. If the Luftwaffe named its military
     helicopters Jew and Gypsy, I suppose people would notice."
       -- Noam Chomsky, "Propaganda and the Public Mind"

Attachment: signature.asc
Description: This is a digitally signed message part



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