On Wed, 23 Apr 2008 14:10:10 -0300
"Facundo Batista" <[EMAIL PROTECTED]> wrote:

> If you could provide an example that makes this to you, for us to try
> it, we could help you better.

Here you go:
#!/usr/bin/python
import gtk
import pygtk

def toggle_func (widget, *user_data):
    frame = user_data[0]
    if frame.visible:
        frame.hide ()
    else:
        frame.show ()
    
window = gtk.Window ()
vbox = gtk.VBox ()
button = gtk.Button ("Toggle")

frame = gtk.Frame ("Test Frame")
label = gtk.Label ("Some Text")

frame.add (label)
vbox.pack_start (frame)
vbox.pack_start (button)

window.add (vbox)
button.connect ("clicked", toggle_func, frame)
window.connect ("delete-event", gtk.main_quit)
window.show_all ()
gtk.main ()

# ./test.py
Traceback (most recent call last):
  File "./test.py", line 8, in toggle_func
    if frame.visible:
AttributeError: 'gtk.Frame' object has no attribute 'visible'

-- 
Mitko Haralanov
==========================================
I WILL NOT USE ABBREV.
I WILL NOT USE ABBREV.
I WILL NOT USE ABBREV.
I WILL NOT USE ABBREV.

        Bart Simpson on chalkboard in episode 2F33
_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to