Enable button when wx.TextCtrl is clicked in

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Enable button when wx.TextCtrl is clicked in

Ibraheem Khan
I have a dialog box (with multiple editable text fields and buttons) and want to activate one of buttons when any one of text field boxes is clicked in. Like following is with default value of 0.56and once user click in that box, a separate button should be enabled. Any suggestions? Thanks

wx.StaticText(panel, -1, "Reach Slope", (40, 170))
self.reachslope = wx.TextCtrl(panel, -1, value=str(0.56), pos=(150, 165), size=(75,25))

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Enable button when wx.TextCtrl is clicked in

Tim Roberts
Ibraheem Khan wrote:
I have a dialog box (with multiple editable text fields and buttons) and want to activate one of buttons when any one of text field boxes is clicked in. Like following is with default value of 0.56and once user click in that box, a separate button should be enabled. Any suggestions? Thanks

wx.StaticText(panel, -1, "Reach Slope", (40, 170))
self.reachslope = wx.TextCtrl(panel, -1, value=str(0.56), pos=(150, 165), size=(75,25))

What have you tried?  Have you gone through the documentation and the examples?  This is a fairly basic request.

If you really just want to trigger this on a click, you can certainly capture left click events.  It would be more common to enable an "Apply" button if the value of the control actually changes, which you can capture through EVT_TEXT.
-- 
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Enable button when wx.TextCtrl is clicked in

John Fabiani

On Wed, Jan 3, 2018 at 9:56 AM, Tim Roberts <[hidden email]> wrote:
Ibraheem Khan wrote:
I have a dialog box (with multiple editable text fields and buttons) and want to activate one of buttons when any one of text field boxes is clicked in. Like following is with default value of 0.56and once user click in that box, a separate button should be enabled. Any suggestions? Thanks

wx.StaticText(panel, -1, "Reach Slope", (40, 170))
self.reachslope = wx.TextCtrl(panel, -1, value=str(0.56), pos=(150, 165), size=(75,25))

What have you tried?  Have you gone through the documentation and the examples?  This is a fairly basic request.

If you really just want to trigger this on a click, you can certainly capture left click events.  It would be more common to enable an "Apply" button if the value of the control actually changes, which you can capture through EVT_TEXT.
-- 
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Enable button when wx.TextCtrl is clicked in

Ibraheem Khan
In reply to this post by Tim Roberts
Is there any example to capture if control changes -- I have to activate Apply button when text in TextCtrl changes. Thanks

On Wednesday, January 3, 2018 at 12:56:44 PM UTC-5, Tim Roberts wrote:
Ibraheem Khan wrote:
I have a dialog box (with multiple editable text fields and buttons) and want to activate one of buttons when any one of text field boxes is clicked in. Like following is with default value of 0.56and once user click in that box, a separate button should be enabled. Any suggestions? Thanks

wx.StaticText(panel, -1, "Reach Slope", (40, 170))
self.reachslope = wx.TextCtrl(panel, -1, value=str(0.56), pos=(150, 165), size=(75,25))

What have you tried?  Have you gone through the documentation and the examples?  This is a fairly basic request.

If you really just want to trigger this on a click, you can certainly capture left click events.  It would be more common to enable an "Apply" button if the value of the control actually changes, which you can capture through EVT_TEXT.
-- 
Tim Roberts, <a href="javascript:" target="_blank" gdf-obfuscated-mailto="Z7XVndJqDAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ti...@...
Providenza & Boekelheide, Inc.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Enable button when wx.TextCtrl is clicked in

Tim Roberts
Ibraheem Khan wrote:
Is there any example to capture if control changes -- I have to activate Apply button when text in TextCtrl changes.

Yes, there are many, many examples, including in the wx demo itself, and I told you in my message what to look for.  Have you looked at all?  I have a reputation for being helpful on technical forums, but it really gets my goat when people aren't doing at least a minimum of research on their own, and I'm getting that feeling here.  You're asking a very basic question, which you should have been able to answer on your own.
-- 
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.



On Wednesday, January 3, 2018 at 12:56:44 PM UTC-5, Tim Roberts wrote:
Ibraheem Khan wrote:
I have a dialog box (with multiple editable text fields and buttons) and want to activate one of buttons when any one of text field boxes is clicked in. Like following is with default value of 0.56and once user click in that box, a separate button should be enabled. Any suggestions? Thanks

wx.StaticText(panel, -1, "Reach Slope", (40, 170))
self.reachslope = wx.TextCtrl(panel, -1, value=str(0.56), pos=(150, 165), size=(75,25))

What have you tried?  Have you gone through the documentation and the examples?  This is a fairly basic request.

If you really just want to trigger this on a click, you can certainly capture left click events.  It would be more common to enable an "Apply" button if the value of the control actually changes, which you can capture through EVT_TEXT.


--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Enable button when wx.TextCtrl is clicked in

Ibraheem Khan
You are right. I put little effort in it at start -- now have worked out a solution. Thank you for push! :)

On Wednesday, January 3, 2018 at 3:38:11 PM UTC-5, Tim Roberts wrote:
Ibraheem Khan wrote:
Is there any example to capture if control changes -- I have to activate Apply button when text in TextCtrl changes.

Yes, there are many, many examples, including in the wx demo itself, and I told you in my message what to look for.  Have you looked at all?  I have a reputation for being helpful on technical forums, but it really gets my goat when people aren't doing at least a minimum of research on their own, and I'm getting that feeling here.  You're asking a very basic question, which you should have been able to answer on your own.
-- 
Tim Roberts, <a href="javascript:" target="_blank" gdf-obfuscated-mailto="t_NC7qFzDAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ti...@...
Providenza & Boekelheide, Inc.



