List Info

Thread: wx.Choice Question




wx.Choice Question
user name
2006-06-28 00:46:22
Thanks dude for your help.

That was a typo (ch2 being in 2 places)

Thanks, I appreciate your help


>;>wonder, however, how your user is supposed to know the distinction between
>>Item 2 "ch2" and Item 3 "ch2", given the identical strings.  And if there IS
>>no real difference, why give the choice, and what does it matter if you
>>don't know whether it's item 2 or item 3?  Just curious.

On 6/27/06, David Woods <wcer.wisc.edu">dwoodswcer.wisc.edu> wrote:
> Thanks, That was a good suggestions.
>
>; I have one more question to ask.
>
> my choice_list is as follows
&gt;
> choice_list = [''. ch1, ch2, ch2, ch3]
>
> When user selectes some values say ch2 which function should
&gt; we use ? wxPython demo suggests to use GetString() function.
> Since I am not using EVT_CHOICE event which function should I
> use to get the value selected the user ???
>
&gt; Thanks, every help is appreciated.


For questions like that, I turn to the wxWidgets docs. ; (Others probably
turn to other docs, but the wxPython docs didn't exist when I started out
and I've gotten used to doing things this way.)

There, under "wxControlWithItems" are the GetSelection() method, which
returns an integer for the selected choice, as well as the GetString(n)
method, which returns the string associated with a particular item number n,
and the GetStringSelection() method, which you're already familiar with.

I

David



&gt; On 6/27/06, David Woods <wcer.wisc.edu">dwoodswcer.wisc.edu> wrote:
>; > I am designing a GUI using wxGlade. I am using lots of wx.Choice
> > buttons. My question is that by default it is showing the
> 0th element
&gt; > of the default list I am passing. I want it to show blank as
> > illustrated in the wxPython Demo examples.
> >
> > I realised that wxGlade was doing something like this
> >
> > self.choice_1.SetMinSize((150, 25))
> > self.choice_1.SetSelection(0)
&gt; >
> > It was setting the 0th element by default.
> >
> > I commented that line and it still performs the same way.
> >
> > Every help is appreciated.
> >
> > Thanks
>;
> I don't use Glade, but what I do is pass in a blank space as
> the first element in my &nbsp;wxChoice control's choices list. ; ['
&gt; ', 'Choice 1', 'Choice 2']
>
&gt; Hope that makes sense.
>;
> David
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
&gt; lists.wxwidgets.org">wxPython-users-unsubscribelists.wxwidgets.org
> For additional commands, e-mail:
&gt; lists.wxwidgets.org"> wxPython-users-helplists.wxwidgets.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: lists.wxwidgets.org"> wxPython-users-unsubscribelists.wxwidgets.org
For additional commands, e-mail: lists.wxwidgets.org">wxPython-users-helplists.wxwidgets.org


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )