On Tue, Jan 30, 2018 at 9:50 AM, Esteban Lorenzano <esteba...@gmail.com>
wrote:

>
>
> > On 30 Jan 2018, at 09:46, K K Subbu <kksubbu...@gmail.com> wrote:
> >
> > On Tuesday 30 January 2018 01:06 PM, Norbert Hartl wrote:
> >> Am 30.01.2018 um 08:26 schrieb "p...@highoctane.be <mailto:
> p...@highoctane.be>" <p...@highoctane.be <mailto:p...@highoctane.be>>:
> >>> On Tue, Jan 30, 2018 at 12:12 AM, Torsten Bergmann <asta...@gmx.de
> <mailto:asta...@gmx.de>> wrote:
> >>>
> >>>
> >>> Cursor>>beCursor with Cursor being a Form makes a lot of sense on any
> platform.
> >>>
> >> Sorry but Cursor>>beCursor does not make any sense on any platform :P
> > Could you be more explicit?
> >
> > If beDisplay makes sense for DisplayScreen why not beCursor for Cursor?
> While a Cursor can be emulated in an image, it would be more efficient to
> use the cursor support present in practically all graphics controllers
> these days.
>

There is no such thing at the moment in Pharo (maybe OSWindow is different).

* Windows cursor is not reflected in the system, it is a black little arrow
by default.
* macOS cursor is not reflected either. I can set it as large as I want it
doesn't agrees to.
 * Linux. Black thing and changing to a larger form makes Pharo crash.

beCursor makes sense when used like this:

setMoveCursor

|form cursor|
form := (Form
extent: 23@23
depth: 32
fromArray: #( 0 0 0 0 0 0 0 0 0 0 922945050 3171091994 922945050 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 922945050 3171091994 4293256936 3171091994
922945050 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 922945050 3171091994 4293256936
4294967295 4293191143 3171091994 922945050 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
922945050 3171091994 4293256936 4294967295 4294901502 4294901502 4293190886
3171091994 922945050 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3171091994 4293256936
4294967295 4294901502 4294901502 4294835709 4294769916 4293125093
3171091994 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3171091994 4278388250 4278388250
3171091994 4294835709 3171091994 4278388250 4278388250 3171091994 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 3171091994 4294769916 3171091994 0 0 0 0 0 0 0 0 0
0 0 0 0 922945050 3171091994 3171091994 0 0 0 0 3171091994 4294769916
3171091994 0 0 0 0 3171091994 3171091994 922945050 0 0 0 0 0 922945050
3171091994 4293256936 4278388250 0 0 0 0 3171091994 4294704123 3171091994 0
0 0 0 4278388250 4292664799 3171091994 922945050 0 0 0 922945050 3171091994
4293256936 4294967295 4278388250 0 0 0 0 3171091994 4294638330 3171091994 0
0 0 0 4278388250 4294243572 4292532956 3171091994 922945050 0 922945050
3171091994 4293256936 4294967295 4294901502 3171091994 3171091994
3171091994 3171091994 3171091994 3171091994 4294572537 3171091994
3171091994 3171091994 3171091994 3171091994 3171091994 4294111986
4294046193 4292401370 3171091994 922945050 3171091994 4293256936 4294967295
4294901502 4294901502 4294835709 4294769916 4294769916 4294704123
4294638330 4294572537 4294506744 4294440951 4294375158 4294375158
4294309365 4294243572 4294111986 4294046193 4293980400 4293914607
4292269784 3171091994 922945050 3171091994 4293191143 4294901502 4294835709
3171091994 3171091994 3171091994 3171091994 3171091994 3171091994
4294440951 3171091994 3171091994 3171091994 3171091994 3171091994
3171091994 4293980400 4293914607 4292269784 3171091994 922945050 0
922945050 3171091994 4293190886 4294769916 4278388250 0 0 0 0 3171091994
4294375158 3171091994 0 0 0 0 4278388250 4293914607 4292269784 3171091994
922945050 0 0 0 922945050 3171091994 4293125093 4278388250 0 0 0 0
3171091994 4294375158 3171091994 0 0 0 0 4278388250 4292269784 3171091994
922945050 0 0 0 0 0 922945050 3171091994 3171091994 0 0 0 0 3171091994
4294309365 3171091994 0 0 0 0 3171091994 3171091994 922945050 0 0 0 0 0 0 0
0 0 0 0 0 0 3171091994 4294243572 3171091994 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 3171091994 4278388250 4278388250 3171091994 4294111986 3171091994
4278388250 4278388250 3171091994 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3171091994
4292664799 4294243572 4294111986 4294046193 4293980400 4293914607
4292269784 3171091994 0 0 0 0 0 0 0 0 0 0 0 0 0 0 922945050 3171091994
4292532956 4294046193 4293980400 4293914607 4292269784 3171091994 922945050
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 922945050 3171091994 4292401370 4293914607
4292269784 3171091994 922945050 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 922945050
3171091994 4292269784 3171091994 922945050 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 922945050 3171091994 922945050 0 0 0 0 0 0 0 0 0 0)
offset: 0@0).
form := form magnifyBy: VistaCursorSettings cursorScaleFactor.
cursor := Cursor extent: form extent depth: 32.
cursor offset: (form width // 2) negated @ (form height // 2) negated.
cursor bits: form bits.
Cursor classPool at: #MoveCursor put: cursor.
cursor beCursor

And we could load that thing from a PNG or a web resource etc.
Until beCursor is not sent, the Cursor is not really *the* hand cursor.

I actually like the beXXX way. It makes a lot of code clearer, especially
when cascading options for a given object.

We used to have the ability to have several "hands" active at once in an
image (actually I miss that).
I guess that for such scenarios, a system cursor is not going to be of much
use.

But I want to have the ability to reflect the system cursor in Pharo so
that it doesn't look too alien or "ugly" when it comes to cursors.


> I guess because a cursor and a display are already cursors and displays
> (hence the “be” does not has sense), when what you are trying to do is
> actually to “install” them or “use” them, or “activating” them :)
>

Nah they are not. Installing would be a shortcut for  e.g. Cursor classPool
at: #MoveCursor put: cursor.

activate? Well, there is already

showWaitCursorWhile: aBlock
Cursor wait showWhile: aBlock

So that we can do UIManager default showWaitCursorWhile: [ 10 seconds wait ]

doing

Cursor wait showWhile: aBlock

Then we get

Cursor wait showWhile: aBlock

So that is not activate nor anything.

And we can also need to use something from the hand.

ActiveHand showTemporaryCursor: Cursor resizeBottom.

There are quite several use cases beyond "activating" a cursor.


Phil


>
> Esteban
>
> >
> > TIA .. Subbu
> >
>
>
>
>

Reply via email to