Noob @ programming with python and pygtk.
I’m creating an application which includes a couple of dialogs for user interaction.
#!usr/bin/env python
import gtk
info = gtk.MessageDialog(type=gtk.DIALOG_INFO, buttons=gtk.BUTTONS_OK)
info.set_property('title', 'Test info message')
info.set_property('text', 'Message to be displayed in the messagebox goes here')
if info.run() == gtk.RESPONSE_OK:
info.destroy()
This displays my message dialog, however, when you click on the ‘OK’ button presented in the dialog, nothing happens, the box just freezes.
What am I doing wrong here?
can you give me a last chance? 😉
there are some errors in your code:
you did not close a bracket
your syntax in
.set_propertyis wrong: use:.set_property('property', 'value')but i think they are copy/paste errors.
try this code, it works for me. maybe did you forget the
gtk.main()?