Search found 347 matches
- Fri Jul 30, 2010 7:39 pm
- Forum: C++ Development
- Topic: How to properly hide then unhide the main toplevel window?
- Replies: 37
- Views: 12723
Well, I started the process of thinking about all of this and examined all of this. I decided I might be looking in the obvious place when it might actually be in the non obvious dialog. Well, I reused my standard dialogs which demands ->ShowModal instead of the .ShowModal of my private class versio...
- Fri Jul 30, 2010 6:50 pm
- Forum: C++ Development
- Topic: How to properly hide then unhide the main toplevel window?
- Replies: 37
- Views: 12723
- Fri Jul 30, 2010 6:07 pm
- Forum: C++ Development
- Topic: How to properly hide then unhide the main toplevel window?
- Replies: 37
- Views: 12723
- Fri Jul 30, 2010 5:41 pm
- Forum: C++ Development
- Topic: How to properly hide then unhide the main toplevel window?
- Replies: 37
- Views: 12723
I found where it is deleting and it is this line: this->Show(false); Ok good. Seems like my initial theory that the frame is self-destructing when hidden is confirmed. Making a dialog that has a deleted frame as parent is explosive, trying to re-show the deleted frame too. However I have no idea ho...
- Fri Jul 30, 2010 4:32 pm
- Forum: C++ Development
- Topic: How to properly hide then unhide the main toplevel window?
- Replies: 37
- Views: 12723
This error tells you that a delete was called on an invalid pointer. Now you have to find out what that invalid pointer was and why it happened. Open the Callstack window and click on the first code line that's in your code. In the variables window you can see the value of all variables at that poi...
- Fri Jul 30, 2010 5:39 am
- Forum: C++ Development
- Topic: How to properly hide then unhide the main toplevel window?
- Replies: 37
- Views: 12723
Just thought I would add that the issue I was having with the debugger really was due to wxDevcpp. So, I went into MSVC where I have not used its debugger since VS6/2003 and man is it ever nice. I now know it crashes on the show line 100% (already knew but the debugger showed me) but can you tell me...
- Fri Jul 30, 2010 2:20 am
- Forum: C++ Development
- Topic: How to properly hide then unhide the main toplevel window?
- Replies: 37
- Views: 12723
Yes, you should really learn how to use a debugger ;) Apart from that, another wild guess: Maybe the dialog doesn't like to have a hidden parent. Try NULL as parent for the dialog. And btw, from a gui point of view it's very unusual to hide the main window when you open a modal dialog. I agree on a...
- Fri Jul 30, 2010 2:20 am
- Forum: C++ Development
- Topic: How to properly hide then unhide the main toplevel window?
- Replies: 37
- Views: 12723
Yes, you should really learn how to use a debugger ;) Apart from that, another wild guess: Maybe the dialog doesn't like to have a hidden parent. Try NULL as parent for the dialog. And btw, from a gui point of view it's very unusual to hide the main window when you open a modal dialog. I agree on a...
- Fri Jul 30, 2010 2:08 am
- Forum: C++ Development
- Topic: How to properly hide then unhide the main toplevel window?
- Replies: 37
- Views: 12723
- Fri Jul 30, 2010 1:26 am
- Forum: C++ Development
- Topic: How to properly hide then unhide the main toplevel window?
- Replies: 37
- Views: 12723
- Fri Jul 30, 2010 1:08 am
- Forum: C++ Development
- Topic: How to properly hide then unhide the main toplevel window?
- Replies: 37
- Views: 12723
Can you provide a minimal compilable sample showing the problem? Meanwhile, here's my idea : when a wxWidgets frame is closed, the default behavior is to self-destruct. Self-destruction is however not done right now but queued to be done later when the event queue is empty to avoid crashes when eve...
- Thu Jul 29, 2010 9:41 pm
- Forum: C++ Development
- Topic: How to properly hide then unhide the main toplevel window?
- Replies: 37
- Views: 12723
How to properly hide then unhide the main toplevel window?
this->Show(false); TempDlg.ShowModal(); this->Show(true); When I remove the modal (dialog) the above code works and my main frame is hidden then reshown but if I allow the modal to open and it returns my program crashes. Everything works fine if I remove the show commands so I am wondering what is ...
- Thu Jul 29, 2010 4:54 pm
- Forum: C++ Development
- Topic: button event queue question and help needed.
- Replies: 9
- Views: 2250
The above that I described worked perfectly. What I did was set the bitmap label to the same as SetBitmapSelected then set my flag and off I went. Now you may click the button as many times as you wish and it looks like nothing is happening but in reality it is triggering the event just not acting o...
- Thu Jul 29, 2010 4:29 pm
- Forum: C++ Development
- Topic: button event queue question and help needed.
- Replies: 9
- Views: 2250
Agreed with doublemax, blocking the GUI is the wrong approach (because the OS may queue event, as I explained earlier); I would instead recommend running the long calculation in a thread. Then clicking on the button disables it, starts the thread; when the thread is done, it sends and event to the ...
- Thu Jul 29, 2010 4:19 pm
- Forum: C++ Development
- Topic: button event queue question and help needed.
- Replies: 9
- Views: 2250
The behavior is not really surprising, because the events that occur during your longer calculation are only dispatched after you have connected the event handlers already. So you need a flag to prevent reentrancy and a wxYield() before enabling the button again, so that the pending events are clea...