i am working on following piece of code. i want to return combo box choices
as parameters and use in another function. As combo box comes up with event
handler i don't find an easy way to call it in another function. my code
looks like following
def func(self):
x=self.OnCombo()
y=x
but as you already guess mistake is OnCombo() misses argument and program
outputs error Can someone help me, how to dealt with it
That won't work, of course, because you are returning before you do the
event.Skip(). Was that a cut-and-paste problem?
and i want to call in another function as below:
def func(self):
x=self.OnCombo()
y=x
but as you already guess mistake is OnCombo() misses argument and program
outputs error Can someone help me, how to dealt with it
Andrea's suggestion is a good one, but another alternative is to
separate the action from the event:
def getValue\(self\):
product = self\.combo\_box\_product\.GetValue\(\)
return product
def OnCombo\(self, event\):
event\.Skip\(\)
return self\.getValue\(\)
def func\(self\):
x = self\.getValue\(\)
y = x
···
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.