smart Window placement
This is an example of a way to save Window settings yet always display the whole window when the program opens.

sub OpenWindow()
local x
local y
x=150 : y=150
if (open(1,"/boot/home/config/settings/myprogram.settings"))then
line input #1 x$
line input #1 y$
close #1
if x<0 x=150
if y<0 y=150
if (x> peek("desktopwidth")-500) x=150
if y> (peek("desktopheight")-500) y=150
end if

window open x,y to x+500,y+500, "MainWindow", "myprogram"

// set up the Window

end sub

sub CloseWindow()

x= window get "MainWindow", "Position-X"
y= window get "MainWindow", "Position-y"
open #1,"/boot/home/config/settings/myprogram.settings","w"
print #1 str$(x)
print #1 str$(y)
close #1
window close "MainWindow"
end sub

Messages In This Thread
smart Window placement - by bbjimmy - 06-05-2015, 03:46 PM
RE: smart Window placement - by clasqm - 08-06-2015, 03:43 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)
Free Web Hosting