Enable button when wx.TextCtrl is clicked in

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.

···

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.56 and 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))
-- Tim Roberts, Providenza & Boekelheide, Inc.

timr@probo.com

Use an Event Handler: Examples
https://stackoverflow.com/questions/25899489/how-to-write-wxpython-textctrl-focus-event

···

On Wed, Jan 3, 2018 at 9:56 AM, Tim Roberts timr@probo.com 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.56 and 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))
-- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
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 wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

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.56 and 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, ti...@probo.com
Providenza & Boekelheide, Inc.

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.

···

Ibraheem Khan wrote:

    Is there any example to capture if control changes

– I have to activate Apply button when text in TextCtrl
changes.

-- Tim Roberts, 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.56 and
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.

timr@probo.com

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

···

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, ti...@probo.com
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.56 and
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.

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 ibraheem.khan99@gmail.com wrote:

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

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, ti...@probo.com
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.56 and
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 wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi Rufus,

My workaround didn’t work out eventually. Following link is with solution from stackexchange:

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 ibrahee...@gmail.com wrote:

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

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, ti...@probo.com
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.56 and
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 wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.