开发者

Opening and closing windows by calling a function?

The idea is that I would have two or three different windows and I would like to open and close them automatically by calling a function (separate functions to open and close each window). The program itself would be running in the background but when a certain event happens it w开发者_StackOverflowould call the window opening function. On another event the window would close, or window #2 would open etc.

That's the general idea anyway. Right now I would settle for one window I could open by calling a function. So in a nutshell a function that opens a window but lets the program run in the background waiting for a command to destroy the window.

Is it even possible to do that?

I've searched for tkinter solutions, none have worked so far. The reason for tkinter is because wxpython won't close a window unless you move the mouse over it.

Additionally, in the end I would be making borderless windows that are always on top of everything else. I have a somewhat suitable code for that already but it's nothing definitive.

PS. Yes I know it's a poorly composed question. That's why I'm asking...


In wxWindows you just call the .destroy() method on the dialog/window to delete it. You don't have to move the mouse over it. That would make wxWindows apps very annoying.

I suspect your problem is more related to trying to do something outside the wx event framework. Most GUIs are event driven, so if you've got other things going on you either run them in another thread and have them signal the GUI framework to do stuff or run your code in an event handler callback that lets the event handler manage the .destroy() method you called in your code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