Okay, basically I'm making a round timer for boxing and such. When I hit the "go" button, my main app launches a window which counts down a "get ready" period before the real round starts. When this countdown finishes, the window closes itself. I then want another window to pop up which has the round countdown.
The problem I'm having is that at the moment the two windows pop up at the same time. There must be a way to use an event triggered by the closing of the first window to make the second one come up, I'm just not sure what it is.
Hmm, okay, that is fairly specific to wx! Looking through the apidocs briefly, if you using wx.Window, __init__() shows the window by default, so perhaps you need to call window.Hide() immediately afterwards, or just delay constructing that window until you actually need it?
After looking at that API, I feel I should also direct you to PEP8, the Python Style Guide, since wx seems to have a very weird naming system that most python users would recommend against using in your own code: http://www.python.org/dev/peps/pep-0008/
I shall definitely have a look at the style guide at some point, I haven't worried about that sort of thing too much up to now because I'm still learning how to program.
I'm sure I am being stupid, but I can't figure out a way to delay the construction of the second window! Using sleep doesn't seem to work. Anyway, i shall have another think and if I am still stuck I might have to paste some code at you.
If you need any help with the Python, feel free to prod me :)
Reply
I appreciate your offer! Do you have much experience with wxpython? I have a bit of a dilemma in a program I'm working on at the moment.
Reply
Reply
The problem I'm having is that at the moment the two windows pop up at the same time. There must be a way to use an event triggered by the closing of the first window to make the second one come up, I'm just not sure what it is.
Reply
After looking at that API, I feel I should also direct you to PEP8, the Python Style Guide, since wx seems to have a very weird naming system that most python users would recommend against using in your own code: http://www.python.org/dev/peps/pep-0008/
Reply
I'm sure I am being stupid, but I can't figure out a way to delay the construction of the second window! Using sleep doesn't seem to work. Anyway, i shall have another think and if I am still stuck I might have to paste some code at you.
Reply
Reply
Reply
Leave a comment