[REBOL] Re: Simple VID window style
From: atruter:hih:au at: 18-Apr-2002 12:09
Note to self, a much cleaner way to implement this is:
<code>
display: func [title block /local win-title win-close win-layout] [
insert block [pad 24]
insert tail block compose [
at 0x0 win-title: bar-title white navy (title) bold
at 0x0 win-close: bar-close [unview]
]
win-layout: layout block
win-title/size/x: win-layout/size/x - 24
win-close/offset/x: win-title/size/x
view/options center-face win-layout [no-title]
]
display "Simple VID window style v2" [
title "Click & drag title bar"
label "Gotchas"
text 200 {
The title bar is inserted into a 24 deep gap at the top of the layout.
As such, any 'word that positions faces relative to the top of the layout
will need to be adjusted. Such words include 'origin, 'return, and 'at.
}
; Example of adjusted return
return
pad 24
title green "Column Two"
area 200
]
</code>
This avoids being dependent upon the current direction ('below or 'across)
and makes the title width calculation independent of the last face.
I also have a simple "tooltip" style working, holler if you're interested
and I'll post that too.
Regards,
Ashley