shoes3 icon indicating copy to clipboard operation
shoes3 copied to clipboard

edit_box does not support scrollbar related methods

Open IanTrudel opened this issue 10 years ago • 7 comments

Shoes edit_box does not respond to scroll_top, scroll_max, scroll_height, scroll and gutter.

image

Shoes.app {
   @p = para
   stack do
   [edit_line, edit_box].each { |n|
      [:scroll_top, :scroll_max, :scroll_height, :scroll, :gutter].each { |m|
         @p.text += "#{n.class}##{m}: #{n.respond_to?(m)}\n"
      }
      @p.text += "\n"
   }
   end.hide
}

IanTrudel avatar Jan 24 '15 14:01 IanTrudel

I can't find anywhere in the manual that suggests these work. I'm assuming this an enhancement request.

By definition there is nothing to scroll in an edit_line.

ccoupe avatar Mar 13 '15 04:03 ccoupe

By definition there is nothing to scroll in an edit_line.

Agreed on edit_line. However, it is a normal behaviour (any GUI) to provide support for a scrollbar on an edit_box. The text can easily overflow and it would be a struggle to edit in such edit box without a scrollbar.

IanTrudel avatar Mar 13 '15 04:03 IanTrudel

Shoes.app do
  @a = edit_box :height => 100
  str = ""
  10.times {|i| str << "Line #{i}\n"}
  @a.text = str
  button "Display" do
   para @a.text
  end
end

A scroll bar appears. You can edit the text.

ccoupe avatar Mar 13 '15 05:03 ccoupe

True. Let's go back on the original topic for a second: Shoes edit_box does not respond to scroll_top, scroll_max, scroll_height, scroll and gutter. There is no way to know anything about that said scrollbar.

IanTrudel avatar Mar 13 '15 05:03 IanTrudel

I'd like an option to autoscroll (if needed) but that's different. Serious question. What would you do if you knew the edit_box has or doesn't have a scroll bar? What ever that reason is - can you detect that condition in the block attached to the edit_box?

ccoupe avatar Mar 13 '15 06:03 ccoupe

Something I've learned with the 3.2.24 console is that edit box could behave much more like a multi-line text editor window (both gtk and osx). It's a lot code to implement and we'd have to add some methods/styles/procs to Shoes - perhaps it would be better to just create a new control for Shoes so don't have compatibility issues to deal with.

ccoupe avatar Aug 08 '15 03:08 ccoupe

Partially addressed in #146. Good enough?

ccoupe avatar Sep 11 '15 06:09 ccoupe