Ah, yes, in my original PR I meant to ask for feedback on the method name. If this is going to be a more permanent part of the API then we should choose wisely now.

In SWT, the method is setSelection. Here are a few ideas:

set_selection(start_index, final_index=nil) # if final_index is nil, then it just moves the caret to the start_index location

selection(start_index, final_index=nil)

select_text(start_index, final_index=nil)

highlight_text(start_index, final_index=nil) # doesn't make sense for moving the caret

select_range(start_index, final_index=nil)


Any of these would probably work. I do think #select_text is a pretty good choice unless someone thinks one of these ideas (or one that I haven't come up with) is a better name.

On Dec 20, 2013, at 4:42 AM, Tobias Pfeiffer <notifications@github.com> wrote:

> In lib/shoes/input_box.rb:
> 
> > @@ -37,6 +37,10 @@ def text
> >      def text=(value)
> >        @gui.text = value.to_s
> >      end
> > +
> > +    def selected_text(start_index, final_index=nil)
> If I understand this method correctly it selects/highlights the text from start_index to final_index - right?
> 
> If that's so I think select_text might be a better method name, what do you think?
> 
> —
> Reply to this email directly or view it on GitHub.
>