# Wx::Choice in Windows

**URL:** <https://www.ruby-forum.com/t/wx-choice-in-windows/182913>\
**Category:** wxRuby\
**Created:** [February 4, 2010, 6:57pm UTC](https://www.ruby-forum.com/t/wx-choice-in-windows/182913 "2010-02-04T18:57:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![valentin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/f19dbf/32.png) [@valentin](https://www.ruby-forum.com/u/valentin)\
**Post date:** [February 4, 2010, 6:57pm UTC](https://www.ruby-forum.com/t/wx-choice-in-windows/182913/1 "2010-02-04T18:57:08Z")

</div>

Hi!  
While testing my wxRuby app on Windows, I found that Wx::Choice behaves  
differently under Linux and Windows. For this line of code

```
@tpf_choice = Wx::Choice.new(self, :choices => %w(1 8 16 32 64 256))

```

in Linux, the first choice ‘1’ is pre-selected, while in Windows nothing  
is selected until I open the list and select a value from it. After  
that, blank value cannot be selected.  
Is it a bug?

---

<div class="post-metadata">

**Author:** ![valentin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/f19dbf/32.png) [@valentin](https://www.ruby-forum.com/u/valentin)\
**Post date:** [February 5, 2010, 6:56am UTC](https://www.ruby-forum.com/t/wx-choice-in-windows/182913/2 "2010-02-05T06:56:02Z")

</div>

I suggest you add  
set\_selection  
to make sure that 1st value is pre-selected  
I don’t know about you, but I would rather play save  
when it comes to programming, especially cross platform  
and since I am not the developer of this great library (just a user)  
I cannot help you any otherway

On Fri, Feb 5, 2010 at 12:57 AM, Valentine Bichkovsky

---

<div class="post-metadata">

**Author:** ![valentin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/f19dbf/32.png) [@valentin](https://www.ruby-forum.com/u/valentin)\
**Post date:** [February 5, 2010, 11:38pm UTC](https://www.ruby-forum.com/t/wx-choice-in-windows/182913/3 "2010-02-05T23:38:04Z")

</div>

On 04/02/2010 17:57, Valentine Bichkovsky wrote:

> 

Thanks for the report. It’s always been this way, and is so too in  
wxWidgets. I don’t think it’s a bug but rather a difference in the way  
the native control works on each platform. But, yes, it can be  
surprising.

cheers  
alex
