Path: news.daimi.aau.dk!not-for-mail From: henryml@daimi.aau.dk (Michael Lassen) Newsgroups: comp.lang.beta Subject: Re: GUIenv Date: Sun, 12 Apr 1998 15:45:36 +0200 (MET DST) Organization: DAIMI, Computer Science Dept. at Aarhus University Lines: 86 Approved: mailtonews@daimi.aau.dk Distribution: world Message-ID: <199804121345.PAA20560@noatun.mjolner.dk> Reply-To: henryml@daimi.aau.dk (Michael Lassen) NNTP-Posting-Host: daimi.daimi.aau.dk Xref: news.daimi.aau.dk comp.lang.beta:11519 At 7:27 12/04/98, Sascha Kimmel wrote: >Hello! > >Is there any possibility to get the current screen resolution when using the >GUIenv fragment? If you want to know how many pixels are available, you can use myRectangle: @rectangle; screenWidthInPixels, screenHeightInPixels: @integer; do system.screenRectangle -> myRectangle; myRectangle.size -> (screenWidthInPixels, screenHeightInPixels); >And how can you center a window on the screen? I use the following code to center a window on the screen: ORIGIN '~beta/guienv/v1.6/guienv'; -- windowLib: attributes -- centerAsDialog: (# screen: @rectangle; width, height: @integer; screenWidth, screenHeight: @integer; left, top: @integer; do size -> (width, height); system.screenRectangle -> screen; screen.size -> (screenWidth, screenHeight); screen.left + ((screenWidth - width) div 2) -> left; screen.top + (screenHeight div 5) -> top; (left, top) -> position; #); This code will center the window horizontally and leave 1/5 of screen space above the window. If you want to center the window vertically as well: ORIGIN '~beta/guienv/v1.6/guienv'; -- windowLib: attributes -- center: (# screen: @rectangle; width, height: @integer; screenWidth, screenHeight: @integer; left, top: @integer; do size -> (width, height); system.screenRectangle -> screen; screen.size -> (screenWidth, screenHeight); screen.left + ((screenWidth - width) div 2) -> left; screen.top + ((screenHeight - height) div 2) -> top; (left, top) -> position; #); > >Is there a function available which converts integer-values into strings and >vice versa? Yes: Convert from integer to text: myInteger: @integer; myText: @text; do myInteger -> myText.putInt; Convert from text to integer: myInteger: @integer; myText: @text; do myText.asInt -> myInteger; or myInteger: @integer; myText: @text; do myText.reset; myText.getInt -> myInteger; -- Michael