FlapTab positionning

Hilaire Fernandes hilaire at ext.cri74.org
Sun Dec 11 11:55:19 UTC 2005


I am wondering, positionning FlapTab seems to work only after the views
are openInDisplay.

For example the code bellow does not produce the expected result (a
FlapTab shifted to 100 pixels right):

---
|window flap flapTab button area|

window := SystemWindow labelled: 'My window'.
area := PasteUpMorph new.
area hResizing: #spaceFill; vResizing: #spaceFill.


button :=SimpleButtonMorph new
	target: Smalltalk;
	label: 'myButton';
	actionSelector: #beep.

flap := PasteUpMorph newSticky
	layoutPolicy: TableLayout new;
	listDirection: #leftToRight;
	layoutInset: 20;
	cellInset: 10;
	beFlap: true;
	addMorph: button; addMorph: button copy;
	extent: self currentWorld width @ 50.	
flapTab := FlapTab new referent: flap.
flapTab setName: 'POINT' edge: #top color: Color blue.
flapTab arrangeToPopOutOnDragOver: false;
	arrangeToPopOutOnMouseOver: true.
area addMorphFront: flapTab.

flapTab position: (area position + (100 at 0)).
window addMorph: area frame: (0 at 0 corner: 1 at 1).
window openInWorld.
---

The flapTab position does not seem to work in that case, or maybe it is
recomputed with default value at addMorph instruction?

To get the expected result, the last three lines need to be re-ordered as:

window addMorph: area frame: (0 at 0 corner: 1 at 1).
window openInWorld.
flapTab position: (area position + (100 at 0)).

However this is a bit annoying when dispatching flapTab and systemView
instanciation in different classes.

I am wondering why it is like that.

Hilaire



More information about the Squeak-dev mailing list