Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: How to make a layout from a block

From: brett:codeconscious at: 19-Apr-2002 13:16

Hi Thorsten,
> I have extended the code with like this: > > add-seat: func [] [append main/pane make-face 'seat show main] > a: [style seat box 6x6 green title "Test" backcolor silver button "Add
Seat"
> [add-seat]] > main: layout a > view main
The problem with your code is that make-face is expecting a style name defined in the master stylesheet. You can specify a different style sheet using the /STYLES refinement. So here is some amended code: stylize/master [seat: box 6x6 green] add-seat: func [] [ append main/pane make-face 'seat show main ] a: [ title "Test" backcolor silver button "Add Seat" [add-seat] ] main: layout a view main Your next issue will be to position the newly made seat face. You will need to do this by changing the OFFSET of the face you just created or by using the /SPEC refinement of make-face like this: stylize/master [seat: box 6x6 green] add-seat: func [] [ append main/pane make-face/spec 'seat [offset: 25x5] show main ] a: [ title "Test" backcolor silver button "Add Seat" [add-seat] ] main: layout a view main Regards, Brett.