[wxPython] setting ListBox selections (fwd)

As requested, a repeat of my ListBox problem... ~Denny

···

---------- Forwarded message ----------

Hi all...

Thanks for the help with the OGL line stuff, which I was
obviously approaching from totally the wrong angle... it
works now :slight_smile:

Today's problem is this: I can't seem to preset which items
are selected on a wxListBox

--- snippet ---

self.param_list.Deselect (0)
for i in l:
  self.param_list.SetSelection (i-1)
  p = data['model']['parameters']
  s = p [i].keys()[0]
  self.param_list.SetStringSelection (s)
  print i, s # TEST

---

--- output ---

1 Parameter one
2 Parameter two

---

So why doesn't the ListBox select the appropriate items?

It has eight items in it, the first two being the same
as the strings seen in the output... but whether I try
and set the selected items by number, string, or both,
it always selects the first one (despite the deselect)
and only the first one.

Regards,
Denny

----------------------------------------------------------
Denny De La Haye \ www-edc.eng.cam.ac.uk/~djd33
Engineering Design Centre, \ www-edc.eng.cam.ac.uk
Department of Engineering, \ www.eng.cam.ac.uk
University of Cambridge, UK \ www.cam.ac.uk
----------------------------------------------------------
"The more you read, the less everyone else knows"

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

Hello again.

Latest dilemna is:

I'm debating whether or not I should add a couple text counters directly to a parent window and simply update the text (I'm assuming this is possible), or if I should first create child windows containing the text, and then update the windows every time the text values change.

so, it is possible to update text directly right?
speed?
other considerations?

perhaps a minor point, but I'll be doing this a lot, and speed is critical for this app.
thanks!

-steve

···

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users