home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #6
/
amigamamagazinepolishissue1998.iso
/
coders
/
jËzyki_programowania
/
logo
/
powerlogo
/
libs
/
intuit
< prev
next >
Wrap
Text File
|
1993-01-25
|
3KB
|
167 lines
; intuit -- easy access to intuition info, especially windows
; Tony L Belding
if buriedp "intuitnames [ unbury :intuitnames ] [ ]
make "closescreens [
procedure [ ]
; close all Logo graphics screens
while [ not emptyp screenlist ] [
closescreen first screenlist
]
]
make "closewindows [
procedure [ ]
; close all Logo windows
while [ not emptyp windowlist ] [
closewindow first windowlist
]
]
make "screen-pens [
procedure [ [ :sc ] ]
; return number of colors/pens on a screen
op power 2 ( peek 1 :sc 189 )
]
make "screen-position [
procedure [ [ :sc ] ]
; return a list with the position of a given screen
op se ( peek 2 :sc 4 ) ( peek 2 :sc 5 )
]
make "position-screen [
procedure [ [ :sc :pos ] ]
; move a screen to a given position, takes position as a list
( intuition 1 :sc first :pos item 2 :pos )
]
make "screen-size [
procedure [ [ :sc ] ]
; return a list with the horizontal and vertical size of a screen
op se ( peek 2 :sc 6 ) ( peek 2 :sc 7 )
]
make "screen-wlist [
procedure [ [ :sc ] [ ] [ :firstw ] ]
; returns a list of windows open on a given screen
if not memberp :sc screenlist [ stop ] [ ]
make "firstw word "@ ( peek 4 :sc 1 )
if = "@0 :firstw [
op [ ]
] [
op se :firstw digwlst :firstw
]
]
make "digwlst [
procedure [ [ :wi ] [ ] [ :nextw ] ]
make "nextw word "@ peek 4 :wi
if = "@0 :nextw [
op [ ]
] [
op se :nextw digwlst :nextw
]
]
make "window-position [
procedure [ [ :wi ] ]
; return the [ x y ] position of a given window
op se ( peek 2 :wi 2 ) ( peek 2 :wi 3 )
]
make "position-window [
procedure [ [ :wi :pos ] ]
; move a window to a given [ x y ] position
( intuition 2 :wi first :pos item 2 :pos )
]
make "center-window [
procedure [ [ :wi ] [ ] [ :parsiz :windsiz ] ]
; it do what it say
make "parsiz screen-size window-parent :wi
make "windsiz window-size :wi
position-window :wi se ( / - first :parsiz first :windsiz 2 )
( / - last :parsiz last :windsiz 2 )
]
make "window-size [
procedure [ [ :wi ] ]
; return the [ x y ] size of a given window
op se ( peek 2 :wi 4 ) ( peek 2 :wi 5 )
]
make "size-window [
procedure [ [ :wi :size ] ]
; resize a window to [ x y ] dimensions
( intuition 8 :wi first :size item 2 :size )
]
make "window-parent [
procedure [ [ :wi ] ]
; return a pointer to the screen a window is open on
op firstput "@ ( peek 4 :wi 11.5 )
]
make "fronts [
procedure [ [ :sc ] ]
; move a screen to the front
intuition 6 :sc
]
make "backs [
procedure [ [ :sc ] ]
; move a screen to the back
intuition 5 :sc
]
make "frontw [
procedure [ [ :wi ] ]
; move a window to the front
intuition 11 :wi
]
make "backw [
procedure [ [ :wi ] ]
; move a window to the back
intuition 10 :wi
]
make "clearw [
procedure [ [ :wi ] [ ] [ :turt ] ]
; clear graphics from a given window
make "turt openturtle :wi
( clean :turt )
closeturtle :turt
]
make "intuit [ procedure [ ] ]
make "intuitnames [ intuitnames closescreens closewindows screen-pens
screen-position position-screen digwlst screen-size screen-wlist
window-position position-window window-size size-window
window-parent fronts backs frontw backw clearw intuit ]
bury :intuitnames
; end of listing