On Tue, Sep 09, 2003 at 10:32:34AM -0700, Colin Fox wrote:
> I'm using the same technique. However, I did one thing a little
> differently. I have a function called 'Run' - I want the user to be able
> to start and stop the running of something.
> 
> I created a run toggle, and a run menu item. The key is they BOTH call
> the same signal handler: on_run_button_toggled()
> 
>     def on_run_button_toggled(self, widget, event=None):
>         x = widget.get_property('active')
>         self.world.set_running( x )
>         self.widget['togglebutton'].set_active(x)
>         self.widget['run1'].set_active(x)

How do you avoid having set_active() emitting the toggle signal every
time it's triggered? I'm trying to figure out how that would not loop
recursively. Let's see:

    A -> C
    B -> C
    C -> A, B -> C (loop)

Then again, it may just loop once and then stop if 

    set_active(1)
    set_active(1)
    set_active(1)

only emits a signal on the first time. Ah, that must be it. :-)

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to