Code highlight

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

Code highlight

Mark Rizun
Hi everyione,

When one selects piece of code in any code editor pane, every other same piece is highlighted with less bright color.
I'm using spec to build a UI and would like to know which event is responsible for this highlihts.
For example, in TextModel there is one event that probably is related to my problem, but I'm not sure: #whenReadSelectionIsChanged:
So, what I want is to use the event which is invoked when selection of code is changed - probably it is the name of event :)

Mark
Reply | Threaded
Open this post in threaded view
|

Re: Code highlight

Mark Rizun

2015-01-19 14:36 GMT+01:00 Mark Rizun <[hidden email]>:
Hi everyione,

When one selects piece of code in any code editor pane, every other same
piece is highlighted with less bright color.
I'm using spec to build a UI and would like to know which event is
responsible for this highlihts.
For example, in TextModel there is one event that probably is related to my
problem, but I'm not sure: #whenReadSelectionIsChanged:
So, what I want is to use the event which is invoked when selection of code
is changed - probably it is the name of event :)

Mark



--
View this message in context: http://forum.world.st/Code-highlight-tp4800337.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: Code highlight

Nicolai Hess
In reply to this post by Mark Rizun

2015-01-19 14:36 GMT+01:00 Mark Rizun <[hidden email]>:
Hi everyione,

When one selects piece of code in any code editor pane, every other same
piece is highlighted with less bright color.
I'm using spec to build a UI and would like to know which event is
responsible for this highlihts.

This is in TextMorphForEditView>>#selectionChanged.
Recognizing this change and searching/updating other selections are only
handled between the TextMorph and the Text Paragraph (Paragraph>>#displayExtraSelectionOn:)
I don't think Spec (or  the TextModel class) is aware of this property.
(The same for findAndReplace-search results).
 
For example, in TextModel there is one event that probably is related to my
problem, but I'm not sure: #whenReadSelectionIsChanged:
So, what I want is to use the event which is invoked when selection of code
is changed - probably it is the name of event :)

Mark



--
View this message in context: http://forum.world.st/Code-highlight-tp4800337.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: Code highlight

Mark Rizun
Ok, I see. That's not good, but thanks.
However, TextModel has selection as instance variable, so maybe I could implement event that I need?

2015-01-19 15:13 GMT+01:00 Nicolai Hess <[hidden email]>:

2015-01-19 14:36 GMT+01:00 Mark Rizun <[hidden email]>:
Hi everyione,

When one selects piece of code in any code editor pane, every other same
piece is highlighted with less bright color.
I'm using spec to build a UI and would like to know which event is
responsible for this highlihts.

This is in TextMorphForEditView>>#selectionChanged.
Recognizing this change and searching/updating other selections are only
handled between the TextMorph and the Text Paragraph (Paragraph>>#displayExtraSelectionOn:)
I don't think Spec (or  the TextModel class) is aware of this property.
(The same for findAndReplace-search results).
 
For example, in TextModel there is one event that probably is related to my
problem, but I'm not sure: #whenReadSelectionIsChanged:
So, what I want is to use the event which is invoked when selection of code
is changed - probably it is the name of event :)

Mark



--
View this message in context: http://forum.world.st/Code-highlight-tp4800337.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Reply | Threaded
Open this post in threaded view
|

Re: Code highlight

jfabry

I’m not sure that this is what you need, but have you tried changing the read selection block? ( TextModel>>readSelectionBlock: aBlock ) I would imagine that that is the block that is called when a selection is changed.

On Jan 19, 2015, at 15:20, Mark Rizun <[hidden email]> wrote:

Ok, I see. That's not good, but thanks.
However, TextModel has selection as instance variable, so maybe I could implement event that I need?

2015-01-19 15:13 GMT+01:00 Nicolai Hess <[hidden email]>:

2015-01-19 14:36 GMT+01:00 Mark Rizun <[hidden email]>:
Hi everyione,

When one selects piece of code in any code editor pane, every other same
piece is highlighted with less bright color.
I'm using spec to build a UI and would like to know which event is
responsible for this highlihts.

This is in TextMorphForEditView>>#selectionChanged.
Recognizing this change and searching/updating other selections are only
handled between the TextMorph and the Text Paragraph (Paragraph>>#displayExtraSelectionOn:)
I don't think Spec (or  the TextModel class) is aware of this property.
(The same for findAndReplace-search results).
 
For example, in TextModel there is one event that probably is related to my
problem, but I'm not sure: #whenReadSelectionIsChanged:
So, what I want is to use the event which is invoked when selection of code
is changed - probably it is the name of event :)

