[wxruby-users] Moving text on a window

Jason Shelton jas.shelton at hotmail.com
Tue Dec 16 14:00:07 EST 2008


Thank you for your response, it was very helpful.  I have another question concerning this issue.  Once I have appended the selections from 'list1' to 'list2', is there some sort of 'getValue' method that will return the contents of the 'list2' list box, maybe into an array?  I have used the 'getValue' method to get the value of a combo box, but what is the method for a list box.  Thanks in advance for any help.
 
- Shelton> Date: Tue, 16 Dec 2008 16:15:51 +0000> From: alex at pressure.to> To: wxruby-users at rubyforge.org> Subject: Re: [wxruby-users] Moving text on a window> > Jason Shelton wrote:> > I am new to WxRuby, and I am reading the online WxRuby Documentation > > for help. I want to add a control to my application that can move > > text between two text controls on a window. For example, let's say > > that I have a text/list control with 3 text strings in it, 'one', > > 'two', and 'three'. I want to be able to highlight 'one', click a > > button, and have 'one' appear in another text/list control on the > > window, and the original window should only have 'two' and 'three' > > displayed in it now. I can elaborate if this is not clear. Thank you > > in advance for any help.> > Exactly how to do this depends on the type of control you're copying > from and to. Assuming you're using Wx::ListBox, which is nice and > simple, something like (untested):> > # assuming the_button is the Wx::Button> evt_button(the_button) do> # get the selected text from the original window> sel_text = list_1.string_selection> # add it to the other window> list_2.append (sel_text)> # delete the selection in the old window> list_1.delete( list_1.selection )> end> > > a> _______________________________________________> wxruby-users mailing list> wxruby-users at rubyforge.org> http://rubyforge.org/mailman/listinfo/wxruby-users
_________________________________________________________________
Send e-mail anywhere. No map, no compass.
http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_anywhere_122008
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/wxruby-users/attachments/20081216/531fadf6/attachment.html>


More information about the wxruby-users mailing list