Problem with PluggableButtonMorph?
arning at charm.net
Wed Jan 17 04:56:37 UTC 2001
On Tue, 16 Jan 2001 23:35:24 -0500 Kevin Fisher <kgf at golden.net> wrote:
>In my porting of my old Morphs to the new Alignment stuff, I noticed that my
>PluggableButtonMorphs started misbehaving. Here's a quick example:
>(PluggableButtonMorph new label: 'blah') openInWorld
>If you execute the above snipped pre-alignment-rewrite, you'll get a nice
>button sized properly around the label. If you execute it post-rewrite, the
>button is a small off-side rectangle and the label sticks out of the end.
>I compared the code pre- and post- rewrite and I don't see anything
>obvious...the AlignmentMorph in PluggableButtonMorph>>label: looks to my eyes
>to be okay (of course I'm still green with the new alignment code :).
>Is this a new bug, or new functionality? :)
Let's call it a feature. ;-) There was some slightly ambiguous behavior in the old AlignmentMorph that did not translate correctly across the revision. Try the code below and if it looks good, I'll feed it into the update stream.
'From Squeak2.9alpha of 17 July 2000 [latest update: #3274] on 16 January 2001 at 11:53:04 pm'!
!PluggableButtonMorph methodsFor: 'initialize-release' stamp: 'RAA 1/16/2001 23:51'!
self listDirection: #topToBottom.
self hResizing: #shrinkWrap.
self vResizing: #shrinkWrap.
self wrapCentering: #center; cellPositioning: #topCenter.
borderWidth _ 1.
model _ nil.
label _ nil.
getStateSelector _ nil.
actionSelector _ nil.
getLabelSelector _ nil.
getMenuSelector _ nil.
shortcutCharacter _ nil.
askBeforeChanging _ false.
triggerOnMouseDown _ false.
color _ Color lightGreen.
onColor _ color darker.
offColor _ color.
feedbackColor _ Color red.
showSelectionFeedback _ false.
allButtons _ nil.
self extent: 20 at 15.
More information about the Squeak-dev