Mark



--
View this message in context: http://forum.world.st/Code-highlight-tp4800337.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.






---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD lab  -  Computer Science Department (DCC)  -  University of Chile

Reply | Threaded
Open this post in threaded view
|

Re: Code highlight

Mark Rizun
Just tried, nope it doesn't work :)

2015-01-19 15:51 GMT+01:00 Johan Fabry <[hidden email]>:

I’m not sure that this is what you need, but have you tried changing the read selection block? ( TextModel>>readSelectionBlock: aBlock ) I would imagine that that is the block that is called when a selection is changed.

On Jan 19, 2015, at 15:20, Mark Rizun <[hidden email]> wrote:

Ok, I see. That's not good, but thanks.
However, TextModel has selection as instance variable, so maybe I could implement event that I need?

2015-01-19 15:13 GMT+01:00 Nicolai Hess <[hidden email]>:

2015-01-19 14:36 GMT+01:00 Mark Rizun <[hidden email]>:
Hi everyione,

When one selects piece of code in any code editor pane, every other same
piece is highlighted with less bright color.
I'm using spec to build a UI and would like to know which event is
responsible for this highlihts.

This is in TextMorphForEditView>>#selectionChanged.
Recognizing this change and searching/updating other selections are only
handled between the TextMorph and the Text Paragraph (Paragraph>>#displayExtraSelectionOn:)
I don't think Spec (or  the TextModel class) is aware of this property.
(The same for findAndReplace-search results).
 
For example, in TextModel there is one event that probably is related to my
problem, but I'm not sure: #whenReadSelectionIsChanged:
So, what I want is to use the event which is invoked when selection of code
is changed - probably it is the name of event :)

Mark



--
View this message in context: http://forum.world.st/Code-highlight-tp4800337.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.






---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD lab  -  Computer Science Department (DCC)  -  University of Chile


Reply | Threaded
Open this post in threaded view
|

Re: Code highlight

jfabry

I had a quick look. I confirm that TextModel keeps a value holder on the current selection interval, in the instance variable named ‘selection', but apparently there is no API to register to notifications to that. I consider that a missing feature, so I think it is best that you add a bug report for that.

In the mean time, I’m sure you could hack something together that registers your application for notifications of the value holder that is in ‘selection’ ;-)

On Jan 19, 2015, at 16:03, Mark Rizun <[hidden email]> wrote:

Just tried, nope it doesn't work :)

2015-01-19 15:51 GMT+01:00 Johan Fabry <[hidden email]>:

I’m not sure that this is what you need, but have you tried changing the read selection block? ( TextModel>>readSelectionBlock: aBlock ) I would imagine that that is the block that is called when a selection is changed.

On Jan 19, 2015, at 15:20, Mark Rizun <[hidden email]> wrote:

Ok, I see. That's not good, but thanks.
However, TextModel has selection as instance variable, so maybe I could implement event that I need?



---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD lab  -  Computer Science Department (DCC)  -  University of Chile

Reply | Threaded
Open this post in threaded view
|

Re: Code highlight

Mark Rizun
I had a quick look. I confirm that TextModel keeps a value holder on the current selection interval, in the instance variable named ‘selection', but apparently there is no API to register to notifications to that. I consider that a missing feature, so I think it is best that you add a bug report for that.
Exactly! I think so too: it's just missing, and has to be fixed. I'll open an issue
Thanks
 
In the mean time, I’m sure you could hack something together that registers your application for notifications of the value holder that is in ‘selection’ ;-)
At least I can try to figure it out. 

Mark
Reply | Threaded
Open this post in threaded view
|

Re: Code highlight

Mark Rizun
I opened a case https://pharo.fogbugz.com/f/cases/14756/
Anywhay, anybody knows what this method #whenReadSelectionIsChanged: is responsible for?

2015-01-20 9:58 GMT+01:00 Mark Rizun <[hidden email]>:
I had a quick look. I confirm that TextModel keeps a value holder on the current selection interval, in the instance variable named ‘selection', but apparently there is no API to register to notifications to that. I consider that a missing feature, so I think it is best that you add a bug report for that.
Exactly! I think so too: it's just missing, and has to be fixed. I'll open an issue
Thanks
 
In the mean time, I’m sure you could hack something together that registers your application for notifications of the value holder that is in ‘selection’ ;-)
At least I can try to figure it out. 

Mark