WxtextCtrl focux in LInux

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Mounika
Earned a small fee
Earned a small fee
Posts: 10
Joined: Thu May 10, 2018 12:47 pm

WxtextCtrl focux in LInux

Post by Mounika »

Hi,
SetFocus of wxtextctrl is not working when wxMIniframe is shown in linux.
Please Find attachement
Attachments
Screenshot from 2018-05-11 01-16-58.png
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: WxtextCtrl focux in LInux

Post by ONEEYEMAN »

Hi,
Can you show some code?
- Do you use any EVT_SET_FOCUS event?

Also the usual stanza:

- wx version?
- Os version?
- exact GTK+ version used?
- how wx was compiled? any non-default options used?

Thank you.
Mounika
Earned a small fee
Earned a small fee
Posts: 10
Joined: Thu May 10, 2018 12:47 pm

Re: WxtextCtrl focux in LInux

Post by Mounika »

Hi , I tried with SetFocus() predefiend function and EVT_ACTIVATE.
Its a GTK+ Version.
Mounika
Earned a small fee
Earned a small fee
Posts: 10
Joined: Thu May 10, 2018 12:47 pm

Re: WxtextCtrl focux in LInux

Post by Mounika »

Hi ,
I tried with setFocus() function of wxTextctrl and EVT_ACTIVATE event.
its a GTK+ version.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: WxtextCtrl focux in LInux

Post by ONEEYEMAN »

Hi
What's wx version do you use?
What's an exact gtk+ version?

Can you post a code?

Thank you.
Mounika
Earned a small fee
Earned a small fee
Posts: 10
Joined: Thu May 10, 2018 12:47 pm

Re: WxtextCtrl focux in LInux

Post by Mounika »

Hi,
Wx Version we are usinmg 3.0.2
GTK+ Version 2.0


Code::
//After Showing Miniframe frame without Destroying miniframe , i need to give focus to text ctrl

wxMiniframe::Show(true);
wxTextCtrl* txt = (wxTextCtrl*)FindWindowById(ID_SEARCH_TXTCTRL, m_pwxTextCtrlPanel);
txt->SetFocus();
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: WxtextCtrl focux in LInux

Post by ONEEYEMAN »

Hi,
Is text control inside the miniframe or in the main frame?
Is FindWindowById() function succeeds?
Where is the focus after the call to SetFocus()?

Thank you.
Mounika
Earned a small fee
Earned a small fee
Posts: 10
Joined: Thu May 10, 2018 12:47 pm

Re: WxtextCtrl focux in LInux

Post by Mounika »

Hi ,
Mounika
Earned a small fee
Earned a small fee
Posts: 10
Joined: Thu May 10, 2018 12:47 pm

Re: WxtextCtrl focux in LInux

Post by Mounika »

Hi ,
Text control is in mainfrom,
FindWindowbyid given text control, after that setfocus for that text control is not Working......
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: WxtextCtrl focux in LInux

Post by ONEEYEMAN »

Hi,
Which class has the code you showed in the OP?
Can you post complete function (including signature)?

Also please use <code></code> tags to simplify the code reading...

Thank you.
Mounika
Earned a small fee
Earned a small fee
Posts: 10
Joined: Thu May 10, 2018 12:47 pm

Re: WxtextCtrl focux in LInux

Post by Mounika »

Hi,

this is the code i am using,

pwxTextCtrlPanel -- wxPanel where txtx control is placeds

wxMiniframe::Show(true);
wxTextCtrl* txt = (wxTextCtrl*)FindWindowById(ID_SEARCH_TXTCTRL, m_pwxTextCtrlPanel);
txt->SetFocus();
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: WxtextCtrl focux in LInux

Post by DavidHart »

Hi,

You may feel that your request for help is not succeeding. That is because you are not giving us enough information to help you.
SetFocus of wxtextctrl is not working when wxMIniframe is shown in linux.
You say "in Linux". Does the same code work on other platforms?
this is the code i am using,
No it isn't. It is just 3 lines of the code that you are using.

I don't mean that you should paste your whole program, but we need more than just those lines. The best way to help us to help you is to make a small compilable program that we can build and test. And the best way to do that is to add your code to the code of the the 'minimal' sample that comes with the wxWidgets source (and then ideally paste here a diff to 'minimal').

If you do that, not only can we see what is going wrong, but also you may find that your code does work inside 'minimal', which will help you to identify the problem.

Regards,

David
Mounika
Earned a small fee
Earned a small fee
Posts: 10
Joined: Thu May 10, 2018 12:47 pm

Re: WxtextCtrl focux in LInux

Post by Mounika »

Hi ,
Please Find Find the attachement, and paste in widgets project in Samples.


Go to button project and click the buton change ....
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: WxtextCtrl focux in LInux

Post by DavidHart »

I don't think the new attachment uploaded. Certainly I can't see it here.

But you don't need an attachment. You should reduce your code to the smallest amount that shows the problem, diff it with 'minimal', then paste the diff here, using 'Code' tags (the button that says 'Code' above your post).
Mounika
Earned a small fee
Earned a small fee
Posts: 10
Joined: Thu May 10, 2018 12:47 pm

Re: WxtextCtrl focux in LInux

Post by Mounika »

DavidHart wrote:I don't think the new attachment uploaded. Certainly I can't see it here.

But you don't need an attachment. You should reduce your code to the smallest amount that shows the problem, diff it with 'minimal', then paste the diff here, using 'Code' tags (the button that says 'Code' above your post).

Please find the minimal attachement
Attachments
minimal - SetFocus.cpp
(7.72 KiB) Downloaded 67 times
Post Reply