Question on listcontrol and form redrawing

I'm very new to wxpython, so I'm afraid I'm likely overlooking something very basic here. Unfourtunatly I haven't been able to figure it out on my own. I've got a wxListBox set up to use a list of names. And I've also a number of other controls which get the values they display by checking the listcontroll and going the appropriate number of places foreward in other lists.

My question is how do I get these other controlls to update themselves when someone picks a new name from the listbox? Is there some kind of event I need to trigger when a new selection is made in the listbox, or better is there a way that when any control on a form is changed they'll all update themselves?

I don't think there is a "preprogrammed" way of update - how should the
control know in which way you want to update ?
But cook on your own is definitely possible:
Declare a

  EVT_LISTBOX(id, func)

where id is the ID_SOMETHING (numeric) of the listbox and func is the method
to call when the selection changes. The function looks like

def function(self,event):
  pass

where event is a wxEvent instance. Inside of the function you can perform
whatever actions are neeed to update the other controls.

Easiest on this is to get the documentation :slight_smile:

  UC

ยทยทยท

On Wednesday 20 November 2002 10:37 pm, Joe Tierney wrote:

I'm very new to wxpython, so I'm afraid I'm likely overlooking something
very basic here. Unfourtunatly I haven't been able to figure it out on my
own. I've got a wxListBox set up to use a list of names. And I've also a
number of other controls which get the values they display by checking the
listcontroll and going the appropriate number of places foreward in other
lists.

My question is how do I get these other controlls to update themselves when
someone picks a new name from the listbox? Is there some kind of event I
need to trigger when a new selection is made in the listbox, or better is
there a way that when any control on a form is changed they'll all update
themselves?

--
Open Source Solutions 4U, LLC 2570 Fleetwood Drive
Phone: +1 650 872 2425 San Bruno, CA 94066
Cell: +1 650 302 2405 United States
Fax: +1 650 872 2417