ComboBox and CheckBox equivalent of ChangeValue

Changed over my validator.TransferToWindow to use ChangeValue for TextCtrl type controls.

I can not find an equivalent method for setting selection/value for ComboBox and CheckBox.

Is there such a thing? If not could something like this be done in Python and if yes I would appreciate some pointers on how to do it.

Thanks
Werner

CheckBox.SetValue(True/False)

http://docs.wxwidgets.org/stable/wx_wxcheckbox.html#wxcheckboxsetvalue

ComboBox.SetSelection()

http://docs.wxwidgets.org/stable/wx_wxcombobox.html#wxcomboboxsetselection

-Brian

Brian Fett

1280 Disc Dr

SHK224

Shakopee, MN 55379

Phone: (952)402-2595

Brian.D.Fett@seagate.com

"Werner F. Bruhin"
werner.bruhin@free.fr

Sent by: wxpython-users-bounces@lists.wxwidgets.org

No Phone Info Available
09/09/2008 07:12 AM

Please respond to

wxpython-users@lists.wxwidgets.org

To

wxPython-users@lists.wxwidgets.org
cc

Subject

[wxpython-users] ComboBox and CheckBox
equivalent of ChangeValue

`Changed over my validator.TransferToWindow to use
ChangeValue for

TextCtrl type controls.

I can not find an equivalent method for setting selection/value for

ComboBox and CheckBox.

Is there such a thing? If not could something like this be done in

Python and if yes I would appreciate some pointers on how to do it.

Thanks

Werner

···

wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

`

Brian,

CheckBox.SetValue(True/False)
http://docs.wxwidgets.org/stable/wx_wxcheckbox.html#wxcheckboxsetvalue

I am using this, but I see events being fired.

ComboBox.SetSelection()
http://docs.wxwidgets.org/stable/wx_wxcombobox.html#wxcomboboxsetselection

I use SetStringSelection and again I see events being fired.

Guess I have to put better glasses on to find what I am doing wrong.

Thanks
Werner

···

brian.d.fett@seagate.com wrote:

Ah, didn’t get from your question that
you wanted methods that didn’t fire events. I am not aware of such a method
for these controls.

-Brian

Brian Fett

1280 Disc Dr

SHK224

Shakopee, MN 55379

Phone: (952)402-2595

Brian.D.Fett@seagate.com

“Werner F. Bruhin”
werner.bruhin@free.fr

Sent by: wxpython-users-bounces@lists.wxwidgets.org

No Phone Info Available
09/09/2008 09:41 AM

Please respond to

wxpython-users@lists.wxwidgets.org

To

wxpython-users@lists.wxwidgets.org
cc

Subject

Re: [wxpython-users] ComboBox and CheckBox
equivalent of ChangeValue

`Brian,

CheckBox.SetValue(True/False)

http://docs.wxwidgets.org/stable/wx_wxcheckbox.html#wxcheckboxsetvalue

I am using this, but I see events being fired.

ComboBox.SetSelection()

http://docs.wxwidgets.org/stable/wx_wxcombobox.html#wxcomboboxsetselection

I use SetStringSelection and again I see events being fired.

Guess I have to put better glasses on to find what I am doing wrong.

Thanks

Werner

···

brian.d.fett@seagate.com wrote:


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

`

Hi Werner,

Changed over my validator.TransferToWindow to use ChangeValue for TextCtrl type controls.

I can not find an equivalent method for setting selection/value for ComboBox and CheckBox.

Is there such a thing? If not could something like this be done in Python and if yes I would appreciate some pointers on how to do it.

Thanks
Werner

What do you mean by "setting selection" for ComboBox? I can use SetValue() on mine...I catch the wx.EVT_COMBOBOX event when the user changes their selection. As I recall, you can make your validators do whatever you want.

I'm probably just being naive.

···

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org

Brian,

···

brian.d.fett@seagate.com wrote:

Ah, didn't get from your question that you wanted methods that didn't fire events. I am not aware of such a method for these controls.

According to the doc, which you pointed out to me:) it seems that CheckBox.SetValue should not send an event.

Got into my maskedit problem and will have to come back to this and see if I did not jump to conclusions to quickly (which does happen with me :slight_smile: ).

Werner

Hi Mike,

Mike Driscoll wrote:

Hi Werner,

Changed over my validator.TransferToWindow to use ChangeValue for TextCtrl type controls.

I can not find an equivalent method for setting selection/value for ComboBox and CheckBox.

Is there such a thing? If not could something like this be done in Python and if yes I would appreciate some pointers on how to do it.

Thanks
Werner

What do you mean by "setting selection" for ComboBox? I can use SetValue() on mine...I catch the wx.EVT_COMBOBOX event when the user changes their selection. As I recall, you can make your validators do whatever you want.

SetValue, SetSelection or SetStringSelection will do it and I do use the last of them. But I am looking for a way to do it without getting an event.

Need to do a bit more of my homework before I come back on this.

Werner

Werner,

What do you mean by "setting selection" for ComboBox? I can use SetValue() on mine...I catch the wx.EVT_COMBOBOX event when the user changes their selection. As I recall, you can make your validators do whatever you want.

SetValue, SetSelection or SetStringSelection will do it and I do use the last of them. But I am looking for a way to do it without getting an event.

Need to do a bit more of my homework before I come back on this.

Werner

Why do you not want the events? You should be able to just ignore them either way just be not skipping.

···

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org

I jumped to conclusions to early.

Can confirm that:

CheckBox.SetValue does not fire an event
wx.ControlWithItems.SetStringSelection and wx.ControlWithItems.SetSelection also are not firing an event.

Still searching for the guilty party so, i.e. I am still getting change events where I don't think I should get any - but that is another story for another day.

Werner