Find the answer to your Linux question:
Results 1 to 4 of 4
In gtk applications, any signal or event can have multiple handlers. gtk documentation suggests that you can implicitly switch off the later handlers by having an earlier handler return TRUE. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,225

    How does gtk run multiple signal handlers?


    In gtk applications, any signal or event can have multiple handlers. gtk documentation suggests that you can implicitly switch off the later handlers by having an earlier handler return TRUE. This may work with events, but I have not been able to get it to work with gtk signals.

    If it did work, it would be necessary for handlers to be processed serially, so that each could return before the next one ran.

    Now I have a button handler that, among other things, toggles the label on its button, and another handler for the same button that executes differently depending on the label it reads. And I find that the second handler reads the label as it is at the time the "clicked" signal is emitted (which is actually what I want), not the value that the first handler has set. So it does look as if the handlers are processed simultaneously by separate threads, and not in sequence. Which would make it impossible for the return value of one handler to influence another.

    Can anyone explain this?
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,639
    Sorry it has taken my 5 months to get a round tuit Hazel. Unfortunately, I'm not familiar with this and how GTK deal with multiple handlers. Have you been able to sort this out as yet? If so, please explain how, and then close the thread.

    -Rubberman
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,225
    Quote Originally Posted by Rubberman View Post
    Sorry it has taken my 5 months to get a round tuit Hazel. Unfortunately, I'm not familiar with this and how GTK deal with multiple handlers. Have you been able to sort this out as yet? If so, please explain how, and then close the thread.

    -Rubberman
    No, I never found an answer. It's the sort of question I suppose you should put to the gtk devs mailing list, but I don't see any point in joining that. I was just curious, that's all.
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,639
    Ok. If I find another round tuit, I'll try to find out.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •