[pygtk] Dialog problem
Thu, 13 Jul 2000 21:03:15 +0200
Hi, I have a problem with a dialog. It's similar to an other posting.
I'm interested either in getting a solution for the code below or an
other solution that accomplish the same.
The problem with the code below is that the dialog doesn't go away. If
it has been shown once and closed it pops up as soon as I try to push
one of the button even the button that does nothing!
If the two filenames are the same I want to stop the execution of the
following code until the user either accepts to overwrite or don't want
to overwrite the file.
from gtk import *
from gnome.ui import *
from GDK import *
def start(self, *args):
#emulate input of two files with the same name
filename1 = 'logo.jpg'
filename2 = 'logo.jpg'
overwrite = 0
if filename1 == filename2:
overwrite = GnomeMessageBox("Overwrite?", "question",
if overwrite == 0:
#this code have to wait to be run if the filenames are the same
#or run at once if they aren't the same
print 'doing file conversion'
#this code or perhaps no code should be run if the user don't want
# to overwrite the file.
print 'doing nothing'
main_window = GnomeApp()
hbox = GtkHBox()
button = GtkButton('Start')
button2 = GtkButton('nothing')
app = App()