Did you find that focus() works in general? I had problems with it
recently, but I am still new and might have messed something up.

On Wed, Jul 30, 2008 at 4:39 PM, Hugh Sasse <[EMAIL PROTECTED]> wrote:
> Trying out stuff with shoes tonight, using the manual, I found
> that the search box doesn't get focus when you start.
>
> I've only dipped into git a little bit, but I did `git pull` as a search
> revealed it is the same as `svn update` so no danger of damaging your
> repository. #{touch :wood}
>
> So I wondered if a fix might be as simple as this untested patch:
>
> diff --git a/lib/shoes/help.rb b/lib/shoes/help.rb
> index e4b95eb..c05355d 100644
> --- a/lib/shoes/help.rb
> +++ b/lib/shoes/help.rb
> @@ -162,7 +162,7 @@ module Shoes::Manual
>     @doc.clear do
>       dewikify_p :para, "Try method names (like `button` or `arrow`) or
> topics
>       flow :margin_left => 60 do
> -        edit_line :width => -60 do |terms|
> +        @search_edit_line = edit_line :width => -60 do |terms|
>           @results.clear do
>             termd = terms.text.downcase
>             found = termd.empty? ? [] : manual_search(termd)
> @@ -189,6 +189,7 @@ module Shoes::Manual
>           end
>         end
>       end
> +      @search_edit_line.focus()
>       @results = stack
>     end
>     self.scroll_top = 0
>
>
> or something more elegant.
>
> One or two other observations:
>
> I don't see any way to highlight/select text in things not editable.
> For example, to copy and paste one would wish to select text in a
> para.  I can't get that to happen, not programmatically or directly.
> I know about the clipboard method, but that doesn't produce an
> effect on the screen [I think: it is not tied to an element].  I
> was hoping that selecting a region of text would trigger the
> Microsoft Narrator to read it.  Vista speech will let you read into
> an edit_line directly (which is splendid, I can't do that with
> TkInter in Python).  This would allow conversation (of sorts) with
> the machine.
>
> I don't understand, from keypress events and how they interact with
> edit_line, how one might avoid the need for an enter button, and
> just press return instead.  That might be a use case worthy of an
> example.  I know one can use the block for edit_line to continually
> examine its text value (as in your manual).  Being able to use the
> arrow keys for history might be another good use case.  My searching
> was insufficient to find out how to do that.  I'll keep looking.
>
> With 0.r811, on vista, a stack of paras won't quite scroll to the
> bottom with
>
>  @stack.scroll_top = @stack.scroll_max
>
> there's a tad left at the bottom of the scrollbar, and the bottom
> two 1-line paras aren't visible.  This may be fixed in the stuff
> your working on now, so I'll wait until the next release to produce
> a trimmed example.
>
> Don't feel rushed for any of these, please: I'm just trying to give
> useful feedback.  You have your own priorities.
>
> Thank you.
> Hugh
>



-- 
Seth Thomas Rasmussen
http://greatseth.com

Reply via email to