Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!europa.chnt.gtegsc.com!library.ucla.edu!unixg.ubc.ca!news.bc.net!torn!fonorola!news!dbuck
From: dbuck@infoweb.magi.com (David Buck)
Subject: Re: Keeping control sizes constant
Sender: news@magi.com
Message-ID: <DAvwJK.oq@magi.com>
Date: Wed, 28 Jun 1995 13:09:20 GMT
References: <3snjn0$h42@acad1.tp.ac.sg>
Nntp-Posting-Host: infoweb.magi.com
Organization: Magi Data Consulting
Lines: 35

In article <3snjn0$h42@acad1.tp.ac.sg>,
Douglas Finnigan  <douglas@tp.ac.sg> wrote:
>Hello,
>
>In ST/V for Windows 3.01, subpane size is relative to parent pane
>size ie. if a top window size is changed, all the control sizes
>change relative to the window size.
>
>How do I stop this? I know it's done in the PARTS Workbench, but
>I can't figure out how to do this for my own applications.
>
>Can someone please help?
>
>Thanks,
>Douglas

Are you using any sort of window layout tool to help you create your 
windows (eg. WindowBuilder)?  If so, the tool probably has provisions in 
it for controlling this.  If not, you have code that probably calls 
framingRatio: with some rectangle.  Instead, you should call 
framingBlock: with a block that takes a rectangle as a parameter and 
returns a rectangle.

Eg,
   mySubpane framingBlock: [:rect |
      rect corner: (rect corner - (0@10))]

Of course, when writing portable windows code for ST/V, you shouldn't use 
point arithmetic like I've done above.  You should use the proper methods 
(rightAndUpBy: and the like).

David Buck
dbuck@magi.com
The Object People

