do you mean it as follows?
(just comment out one of the setmark lines)
Apparantly the SetFocus is important (here);
otherwise the SetMark doesn't work.
import wx
class Form1(wx.Panel):
def __init__(self, parent, id):
wx.Panel.__init__(self, parent, id)
self.sampleList = ['friends', 'advertising', 'Websearch',
'yellowpages']
self.cBox=wx.ComboBox(self, 30, "", wx.Point(150, 90),
wx.Size(95, -1),
self.sampleList, wx.CB_DROPDOWN)
self.cBox.SetSelection (0)
self.cBox.SetFocus()
#cursor on before first char
#self.cBox.SetMark(0, 0)
#cursor after last char
#self.cBox.SetMark(len(self.cBox.GetValue()),
len(self.cBox.GetValue()))
app = wx.PySimpleApp()
frame = wx.Frame(None,-1, "Demo with Combobox")
form1=Form1(frame, -1)
frame.Show(1)
app.MainLoop()
···
On Tue, 27 Jul 2004 21:59:03 +0200, "Alessandro Crugnola *sephiroth*" <wishmaster@sephiroth.it> wrote:
Hi all,
Using wxCombo (i'm using wxpython 2.5.2.3)
When i use the SetSelection(0) it happens that the textctrl inside the combo box has all the string with selection.
It there a way to have the first item selected but without the selection over all the text?thanks
--
Franz Steinhaeusler