shoes4 icon indicating copy to clipboard operation
shoes4 copied to clipboard

Text is not selectable

Open PragTob opened this issue 12 years ago • 8 comments

You can not mark text in a shoes application, e.g. when holding the mouse button you can not mark and copy it. This is behavior as in Shoes3 but back then lots of people (including myself) complained about it.

So if we can figure out a way to make text markable (is that a word?) even if it's just optionally I would be very happy.

I marked this as a bug, as I consider the shoes3 behavior a bug =)

edit: Apparently it is called selecting text thanks @fism88 !

PragTob avatar Aug 23 '13 18:08 PragTob

Do you mean selecting text when you say marking?

fism88 avatar Aug 23 '13 19:08 fism88

In fact I do. :-D Thanks!

PragTob avatar Aug 23 '13 19:08 PragTob

when holding the mouse button you can not mark and copy it

You can do that with Shoes 3. So, I think this is not a bug, just not implemented yet in Shoes 4. Try out the following snippet.

Shoes.app height: 200 do
  msg = para 'Shooooose ' * 50
  click do |b, x, y|
    @s = msg.marker = msg.hit(x, y)
  end
  release do |b, x, y|
    @e = msg.cursor = msg.hit(x, y)
    self.clipboard = msg.text[@s, @e-@s]
  end
end

shoes3_hit_and_marker.png In Shoes, you have to control text-cursor by yourself. TextBlock#cursor, TextBlock#hit and TextBlock#marker are helper methods to do that. Not mentioned in the manual, though...

ashbb avatar Aug 25 '13 00:08 ashbb

Oh ok I didn't know that, it was a complaint we got a lot that you could not copy and paste text from the console.

However wouldn't it be good to have something more automatic? I mean for instance on the web you can just copy and paste any text - couldn't shouldn't it be the same in shoes so that it just works without extra code to make it possible?

PragTob avatar Aug 25 '13 10:08 PragTob

I think that this might be more trouble than it's worth, to try and implement. Also, I'm not sure that I like that we will be moving so much from what people expect. Imho this is really just a quirk in old-shoes (I just minted that term) and not really a feature.

Can't the people that need this just use an edit_line?

davorb avatar Aug 26 '13 22:08 davorb

@ashbb I had no idea about #hit #cursor and #marker :)

@davorb it would be great if we could copy from the error console. In Shoes 3, you can't, and it's always surprising to users: "My app had an error, but I can't copy and paste it. Should I type it in?"

wasnotrice avatar Aug 26 '13 23:08 wasnotrice

Also for the hacketyhack editor having selectable text is nice but maybe that is an edit line. But yeah as @wasnotrice mentioned the console is the most important one.

PragTob avatar Aug 27 '13 00:08 PragTob

@wasnotrice @PragTob I agree that we pretty much need to have the console text be selectable. But it's super easy (at least with swt) to make an edit_line look like normal text, and do that for us.

davorb avatar Aug 27 '13 21:08 davorb