misleading behaviour of TextModel>>setSelection: in Spec

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

misleading behaviour of TextModel>>setSelection: in Spec

Andrei Chis
Hi,

I am playing with spec hit some issues with TextModel>>setSelection:

First, unlike any other method in TextModel, setSelection: only has an effect if you call it after sending openWithSpec to the model.
This is because it sets the selection directly on the morph widget.

Second if you set the selection and widget hasn't got the focus it won't have any visual effect.
This is because it uses PluggableTextMorph>>selectionInterval: which just updates the interval without doing any visual update.

So shall we classify these as bugs?

Cheers,
Andrei
Reply | Threaded
Open this post in threaded view
|

Re: misleading behaviour of TextModel>>setSelection: in Spec

Benjamin Van Ryseghem (Pharo)
I think it's a bug.
At least it's not the expected behaviour :)

Ben

On Jan 31, 2013, at 7:40 PM, Andrei Vasile Chis <[hidden email]> wrote:

Hi,

I am playing with spec hit some issues with TextModel>>setSelection:

First, unlike any other method in TextModel, setSelection: only has an effect if you call it after sending openWithSpec to the model.
This is because it sets the selection directly on the morph widget.

Second if you set the selection and widget hasn't got the focus it won't have any visual effect.
This is because it uses PluggableTextMorph>>selectionInterval: which just updates the interval without doing any visual update.

So shall we classify these as bugs?

Cheers,
Andrei

Reply | Threaded
Open this post in threaded view
|

Re: misleading behaviour of TextModel>>setSelection: in Spec

Andrei Chis
Ok. I'll open an issue then.

Andrei

On Thu, Jan 31, 2013 at 8:41 PM, Benjamin <[hidden email]> wrote:
I think it's a bug.
At least it's not the expected behaviour :)

Ben

On Jan 31, 2013, at 7:40 PM, Andrei Vasile Chis <[hidden email]> wrote:

Hi,

I am playing with spec hit some issues with TextModel>>setSelection:

First, unlike any other method in TextModel, setSelection: only has an effect if you call it after sending openWithSpec to the model.
This is because it sets the selection directly on the morph widget.

Second if you set the selection and widget hasn't got the focus it won't have any visual effect.
This is because it uses PluggableTextMorph>>selectionInterval: which just updates the interval without doing any visual update.

So shall we classify these as bugs?

Cheers,
Andrei


Reply | Threaded
Open this post in threaded view
|

Re: misleading behaviour of TextModel>>setSelection: in Spec

Andrei Chis
I created two :)

http://code.google.com/p/pharo/issues/detail?id=7382

For the second I also uploaded a possible fix.

Andrei

On Thu, Jan 31, 2013 at 8:44 PM, Andrei Vasile Chis <[hidden email]> wrote:
Ok. I'll open an issue then.

Andrei


On Thu, Jan 31, 2013 at 8:41 PM, Benjamin <[hidden email]> wrote:
I think it's a bug.
At least it's not the expected behaviour :)

Ben

On Jan 31, 2013, at 7:40 PM, Andrei Vasile Chis <[hidden email]> wrote:

Hi,

I am playing with spec hit some issues with TextModel>>setSelection:

First, unlike any other method in TextModel, setSelection: only has an effect if you call it after sending openWithSpec to the model.
This is because it sets the selection directly on the morph widget.

Second if you set the selection and widget hasn't got the focus it won't have any visual effect.
This is because it uses PluggableTextMorph>>selectionInterval: which just updates the interval without doing any visual update.

So shall we classify these as bugs?

Cheers,
Andrei