gui differences in 3.9g-7056

Gary Chambers gazzaguru at btinternet.com
Sat Sep 9 08:55:10 UTC 2006


Try these:

In MCTool

buildWith: builder
	|  windowBuilder |

	windowBuilder := MCToolWindowBuilder builder: builder tool: self.
	self widgetSpecs do:
		[:spec | | send fractions offsets |
		send := spec first.
		fractions := spec at: 2 ifAbsent: [#(0 0 1 1)].
		offsets := spec at: 3 ifAbsent: [#(0 0 0 0)].
		windowBuilder frame: (LayoutFrame
			fractions: (fractions first @ fractions second corner: fractions third @
fractions fourth)
			offsets: (offsets first @ offsets second corner: offsets third @ offsets
fourth)).
		windowBuilder perform: send first withArguments: send allButFirst].

	^ windowBuilder build

In MorphicToolBuilder

setFrame: aRectangle in: widget
	| frame |
	aRectangle ifNil:[^nil].
	frame := aRectangle isRectangle
		ifTrue: [self asFrame: aRectangle]
		ifFalse: [aRectangle].
	widget layoutFrame: frame.
	widget hResizing: #spaceFill; vResizing: #spaceFill.
	(parent isSystemWindow) ifTrue:[
		widget borderWidth: 2; borderColor: #inset.
	].

Of course, there are some other fixes that are useful with respect to pane
splitters. Too many to show here.
These changes are part of a raft of look enhancements and, if there is
interest, could be made available to the community!

> -----Original Message-----
> From: squeak-dev-bounces at lists.squeakfoundation.org
> [mailto:squeak-dev-bounces at lists.squeakfoundation.org]On Behalf Of Bakki
> Kudva
> Sent: 08 September 2006 7:52 PM
> To: The general-purpose Squeak developers list
> Subject: Re: gui differences in 3.9g-7056
>
>
> On 9/8/06, Bert Freudenberg <bert at freudenbergs.de> wrote:
> > You would have to fix, or maybe even extend, ToolBuilder itself. I think
> > currently its layout does not support fixed sizes for selected
> components.
> >
> > - Bert -
>
> It works fine in the 3.8 image. What would cause it to behave
> differently under 3.9?
>
> I think the ToolBuilder layout code is in:
> MorphicToolBuilder>>setLayout: layout in: widget
> 	layout == #proportional ifTrue:[
> 		widget layoutPolicy: ProportionalLayout new.
> 		^self].
> 	layout == #horizontal ifTrue:[
> 		widget layoutPolicy: TableLayout new.
> 		widget listDirection: #leftToRight.
> 		widget submorphsDo:[:m| m hResizing: #spaceFill;
> vResizing: #spaceFill].
> 		"and then some..."
> 		^self].
> 	layout == #vertical ifTrue:[
> 		widget layoutPolicy: TableLayout new.
> 		widget listDirection: #topToBottom.
> 		widget submorphsDo:[:m| m hResizing: #spaceFill;
> vResizing: #spaceFill].
> 		"and then some..."
> 		^self].
> 	^self error: 'Unknown layout: ', layout.
>
> Not sure where Monticello sets the layout policy. It appears to me
> that the policy used is proportional which is why the buttons stretch.
> If someone who knows this stuff can explain this better I'd really
> appreciate it. Thanks,
>
> bakki
>




More information about the Squeak-dev mailing list