GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sun Aug 31, 2014 2:15 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Impossible to destroy a dialog
PostPosted: Tue Apr 24, 2012 7:42 am 
Offline
Familiar Face

Joined: Tue Mar 27, 2012 7:51 pm
Posts: 6
I created a dialog to report to user an error.
So I coded:

Code:
self.user_video_button = gtk.Button("Ok")
   self.label = gtk.Label("Chose Video/Log")
   self.label.show()
   self.dialog = gtk.Dialog(title="Dialog")
   self.dialog.vbox.pack_start(self.label)
   self.dialog.action_area.pack_start(self.user_video_button, True, True, 0)
   self.user_video_button.show()
        self.user_video_button.connect("clicked",self.dialog.destroy)


and later, in a function,
Code:
self.dialog.show()


but I got:


Top
 Profile  
 
 Post subject: Re: Impossible to destroy a dialog
PostPosted: Tue Apr 24, 2012 2:03 pm 
Offline
GTK+ Geek

Joined: Sat Sep 03, 2011 6:36 pm
Posts: 94
Can you please write what you see again?There doesn't seem to be anything at your post.

I have no clue with pygtk, but in c you create the dialog with gtk_widget_show and then call gtk_widget_destroy.


Top
 Profile  
 
 Post subject: Re: Impossible to destroy a dialog
PostPosted: Wed Apr 25, 2012 11:59 am 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
Given the missing information I'll try a few speculations:
GtkDialogs need to be modal or nonmodal. As you are making your dialog nonmodal you need to pass control back to the main loop. Don't see from what you've got written where a problem might be. Guess the error message you were going to include might have helped. For error reporting it's probably best to use a modal dialog. Using a nonmodal dialog means a user may not notice it and its window gets buried under other stuff and they wonder why things aren't running properly. A modal dialog pops and and says "you really shouldn't continue until you address what I've got to say"


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group