[Prev][Next][Index][Thread]

Re: DUIM question



On Thu, 22 Jun 2000 11:15:02  
 johncwhi wrote:
>Cool.  Thanks.  That should do the trick.  I didn't know about
><table-layout>.
>
>Another ignorant question about DUIM:
>I tried calling contain( make( <my-pane>)) in the playground with the
>pane defined below, but it
>didn't do what I expected--make a label and show it.  I'm guessing it
>has something to do with display functions and setting up ports, etc.  I
>get lost trying to follow it all.  Would I need to define a frame for
>it?  I was trying to get to the point where I could experiment with
>changing the font/size/style in the label.  Is that possible?
>
>
>define pane <my-pane> ( )
>   pane the-text (pane)
>    make( <label> , label: "hello" );
>   pane the-layout (pane)
>    make( <fixed-layout> , children: pane.the-text );
>end pane;
>

You need to provide a layout clause, something like the
following should do:

define pane <my-pane> ()
  pane the-text (pane)
    make(<label>, label: "hello");
  layout (pane) 
    vertically () pane.the-text end;
end pane <my-pane>;

But, you can just contain the label directly too:

  contain(make(<label>, label: "hello"));

All that 'contain' does is to create a frame to wrap up whatever
DUIM object you pass, and then calls start-frame on that frame. It
is a great tool for experimentation. Note that it even works with
menus, toolbars etc.:

  contain(make(<menu-box>, items: #["Red", "Green", "Blue"]));

  contain(make(<progress-bar>, 
               value-range: range(from: 0, to: 100),
               value: 33));

Hope this helps,

Andy

---
Andy Armstrong
andrewa@functionalobjects.com



Send FREE Greetings for Father's Day--or any day!
Click here: http://www.whowhere.lycos.com/redirects/fathers_day.rdct