Hi All,
in my application a have a dialog with a multiline wxTextCtrl. When i open the dialog using ShowModal(), i cannot focus the text control with the mouse. Setting the focus via 'tabbing' and programmatical via 'SetFocus()' works. Any solution to this?
Best regards,
Heiner
wx 3.1 Cocoa: wxTextCtrl focus
-
- Experienced Solver
- Posts: 99
- Joined: Sat Oct 26, 2013 11:54 am
Re: wx 3.1 Cocoa: wxTextCtrl focus
This happened to me once on MSW. I found out that I created that control with a wrong parent. Not saying it's necessarily your case...
-
- Experienced Solver
- Posts: 99
- Joined: Sat Oct 26, 2013 11:54 am
Re: wx 3.1 Cocoa: wxTextCtrl focus
The control is created like this, generated by wxglade:
should i (re-) set a parent later?
Code: Select all
text_ctrl = new wxTextCtrl(panelXY, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxTE_MULTILINE|wxTE_PROCESS_ENTER|wxTE_PROCESS_TAB);
Re: wx 3.1 Cocoa: wxTextCtrl focus
I think you're good, assuming panelXY is a child of the dialog and it is added to the appropriate sizer. Nevertheless, there must be something wrong with your dialog design/layout/whatever. Difficult to tell without seeing the actual code. BTW, can you try the code on MSW or Linux?heinermueller wrote:The control is created like this, generated by wxglade:
should i (re-) set a parent later?Code: Select all
text_ctrl = new wxTextCtrl(panelXY, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxTE_MULTILINE|wxTE_PROCESS_ENTER|wxTE_PROCESS_TAB);
-
- Experienced Solver
- Posts: 99
- Joined: Sat Oct 26, 2013 11:54 am
Re: wx 3.1 Cocoa: wxTextCtrl focus
On MSW it works fine.
Control creation, sizer assignment and dialog layout is made by wxglade. There are no actions (Enable/Focus etc) with that control. If the control is visible - what could go wrong in that case? Wrong order of creation? Missing/Duplicate ID or similar?Nevertheless, there must be something wrong with your dialog design/layout/whatever.
Re: wx 3.1 Cocoa: wxTextCtrl focus
Is this your first OSX application with wxWidgets? Could it be that it's this problem?
http://www.wxwidgets.org/docs/faq/osx/#nofocus
http://www.wxwidgets.org/docs/faq/osx/#nofocus
Use the source, Luke!
-
- Experienced Solver
- Posts: 99
- Joined: Sat Oct 26, 2013 11:54 am
Re: wx 3.1 Cocoa: wxTextCtrl focus
No, i found this FAQ on the web, too, but this is not the case. The application is an app bundle, it is running fine. I noticed, the wxTextCtrl has the same focus problem in another application dialog. There i can troubleshoot this with a programmatical 'SetFocus', but in this case here i would like to avoid that because it would confuse users.
-
- Experienced Solver
- Posts: 99
- Joined: Sat Oct 26, 2013 11:54 am
Re: wx 3.1 Cocoa: wxTextCtrl focus
I am using a wxRichTextCtrl and it works perfectly now. Should i file a bug report?