[pygtk] Close button on gtk.AboutDialog

Walter Leibbrandt walter at translate.org.za
Tue Jun 24 22:27:30 WST 2008


Hi,

Try this:
<code>
self.aboutdialog =3D gtk.AboutDialog()
self.aboutdialog.set_version('0.0.1')
response =3D self.aboutdialog.run()
self.aboutdialog.hide()
</code>

Seeing as gtk.AboutDialog inherits from gtk.Dialog, the "right way" to =

use it would be to call the run() method - which automatically calls =

show() - and then call its hide() method, because the program will block =

until the dialog's run() returns.

"response" will differ depending on how the dialog was closed: -6 for =

the "Close" button and -4 for the closing it with the X (for example in =

Gnome). A quick lookup ("[(a, int(getattr(gtk, a))) for a in dir(gtk) if =

a.startswith('RESPONSE_')]") reveals that those responses are =

gtk.RESPONSE_CANCEL (-6) and gtk.RESPONSE_DELETE_EVENT.

Ronaldo Nascimento wrote:
> Code
>
>             self.aboutdialog =3D gtk.AboutDialog()
>             self.aboutdialog.set_version('0.0.1')
>             self.aboutdialog.show()
>
>
> How do i get the "close" button to hide the dialog?
> thanks
>
> -- =

> Ronaldo Nascimento
> ronaldo at ronaldo1.us <mailto:ronaldo at ronaldo1.us>
> ------------------------------------------------------------------------
>
> _______________________________________________
> pygtk mailing list   pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
>   =

-------------- next part --------------
A non-text attachment was scrubbed...
Name: walter.vcf
Type: text/x-vcard
Size: 263 bytes
Desc: not available
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20080624/5119f0db/w=
alter.vcf


More information about the pygtk mailing list