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

Postby Mounika » Thu May 10, 2018 2:18 pm

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: 2674
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: WxtextCtrl focux in LInux

Postby ONEEYEMAN » Thu May 10, 2018 5:48 pm

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

Postby Mounika » Fri May 11, 2018 12:33 am

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

Postby Mounika » Fri May 11, 2018 12:36 am

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: 2674
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: WxtextCtrl focux in LInux

Postby ONEEYEMAN » Fri May 11, 2018 12:47 am

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

Postby Mounika » Fri May 11, 2018 7:15 am

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: 2674
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: WxtextCtrl focux in LInux

Postby ONEEYEMAN » Fri May 11, 2018 2:50 pm

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

Postby Mounika » Mon May 14, 2018 5:06 am

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

Postby Mounika » Mon May 14, 2018 5:09 am

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: 2674
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: WxtextCtrl focux in LInux

Postby ONEEYEMAN » Mon May 14, 2018 12:03 pm

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

Postby Mounika » Tue May 15, 2018 4:20 am

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: 3765
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: WxtextCtrl focux in LInux

Postby DavidHart » Tue May 15, 2018 9:13 am

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

Postby Mounika » Tue May 15, 2018 1:45 pm

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: 3765
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: WxtextCtrl focux in LInux

Postby DavidHart » Tue May 15, 2018 2:13 pm

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

Postby Mounika » Mon Jul 02, 2018 7:06 am

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 9 times


Return to “Platform Related Issues”

Who is online

Users browsing this forum: No registered users and 3 guests