MakeModal and wxTE_PROCESS_TAB

Hi there,

I have two questions:

1. How do I use the MakeModal() method? According to docs the method is
not implemented yet, it works for me though (wx 2.3.3, win32,
python2.2). The problem is, after I open a wxFrame from the "parent"
window and call frame.MakeModal(true) I can't close this frame properly,
'cos the parent window "thinks" the frame is still opened and stays in
background ("disabled"). I tried to solve the problem calling
self.MakeModal(false) and self.Close() in the frame's EVT_CLOSE() [a],
but that lead to a runtime error ("max. recursion depth exceeded").
What am I doing wrong here?

2. Although I set the style of a "single-lined" wxTextCtrl to
wxTE_PROCESS_TAB I cannot switch between the input fields using the tab
key. Any hints?

TIA,
Igor

[a]
self.MakeModal(false)
self.Close()

1. How do I use the MakeModal() method? According to docs the
method is not implemented yet, it works for me though
(wx 2.3.3, win32, python2.2). The problem is, after I open a
wxFrame from the "parent" window and call frame.MakeModal(true)
I can't close this frame properly, 'cos the parent window
"thinks" the frame is still opened and stays in background
("disabled"). I tried to solve the problem calling
self.MakeModal(false) and self.Close() in the frame's EVT_CLOSE()

self.MakeModal(false)
self.Close()

but that lead to a runtime error ("max. recursion depth
exceeded"). What am I doing wrong here?

Try this:
    self.Show(0)
    self.Destroy()

2. Although I set the style of a "single-lined" wxTextCtrl to
wxTE_PROCESS_TAB I cannot switch between the input fields using
the tab key. Any hints?

The wxTE_PROCESS_TAB style lets the control receive EVT_CHAR
messages for TAB pressed. The **default** is what you want, i.e.
normally, TAB is used for passing to the next control in a dialog
instead. But this will not work if the wxTextCtrl is naked in a
wxFrame. It must be the child of a wxPanel or a wxDialog.

···

--- Igor Stroh <stroh@scan-plus.de> wrote:

=====
Donnal Walter
Arkansas Children's Hospital

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.

> 1. How do I use the MakeModal() method? According to docs the
> method is not implemented yet, it works for me though
> (wx 2.3.3, win32, python2.2). The problem is, after I open a
> wxFrame from the "parent" window and call frame.MakeModal(true)
> I can't close this frame properly, 'cos the parent window
> "thinks" the frame is still opened and stays in background
> ("disabled"). I tried to solve the problem calling
> self.MakeModal(false) and self.Close() in the frame's EVT_CLOSE()
>
> self.MakeModal(false)
> self.Close()
>
> but that lead to a runtime error ("max. recursion depth
> exceeded"). What am I doing wrong here?

Try this:
    self.Show(0)
    self.Destroy()

def OnClose(self, event):
    self.MakeModal(false)
    event.Skip()

works fine :slight_smile:

> 2. Although I set the style of a "single-lined" wxTextCtrl to
> wxTE_PROCESS_TAB I cannot switch between the input fields using
> the tab key. Any hints?

The wxTE_PROCESS_TAB style lets the control receive EVT_CHAR
messages for TAB pressed. The **default** is what you want, i.e.
normally, TAB is used for passing to the next control in a dialog
instead. But this will not work if the wxTextCtrl is naked in a
wxFrame. It must be the child of a wxPanel or a wxDialog.

Ah, that's why, I need a panel "behind" the frame then... Thanks.

Greetings,
Igor

···

On Wed, 2002-12-04 at 11:41, Donnal Walter wrote:

--- Igor Stroh <stroh@scan-plus.de> wrote: