logo       

Re: Signals firing too often: msg#00144

Subject: Re: Signals firing too often

On Thursday, May 20, 2004, at 08:58 PM, Daniel Kasak wrote:

I've got a Gtk2::SimpleList that triggers some code when a row is selected. The signal I'm currently using is 'button_release_event'. I've tried a fair few others.

have you tried the "changed" signal of the treeview's selection?

  $simplelist->get_selection->signal_connect (changed => \&func);

http://developer.gnome.org/doc/API/2.0/gtk/ GtkTreeSelection.html#GtkTreeSelection-changed


The update process refreshes the data in the Gtk2::SimpleList, which seems to trigger more events, and it doesn't matter which signal I use, they all seem to get triggered multiple times. Without any further modification, I get 3 events.

erm, sorry, but this is a little too vague to make sense of. are you changing which row is selected? (that includes clearing the list and refilling it.) are you changing the data of the selected row? is it the same signal that fires three times or different ones? do they fire recursively?


Is there a signal I can use to catch when someone selects a row in a SimpleList that:
a) Won't get triggered if the SimpleList data is rebuild
b) Won't trigger multiple times?

trap the selection's "changed" signal, and get the index of the selected row.
refill the simplelist.
programmatically select the row at the index you found a moment ago. you may have to set up a guard that lets you know not to run your handler again (e.g., signal_handlers_block or a boolean flag of your own).


--
Brian: If i recall correctly, this is the physics department.
Chris: That explains all that gravity.
        -- Family Guy, "The Story on Page One"


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe