making a window of fixed size

Martín Altobello martin_altobello at yahoo.com.ar
Wed Feb 20 00:23:50 UTC 2002


Hi there:

(your SistemWindow instance) allowReframeHandles: false.

should keep your SystemWindow from being resized. You'll still have to deal
with the "expandBoxHit" button to avoid the user from maximizing your window
to full screen. For that, you can try overriding as follow:

in... SystemWindow subclass: #Yourclass

(add this instance method)

expandBoxHit
 "The full screen expand box has been hit"

 isCollapsed
  ifTrue: [self hide.
   self collapseOrExpand.
   self unexpandedFrame ifNil: [ self unexpandedFrame: fullFrame. ].
"   self fullScreen."
   expandBox setBalloonText: 'contract to original size'.
   ^ self show].
 self unexpandedFrame
  ifNil: [self unexpandedFrame: fullFrame.
"   self fullScreen."
   expandBox setBalloonText: 'contract to original size']
  ifNotNil: [self bounds: self unexpandedFrame.
   self unexpandedFrame: nil.
   expandBox setBalloonText: 'expand to full screen' ]


By "quoting" those lines of codes you are preventing your SystemWindow from
maximizing to full screen, but it will still restore to the size you've
specified if it's minimized.

I don't know if that's the best way to deal with it... but's how we dealt
with it.

Best regards,

Martín



----- Original Message -----
From: "Craig Latta" <Craig.Latta at NetJam.ORG>
To: <squeak-dev at lists.squeakfoundation.org>
Sent: Tuesday, February 19, 2002 9:01 PM
Subject: making a window of fixed size


>
> Hi--
>
> Well, there are just too many layout bugs to bother with resizeable
> windows in my application. I'd like to make my windows of fixed size. It
> seems one does that via SystemWindow>>maxiumumExtent: (which has no
> senders :) and Morph>>minimumExtent:. It doesn't work, though;
> SystemWindows to which these messages have been sent happily resize to
> arbitrarily large sizes.
>
> How should I do this and how could I have learned about it?
>
>
> thanks!
>
> -C
>
> --
> Craig Latta
> composer and computer scientist
> craig.latta at netjam.org
> www.netjam.org
> crl at watson.ibm.com
> Smalltalkers do: [:it | All with: Class, (And love: it)]
>




More information about the Squeak-dev mailing list