<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <font face="Georgia">The comment in Cursor class
      extent:fromArray:offset: tells it all:<br>
      <br>
      "NOTE: This has been kluged to take an array of 16-bit constants,<br>
          and shift them over so they are left-justified in a 32-bit
      bitmap"<br>
      <br>
      When any Form needs less than 32 bits per row (or less tham 32
      bits from the last word in a row), it uses the most significant
      bits. Cursor was modified to fill the upper 16 bits of each word
      in the bitmap with the required data without requiring the user to
      shift as you did in your final example. Without that, you would
      need to do something like:<br>
      <br>
      (Cursor<br>
          extent: 16@16<br>
          depth: 1<br>
          fromArray: #( 4294901760 134152192 2029977600 2134835200
      2145320960 2146369536 2146893824 2146893824 2147155968 2147155968
      2147155968 2147287040 2147287040 2147287040 2147287040 65536)<br>
          offset: 0@0)<br>
      <br>
      (this being a storeString of your final Form example). This takes
      more space textually, requires some LargeIntegers and is harder to
      parse by eyeball (I can tell the Cursor start with a black row
      from 65535, but </font><font face="Georgia">4294901760 leave me
      reaching for a workspace).</font><br>
    <font face="Georgia"><br>
      Cheers,<br>
      Bob<br>
      <br>
    </font>
    <div class="moz-cite-prefix">On 8/18/12 4:41 PM, JohnReed Maffeo
      wrote:<br>
    </div>
    <blockquote cite="mid:20120818204155.290570@gmx.com" type="cite">
      <pre wrap="">Cursor is a subclass of Form but their extent:fromArray:offset methods produce significantly different results.

In a workspace, I inspect two instances

Cursor extent: 16@16 fromArray: #(65535 2047 30975 32575 32735 32751 32759 32759 32763 32763 32763 32765 32765 32765 32765 1) offset: 0@0

Form extent: 16@16 fromArray: #(65535 2047 30975 32575 32735 32751 32759 32759 32763 32763 32763 32765 32765 32765 32765 1) offset: 0@0

In the inspector browser in each, I do "self displayOn: Display"

The cursor instance displays an Arc icon in the upper left hand corner of the Display.
The cursor instance displays a white box icon in the upper left hand corner of the Display.

The difference appears to be the fact the the Cursor method applies a bitShift: 16 to the elements of the input array.

I have observed these results in the Squeak4.2-10966 and the minimal-MVC (nee Squeak3.8.18beta3u ?).

It seems to violate the principle of least astonishment. Is it a bug, a feature or an interesting artifact?

This was discovered while I was doing some work trying to port and old Smalltalk-80 graphics application as part of my self study process.

I can get the results I am looking for by doing this:

Form extent: 16@16
 fromArray:  (#(65535 2047 30975 32575 32735 32751 32759 32759 32763 32763 32763 32765 32765 32765 32765 1)
collect: [ :each | each bitShift: 16]) offset: 0@0

Regards,

John-Reed


</pre>
    </blockquote>
    <br>
  </body>
</html>