Window Frames for system windows

Bob Arning arning at charm.net
Sun Jul 23 15:11:45 UTC 2000


Hi Jim,

On Sat, 22 Jul 2000 22:11:46 -0700 "Jim Benson" <jb at speed.net> wrote:
>I've thought about this for a couple of days, but I have not been able to
>come up with what a general purpose solution should do. As is usually the
>case, I keep running into the dichotomy of Squeak. It's big and it's small,
>with no real target machine. Maybe it has a big display, maybe it has a
>small display, or no display at all (though we can probably have pretty
>small minimumExtents on that one :) . So, when you set the minimumExtent to
>some value, it depends on what type of platform you're running on to
>determine what a reasonable default should be.

I was thinking of minimum extent more along the lines of "How many pixels does the thing need in order to draw all its components without error?" This would imply that scroll panes would have enough height to draw their scroll bars and buttons would have enough room to draw their labels. A #smallestComfortableSize would likely be somewhat larger and much more subjective (how many lines do you like in lists and text panes in your browser?).

>There are other examples of this strewn throughout the system. Minimum
>extent of system tools is one, default font size is another nasty one.
>
>There is a major difference between things like 100 at 80 extents for browsers
>on a PDA vs. a 1600 at 1200 PC/workstation display. On a 1600 at 1200 display on a
>21" monitor, working the menus is a real challenge due to the small font
>size, and you pretty much have to have magnifying glasses on to look at the
>default text sizes for any length of time. Yet on a 640 at 480 screen, it looks
>huge. Going forward, I would hope we have much larger displays with much
>higher resolution. Just adjusting your preferences would become a major
>challenge on higher resolution displays.

I have not had the pleasure of using any system that handled that truly well, so I don't fault Squeak too badly if we can't fix it this weekend. ;-)

>Another problem with the minimumExtent for SystemWindows is that all of the
>panes in some of the common windows do not honor the bounds of the
>SystemWindow. For example, look at a default PackageBrowser instantiated
>from a 'browse code' menu command in the file list, when the Preferences is
>set for inbound scrollbars. 

I'm not clear why the small panes at the top and bottom have scroll bars in the first place. This may be partly a design problem with this tool.

>When an Explorer is sized to 200 at 200, the
>scrollbar overhangs the window frame. It seems to me that there has to be a
>minimum size in pixels that a pane must honor when being resized, or else
>the whole thing becomes a mess real quick.

I agree, see attached code at the end.

>To experienced Squeakers, that's not a *real* big deal because you can set
>all of your preferred font sizes and preferences just once, then save them
>to an external file using sophisticated Lex Spoon approved Squeak code.
>These external files may be later filed into other images to setup "your"
>preferred Preferences.
>
>To the neophyte, however, to say that it's a challenge to set the font sizes
>is a major understatement. And there are only three default fonts ( if you
>count Comic Plain and Comic Bold as two fonts <grin> ) !!! Imagine if Squeak
>became like a modern application and had a reasonable number fonts!!! My
>guess is that you lose a lot of these folks right from the get go when they
>try to figure out how to change things in the appearance or preferences
>area. It's way too hard for what it does.

While making Squeak more friendly to neophytes is important, I'm not sure how many you are losing at the moment. Squeak, as distributed from UIUC, isn't really an attractive or seductive package for neophytes - how would they even know to go there in the first place? I think that a large influx of neophytes (and I'm talking about several orders of magnitude over the current community size) will only happen when more attractive packages are built by those who understand how to tweak all those little details and offer a much simpler set of choices. I would also be willing to bet that SystemWindows will not be a part of that package.

>MinimumExtent is tricky. For example, when I bring up a browser on my rig, I
>resize it to a workable size. Every stinking time I have to browse
>something.

Maybe a simple first step would be a poll:

1. What are your current display settings?
2. What size would you like various flavors of system windows to be in that environment?

There may be a minor tweak that moves us in a more agreeable direction.

>So then I started thinking things like "Well, how about if you had
>preferences for things like minimumExtent that they were calculated based on
>the current screen resolution and the extent of the native OS window that
>Squeak was running in?" 

Well, you do have some of that now in the RealEstateManager. Certainly it could be improved, but it does take the size of the world into account when sizing windows.

>Same thing with fonts on system startup. Then I just
>keep running back to the same questions, "How do I make Squeak act like a
>window manager without writing an entire window manager?" and "Preferences
>are not my friend, yet I keep wanting to add more?" Usually by then I get
>hopelessly confused, and lose interest.

Nah. ;-)

Cheers,
Bob

===== code follows =====
'From Squeak2.9alpha of 17 July 2000 [latest update: #2461] on 23 July 2000 at 10:41:39 am'!
"Change Set:		minExtent
Date:			23 July 2000
Author:			Bob Arning

Try to set a minimum extent for SystemWindows based on the #minimumUsefulExtent of each pane along with that pane's fraction of the final window"!


!Morph methodsFor: 'as yet unclassified' stamp: 'RAA 7/23/2000 10:32'!
minimumUsefulExtent

	^self extent! !


!AlignmentMorph methodsFor: 'as yet unclassified' stamp: 'RAA 7/23/2000 10:25'!
minimumUsefulExtent

	^self minWidth at self minHeight! !


!ScrollPane methodsFor: 'as yet unclassified' stamp: 'RAA 7/23/2000 10:34'!
minimumUsefulExtent

	^40 at 45! !


!SystemWindow methodsFor: 'geometry' stamp: 'RAA 7/23/2000 10:27'!
extent: newExtent 
	| inner labelRect |
	isCollapsed
		ifTrue: [super extent: newExtent x @ (self labelHeight + 2)]
		ifFalse: [super extent: (newExtent max: self minimumExtentBasedOnPanes)].
	inner _ self innerBounds.
	labelRect _ self labelRect.
	stripes first bounds: (labelRect insetBy: 1).
	stripes second bounds: (labelRect insetBy: 3).
	self setStripeColorsFrom: self paneColorToUse.
	closeBox ifNotNil: [closeBox align: closeBox topLeft with: inner topLeft + (4 @ 1)].
	menuBox ifNotNil: [menuBox align: menuBox topLeft with: inner topLeft + (19 @ 1)].
	collapseBox align: collapseBox topRight with: inner topRight - (4 @ -1).
	label fitContents; setWidth: (label width min: bounds width - self labelWidgetAllowance).
	label align: label bounds topCenter with: inner topCenter.
	isCollapsed
		ifTrue: [collapsedFrame _ self bounds]
		ifFalse: [self setBoundsOfPaneMorphs. fullFrame _ self bounds]! !

!SystemWindow methodsFor: 'geometry' stamp: 'RAA 7/23/2000 10:37'!
minimumExtentBasedOnPanes

	| minExtent |

	minExtent _ 0 at 0.
	paneMorphs with: paneRects do: [:m :frame |
		minExtent _ minExtent max: m minimumUsefulExtent / frame extent
	].
	^(minExtent + (1 at 1) + (0 @ self labelHeight)) truncated! !





More information about the Squeak-dev mailing list