[Cuis] Status of Morphic?

Phil (list) pbpublist at gmail.com
Mon Jul 6 03:01:56 CDT 2015


Hannes,

Sorry for the delay... it's taken me longer than expected to get back to
it.  I really don't have any simple examples of porting as my stuff is
fairly involved (i.e. drawing and keyboard handling as part of a larger
OpenGL project etc.)  However, I do have more specifics re: what needed
to be done.

On Tue, 2015-03-10 at 06:56 +0000, H. Hirzel wrote:
> Phil,
> 
> could you please provide an example code snippet (Morph class).
> 
> Version 4.0
> vs
> Version 4.2
> ?
> 
> On 3/10/15, H. Hirzel <hannes.hirzel at gmail.com> wrote:
> > Created https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/issues/48 for
> > this.
> >
> > On 3/9/15, Phil (list) <pbpublist at gmail.com> wrote:
> >> On Mon, 2015-03-09 at 05:54 -0400, Phil (list) wrote:
> >>> 1) Morph stepping appears to be non-functional (at least in terms of
> >>> running the code as-is from Cuis 4.0)
> >>
> >> Figured this one out... #step appears to be obsolete, use #stepAt:
> >> instead.  In some cases now need to override #wantsSteps to return true
> >> (the default implementation now always returns false.  This is an issue
> >> only for some of my animated morphs.)
> >>

Morphic (continuous) animation

previously:
#step

now:
#stepAt: (just rename #step to #stepAt: milliseconds)
#wantsSteps (^true)

Notes:
1) If this change isn't made, you may get what appears to be animation,
but it's just the morph redrawing after damage.
2) Be sure to call #truncate on bounds etc. if your code can't handle
floats.
3) I used to have several direct Morph subclasses, but it appears that
they now need to be RectangleLikeMorph subclasses to maintain similar
behavior.



Keyboard focus handling

previously:
#handlesKeyboard (^ true)
#keyboardFocusChange: (call any code needed to deal with getting/losing
focus such as drawing a focus indicator)
#handleKeystroke: (when morph has focus, will receive keystroke)

now:
This is my best guess... are there any examples of working Morphs that
deal with keyboard focus but do *not* have text morphs?
#handlesKeyboard (no change)
#handlesMouseOver: (^true to get #mouseEnter: & #mouseLeave:)
#mouseEnter: event
	event hand newKeyboardFocus: self
#mouseLeave: event
	event hand newKeyboardFocus: nil
#keyStroke: event (receives the keystroke when focused, some event
accessors no longer exist)

Thanks,
Phil





More information about the Cuis mailing list