Hi,
This is removed, how to make e.g. a Frame Modal?
Werner
Hi,
This is removed, how to make e.g. a Frame Modal?
Werner
Werner wrote:
Hi,
This is removed, how to make e.g. a Frame Modal?
The wx changes.txt file says:
- wxWindow::MakeModal() is deprecated, use wxDialog::ShowModal()
instead if possible or wxWindowDisabler otherwise.
The method still exists in the code, as long as 2.8 compatibility mode is turned on, so I could probably still add a deprecated wrapper for it if there is demand. The reason it is missing now is that it has been removed from the wx documentation so the Phoenix tools are not seeing it.
--
Robin Dunn
Software Craftsman
I like to have a statusbar in this one, one of the reason to use a Frame but when it is open by user I want to prevent that they open another one.
I guess wxWindowDisabler would do for that but I can't figure out how to use it.
I had this and the "calling dialog" was disabled while the frame was open:
viewer = self.getViewer()
viewer.view.MakeModal()
viewer.view.Show()
Tried this, but the "calling dialog" is still enabled:
with wx.WindowDisabler():
viewer = self.getViewer()
viewer.view.Show()
Werner
On 24/04/2013 03:55, Robin Dunn wrote:
Werner wrote:
Hi,
This is removed, how to make e.g. a Frame Modal?
The wx changes.txt file says:
- wxWindow::MakeModal() is deprecated, use wxDialog::ShowModal()
instead if possible or wxWindowDisabler otherwise.The method still exists in the code, as long as 2.8 compatibility mode is turned on, so I could probably still add a deprecated wrapper for it if there is demand. The reason it is missing now is that it has been removed from the wx documentation so the Phoenix tools are not seeing it.
werner wrote:
Werner wrote:
Hi,
This is removed, how to make e.g. a Frame Modal?
The wx changes.txt file says:
- wxWindow::MakeModal() is deprecated, use wxDialog::ShowModal()
instead if possible or wxWindowDisabler otherwise.The method still exists in the code, as long as 2.8 compatibility mode
is turned on, so I could probably still add a deprecated wrapper for
it if there is demand. The reason it is missing now is that it has
been removed from the wx documentation so the Phoenix tools are not
seeing it.I like to have a statusbar in this one, one of the reason to use a Frame
but when it is open by user I want to prevent that they open another one.I guess wxWindowDisabler would do for that but I can't figure out how to
use it.I had this and the "calling dialog" was disabled while the frame was open:
viewer = self.getViewer()
viewer.view.MakeModal()
viewer.view.Show()Tried this, but the "calling dialog" is still enabled:
with wx.WindowDisabler():
viewer = self.getViewer()
viewer.view.Show()
The instance of the disabler needs to exist for as long as the window should be modal-like. So something like this would work:
def MakeModal(self, modal=True):
if modal and not hasattr(self, '_disabler'):
self._disabler = wx.WindowDisabler(self)
if not modal and hasattr(self, '_disabler'):
del self._disabler
On 24/04/2013 03:55, Robin Dunn wrote:
--
Robin Dunn
Software Craftsman
Hi Robin,
...
The instance of the disabler needs to exist for as long as the window should be modal-like. So something like this would work:
def MakeModal(self, modal=True):
if modal and not hasattr(self, '_disabler'):
self._disabler = wx.WindowDisabler(self)
if not modal and hasattr(self, '_disabler'):
del self._disabler
Thanks that works great.
Werner
On 26/04/2013 02:18, Robin Dunn wrote: