[NEWBIE]More questions on PaintBoxMorph

Karl Ramberg karl.ramberg at chello.se
Sun Apr 23 21:23:56 UTC 2000


Hey,
I still reading and trying to understand stuff in both Smalltalk and
morph. This changeset is supposed to change the cursor into a
color picker but fails to evoke the world (?) or HandMorph fails to
update it self (?). The color picker draws once and then the
cursor becomes invisible. The code commented out is to change the
cursor back to normal but when commented out it will change the
cursor into a color picker and the default cursor (depending on where
the invisible cursor is at mouseUp.)

Anybody ?

Karl


'From Squeak2.8alpha of 19 February 2000 [latest update: #1972] on 23
April 2000 at 11:04:00 pm'!

!PaintBoxMorph methodsFor: 'actions' stamp: 'kfr 4/23/2000 23:02'!
eyedropper: aButton action: aSelector cursor: aCursor
 "Take total control and pick up a color!!!!"

 | pt feedbackColor |
 aButton state: #on.
 tool ifNotNil: [tool state: #off].
 currentCursor _ aCursor.
 self world hands first showTemporaryCursor: currentCursor
      hotSpotOffset: 0 at 0.

 feedbackColor _ Display colorAt: Sensor cursorPoint.
 self addMorphFront: colorMemory. "Full color picker"
 self world displayWorld.
  [Sensor anyButtonPressed] whileFalse: [
   pt _ Sensor cursorPoint.
   feedbackColor _ Display colorAt: pt.
   Display fill: colorPatch bounds
     fillColor: feedbackColor].
  Sensor waitNoButton.
" self world hands first showTemporaryCursor: nil
  hotSpotOffset: 0 at 0."
 self currentColor: feedbackColor.
 colorMemory delete.
 tool ifNotNil: [tool state: #on.
  currentCursor _ tool arguments at: 3].
 aButton state: #off.! !






More information about the Squeak-dev mailing list