Re: Restore a Window

new topic     » goto parent     » topic index » view thread      » older message » newer message
dcole said...

Is there an easier way of doing this?

No. Think about it ... restore to what? The system doesn't know which size is your application's default size for each window so that means you have to record what that size is. And thus its up to you to restore it back if its been changed.

However, you could make it a bit easier with these routines ...

procedure SetDefaultSize(integer win) 
    setUserProperty(win, "DefaultSize", getRect(win)) 
end procedure 
 
procedure RestoreDefaultSize(win) 
    sequence ds 
 
    ds = getUserProperty(win,"DefaultSize") 
    if length(ds) != 0 then 
       ds = ds[1] 
       setRect(win, ds[1],ds[2], ds[3]-ds[1], ds[4]-ds[2],1)}--restore to 'default' 
    end if 
 
end procedure 
 
-- Now use it like this ... 
SetDefaultSize(Window1) 
 
setRect(Window1.10,10,1100,1100,1}--change  the size of the window here with setRect() 
 
RestoreDefaultSize(Window1) 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu