On Wed, May 29, 2002 at 07:28:31PM -0400, John J Breen wrote:

> Hey,
>       New to pygtk and have some questions. In the follwoing code my
> button connections (cancel button) do not work. It will say 2nd argument
> must be callable.

[SNIP]
>     button = gtk.Button(stock='gtk-cancel')
>     button.connect("button_release_event", quit_main())
>     button.show()

  Remove the () after quit_main: quit_main alone is the function,
while when you write quit_main(), python calls the function and its
return value is the argument you pass to connect.

> Also the dialog made in the second function automatically opens (its
> part of a larger program). I only want the user to see it when they
> press a key combo or hit a menu item. How do I make it only show up
> then?

  I think you should call quit_dialog only when you have to, not
before you need it. You could also make an object inheriting
gtk.Dialog and have its show() and hide() methods available.

-- 
Prof
_______________________________________________
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