On Wednesday, January 3, 2018 at 12:56:44 PM UTC-5, Tim Roberts wrote:
Ibraheem Khan wrote:
I have a dialog box (with multiple editable text fields and buttons) and want to activate one of buttons when any one of text field boxes is clicked in. Like following is with default value of 0.56and once user click in that box, a separate button should be enabled. Any suggestions? Thanks

wx.StaticText(panel, -1, "Reach Slope", (40, 170))
self.reachslope = wx.TextCtrl(panel, -1, value=str(0.56), pos=(150, 165), size=(75,25))

What have you tried?  Have you gone through the documentation and the examples?  This is a fairly basic request.

If you really just want to trigger this on a click, you can certainly capture left click events.  It would be more common to enable an "Apply" button if the value of the control actually changes, which you can capture through EVT_TEXT.


--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Enable button when wx.TextCtrl is clicked in

Rufus V. Smith
Hi Ibraham,

To help others on the list, when a solution has been found, it is general courtesy to share what the solution you found is.
That way you can pay it forward to someone who may have a similar problem.   Just saying "Thanks, I solved my problem!" 
doesn't really help anyone.  You should share the approach you took, or where you found the solution to your problem.

Can you share the solution you "worked out"?

Thanks.

Rufus


On Jan 3, 2018, at 4:42 PM, Ibraheem Khan <[hidden email]> wrote:

You are right. I put little effort in it at start -- now have worked out a solution. Thank you for push! :)

On Wednesday, January 3, 2018 at 3:38:11 PM UTC-5, Tim Roberts wrote:
Ibraheem Khan wrote:
Is there any example to capture if control changes -- I have to activate Apply button when text in TextCtrl changes.

Yes, there are many, many examples, including in the wx demo itself, and I told you in my message what to look for.  Have you looked at all?  I have a reputation for being helpful on technical forums, but it really gets my goat when people aren't doing at least a minimum of research on their own, and I'm getting that feeling here.  You're asking a very basic question, which you should have been able to answer on your own.
-- 
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.



On Wednesday, January 3, 2018 at 12:56:44 PM UTC-5, Tim Roberts wrote:
Ibraheem Khan wrote:
I have a dialog box (with multiple editable text fields and buttons) and want to activate one of buttons when any one of text field boxes is clicked in. Like following is with default value of 0.56and once user click in that box, a separate button should be enabled. Any suggestions? Thanks

wx.StaticText(panel, -1, "Reach Slope", (40, 170))
self.reachslope = wx.TextCtrl(panel, -1, value=str(0.56), pos=(150, 165), size=(75,25))

What have you tried?  Have you gone through the documentation and the examples?  This is a fairly basic request.

If you really just want to trigger this on a click, you can certainly capture left click events.  It would be more common to enable an "Apply" button if the value of the control actually changes, which you can capture through EVT_TEXT.



--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Enable button when wx.TextCtrl is clicked in

Ibraheem Khan
Hi Rufus,
My workaround didn't work out eventually. Following link is with solution from stackexchange:
https://stackoverflow.com/questions/48081577/enable-button-when-wx-textctrl-is-clicked-in

regards,
Ibraheem

On Saturday, January 6, 2018 at 6:56:11 PM UTC-5, Rufus wrote:
Hi Ibraham,

To help others on the list, when a solution has been found, it is general courtesy to share what the solution you found is.
That way you can pay it forward to someone who may have a similar problem.   Just saying "Thanks, I solved my problem!" 
doesn't really help anyone.  You should share the approach you took, or where you found the solution to your problem.

Can you share the solution you "worked out"?

Thanks.

Rufus


On Jan 3, 2018, at 4:42 PM, Ibraheem Khan <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="E5kfoTqRCwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ibrahee...@...> wrote:

You are right. I put little effort in it at start -- now have worked out a solution. Thank you for push! :)

On Wednesday, January 3, 2018 at 3:38:11 PM UTC-5, Tim Roberts wrote:
Ibraheem Khan wrote:
Is there any example to capture if control changes -- I have to activate Apply button when text in TextCtrl changes.

Yes, there are many, many examples, including in the wx demo itself, and I told you in my message what to look for.  Have you looked at all?  I have a reputation for being helpful on technical forums, but it really gets my goat when people aren't doing at least a minimum of research on their own, and I'm getting that feeling here.  You're asking a very basic question, which you should have been able to answer on your own.
-- 
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.



On Wednesday, January 3, 2018 at 12:56:44 PM UTC-5, Tim Roberts wrote:
Ibraheem Khan wrote:
I have a dialog box (with multiple editable text fields and buttons) and want to activate one of buttons when any one of text field boxes is clicked in. Like following is with default value of 0.56and once user click in that box, a separate button should be enabled. Any suggestions? Thanks

wx.StaticText(panel, -1, "Reach Slope", (40, 170))
self.reachslope = wx.TextCtrl(panel, -1, value=str(0.56), pos=(150, 165), size=(75,25))

What have you tried?  Have you gone through the documentation and the examples?  This is a fairly basic request.

If you really just want to trigger this on a click, you can certainly capture left click events.  It would be more common to enable an "Apply" button if the value of the control actually changes, which you can capture through EVT_TEXT.



--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="E5kfoTqRCwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">wxpython-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.