Style facet + How to add a check to a layout
[1/5] from: arolls:idatam:au at: 20-Nov-2001 19:47
Interesting, I noticed this:
>> c: make get-style 'check []
>> c/style
== BUTTON
>> layout [c: check]
>> c/style
== check
Obviously check is derived from a button,
which you can also see in the vid source
somewhere.
How to add a check to a layout:
>> lay: layout [button "pane/1"]
>> view lay
Ok fine. Close the window.
>> append lay/pane make get-style 'check []
== [
make object! [
type: 'face
offset: 20x20
size: 100x24
span: none
pane: none
...
>> view lay
** Script Error: find expected series argument of type: series port bitset
** Where: view
** Near: all [pos: find face/effect 'cross remove pos]
if face/data [insert face/effect 'cross]
Oh no! Find is expecting the effect facet to be a block (which is a series).
Ok, we just add an effect block to it, then.
>> unview
>> lay/pane/2: make get-style 'check [effect: []]
== [
make object! [
type: 'face
offset: 20x20
size: 100x24
span: none
pane: none
...
>> view lay
Anton.
[2/5] from: brett:codeconscious at: 20-Nov-2001 20:16
> Obviously check is derived from a button,
> which you can also see in the vid source
> somewhere.
Just as a curio I've got a little proggie that shows the derivations in the
form of a tree. In View:
do http://www.codeconscious.com/rebsite/vid-ancestry.r
> How to add a check to a layout:
Interesting thanks.
Brett.
[3/5] from: dockimbel:free at: 20-Nov-2001 12:56
Hi Anton,
There's an easier and cleaner way to do it :
>> lay: layout [button "pane/1"]
>> append lay/pane make-face 'check
>> view lay
Make-face will take care of all VID specific stuff for you.
-DocKimbel
Anton Rolls wrote:
[...]
[4/5] from: arolls::idatam::com::au at: 21-Nov-2001 13:54
Ah, nice. Less code. I really should go
read through the dictionary again. :)
Anton.
[5/5] from: arolls:idatam:au at: 21-Nov-2001 13:52
That's pretty cool. :)
Anton.