473,387 Members | 1,579 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

calling an event from within a program

Can someone tell me the proper syntax to create an event from within a
program

here is my example code. I have Checkboxes and Radioboxes operating
on the same Text Control. What I want is when the Checkbox is
unchecked for the EVT_RADIOBOX evt to run therefore populating the
text control with the value that was left on it when it was disabled.
So what I really want to do is run a EVT_RADIOBOX from a checkbox.
any suggestions?

def EvtCheckBox3(event):
print ck3.GetValue()

if ck3.GetValue() == True:
t2.Clear()
t2.SetValue("blah blah")
t2.SetEditable(False)
ck1.SetValue(False)
ck2.SetValue(False)
rb.Enable(False)

else:
t2.Clear()
t2.SetValue("blah blah blah")
t2.SetEditable(True)
rb.Enable(True)

ck3 = wx.CheckBox(self, -1, "blah blah blah", (255, 60), (170,
20), wx.NO_BORDER)
self.Bind(wx.EVT_CHECKBOX, EvtCheckBox3, ck3)

#Create a radio box
def EvtRadioBox(event):
print event.GetInt()
if event.GetInt() == 0:
t2.Clear()
t2.SetValue("Blah Blah Blah")
t2.SetEditable(True)

elif event.GetInt() == 1:
t2.Clear()
t2.SetValue("blah blah blah")
t2.SetEditable(False)

elif event.GetInt() == 2:
t2.Clear()
t2.SetValue("blah blah blah")
t2.SetEditable(False)

.............and elif for each position in the radiobox and finally
creating the radiobox and the binding

sitelist = ['blah', 'ying', 'yang']

sizer = wx.BoxSizer(wx.HORIZONTAL)

rb = wx.RadioBox(
self, -1, "My Radiobox", (10, 215), (425, 70),
sitelist, 5, wx.RA_SPECIFY_COLS
)

self.Bind(wx.EVT_RADIOBOX, EvtRadioBox, rb)
Jul 18 '05 #1
0 889

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: alanrn | last post by:
For all you seasoned VB programmers this is going to be a no brainer. However, as a C programmer learning VB I'm having trouble getting my arms around the event-driven nature of VB. Suppose I...
6
by: Steve B. | last post by:
Is it good programming practice to call an event within an event? I'm I creating recursion somehow somewhere? Does an event (e.g. send, e) ever end? I'm sorry, I'm not sure I know what I mean,...
4
by: Zeebra3 | last post by:
Here goes: I have a web form with several asp:dropdownlists, with which, when selection is changed I want to fire an event defined in some clientside js. The content of the clientside code is...
6
by: Marlene Arauz Martin | last post by:
Hello, How's everybody??? I have an aspx. page that is calling an executable,....like this... System.Diagnostics.ProcessStartInfo psi= new System.Diagnostics.ProcessStartInfo();...
4
by: Martin Feuersteiner | last post by:
Dear Group I'm using VB to write an aspnet application. I would like to call a javascript function from within a VB Sub or VB Function, is it possible? My code is something like this: VB...
5
by: Stinky Pete | last post by:
Hi (again) ;-) I'm still very much at the bottom of a steep learning curve with VB, so any and all help is always appreciated. I've found some code to generate the user names who have logged...
1
by: ravikumar2007 | last post by:
I am working with .NET 3.5 framework within an WPF application. I have a windows application where for a textbox, I have defined the lost focus event. I need to call the Focus() method of any other...
9
by: Pubs | last post by:
Hi all, I want to call a function with some intial parameters with in a thread. At the end of the function execution it should return a value to the caller. Caller is outside the thread. ...
11
by: Emmanouil Angelakis | last post by:
Hi, I am tryiong to do something obviously trivial such as: I have a c program called "tsys2list" that when it is ran it asks the user to give the value of "tcal" which is a variable. I want to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.