Harry Van Haaren wrote:
> Hey Guys,
>
> Sorry for the lenght of the subject, couldnt really capture it in less
> words.
>
> Busy working on a Gtk project, need some "popup" windows, having some
> problems. Here's the setup:
>
> The User interface is produced by Glade, and im loading it using the
> standard gtk.glade.XML("ui.glade")
>
> This is the problem:
>
> -Main Window (toplevel) has a button to open an About dialog.
> -About dialog shows up fine, and I can close it by clicking "x" in the
> Windowframe. (Close button doesnt work.. cant get the Close button to work.)
You probably want to call self.GtkWindow.destroy() on the button click.
> -When the about dialog is gone, the program runs fine again.
> -upon clicking the About button again, it gives me the following:
>
> AttributeError: 'NoneType' object has no attibute 'show_all'
Seems like you lost the reference to the window.
I'm guessing the window was destroyed when you clicked the "X".
> The problem I cant grasp here is, its already ran this code the first
> time that I opened the About Dialog.
> And i "Close" the window using aboutWindow.hide_all(), which would lead
> me to assume I could show it again using show_all()?
no reason to maintain an about dialog I think.
Might as well destroy it.
> So something changes between the window showing the first time, and
> before calling it for the 2nd time.
>
> Or if somebody could point me to a Tutorial on HOW to stucture your
> gtk.main() and toplevel windows etc.. that might let me teach myself?
You could have a look at the "dlgUserInteraction" class in fslint-gui in:
http://www.pixelbeat.org/fslint/fslint-2.28.tar.gz
cheers,
Pádraig.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Python Ireland" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.ie/group/pythonireland?hl=en
-~----------~----~----~----~------~----~------~--~---