Re: [pygtk] how to set the active radiobutton without emitting a toggle or clicked signal?

2011-04-23 Thread Giuseppe Penone
I have a variable in my program named user_active which is by default True

when I want to toggle avoiding the signal I do:

user_active = False
operation that causes the signal
user_active = True

then in the callback

on_button_toggled()
   if not user_active: return
   

Cheers,
Giuseppe.


On Sat, Apr 23, 2011 at 7:50 AM, Ryan Krauss ryanli...@gmail.com wrote:

 I am setting the active radio button in a group using the set_active
 method.  I want to do this without causing the toggled or clicked
 signals being emitted, or I at least want to somehow know the
 difference in the program between the programming setting the active
 radio and the user actually clicking the radio with the mouse (or by
 using a keyboard accelerator that is mapped to click).  Basically, I
 have some code I want to run only when the user really clicked or used
 a keyboard accel.  I don't want the code to run when the program set
 the radio.  How can this be accomplished?

 Thanks,

 Ryan
 ___
 pygtk mailing list   pygtk@daa.com.au
 http://www.daa.com.au/mailman/listinfo/pygtk
 Read the PyGTK FAQ: http://faq.pygtk.org/

___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] how to set the active radiobutton without emitting a toggle or clicked signal?

2011-04-23 Thread Ryan Krauss
That is a simple solution that solved my problem.  Thanks Giuseppe.

Ryan

On Sat, Apr 23, 2011 at 6:17 AM, Giuseppe Penone gius...@gmail.com wrote:
 I have a variable in my program named user_active which is by default True
 when I want to toggle avoiding the signal I do:
 user_active = False
 operation that causes the signal
 user_active = True
 then in the callback
 on_button_toggled()
    if not user_active: return
    
 Cheers,
 Giuseppe.

 On Sat, Apr 23, 2011 at 7:50 AM, Ryan Krauss ryanli...@gmail.com wrote:

 I am setting the active radio button in a group using the set_active
 method.  I want to do this without causing the toggled or clicked
 signals being emitted, or I at least want to somehow know the
 difference in the program between the programming setting the active
 radio and the user actually clicking the radio with the mouse (or by
 using a keyboard accelerator that is mapped to click).  Basically, I
 have some code I want to run only when the user really clicked or used
 a keyboard accel.  I don't want the code to run when the program set
 the radio.  How can this be accomplished?

 Thanks,

 Ryan
 ___
 pygtk mailing list   pygtk@daa.com.au
 http://www.daa.com.au/mailman/listinfo/pygtk
 Read the PyGTK FAQ: http://faq.pygtk.org/


___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/