Forum: wxRuby Preserve selections

Posted by Maciej Szatanik (mszatanik)
on 2010-05-18 09:07
hi,

could any1 help me to figure out how to preserve selections in extended
listbox please?

f.e. i have a button to move up/down selected item(s), but after i click
it and selection goes up or down i loose selections.

i'd like to create an array which would hold those selections via
get_selections(), but i dont see any method to select an item in a
listbox.

Best regards
M.Szatanik
Posted by hendra kusuma (Guest)
on 2010-05-18 10:22
(Received via mailing list)
If you really needs selection,
perhaps you can use checklistbox ?
Posted by Maciej Szatanik (mszatanik)
on 2010-05-18 11:12
will thought it over, at least its a solution :) thx a lot.
Posted by Alex Fenton (Guest)
on 2010-05-18 14:19
(Received via mailing list)
On 18/05/2010 08:07, Maciej Szatanik wrote:
> could any1 help me to figure out how to preserve selections in extended
> listbox please?
>
> f.e. i have a button to move up/down selected item(s), but after i click
> it and selection goes up or down i loose selections.
>
> i'd like to create an array which would hold those selections via
> get_selections(), but i dont see any method to select an item in a
> listbox.
>    
The method you want is select() - ListBox inherits it from
Wx::ControlWithItems.

alex
Posted by Maciej Szatanik (mszatanik)
on 2010-05-18 14:22
Alex Fenton wrote:
> On 18/05/2010 08:07, Maciej Szatanik wrote:
>> could any1 help me to figure out how to preserve selections in extended
>> listbox please?
>>
>> f.e. i have a button to move up/down selected item(s), but after i click
>> it and selection goes up or down i loose selections.
>>
>> i'd like to create an array which would hold those selections via
>> get_selections(), but i dont see any method to select an item in a
>> listbox.
>>    
> The method you want is select() - ListBox inherits it from
> Wx::ControlWithItems.
> 
> alex

thx a lot :* will check it out right away.
from now on i will always check those damn parents :P
Posted by Maciej Szatanik (mszatanik)
on 2010-05-18 15:25
Maciej Szatanik wrote:
> Alex Fenton wrote:
>> On 18/05/2010 08:07, Maciej Szatanik wrote:
>>> could any1 help me to figure out how to preserve selections in extended
>>> listbox please?
>>>
>>> f.e. i have a button to move up/down selected item(s), but after i click
>>> it and selection goes up or down i loose selections.
>>>
>>> i'd like to create an array which would hold those selections via
>>> get_selections(), but i dont see any method to select an item in a
>>> listbox.
>>>    
>> The method you want is select() - ListBox inherits it from
>> Wx::ControlWithItems.
>> 
>> alex
> 
> thx a lot :* will check it out right away.
> from now on i will always check those damn parents :P

yup, it works, thanks again.
An example if any1 is interested.

          Array.each do |cell|
            @listbox.select(cell)
          end
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.