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

Re: DUIM: define frame q?





Jason Trenouth wrote:
> 
> On Mon, 06 Dec 1999 16:31:56 -0700, in comp.lang.dylan you wrote:
> 
> Its now just a matter of connecting the dots:
> 
>         (.) you want to give the options as keyword arguments
>             when making the frame
> 
>         (.) you want to use that information to build the table control
> 
>         (.) you have access to the frame object when building the table
>             control

It's the last one that got me. I was trying:

define frame <template-frame> (<simple-frame>)
  slot headings, required-init-keyword: headings:;
  slot generators, required-init-keyword: generators:;
  slot items, required-init-keyword: items:;
   pane main-pane (frame)
    make (<table-control>, headings: headings,
          items: items,
          generators: generators);

Of course, the init keywords to the frame do not get passed through to
the method call to make the panes. The frame reference clears it all up
for me. Thanks.

> Of course having a slot for each argument you want to pass in to make the
> subordinate pane can be expensive, so you could put all the frame's keyword
> arguments into a slot (with an initialize method) and pull them out as
> required:
> ...
> Or you could use a hack and assume that inappropriate keyword arguments are
> not checked and do something like:
> ...
> Or you could get the user to put all the table-control init-args in a special
> nested initarg:
> ...

In real design I'm working towards there will be a class that
encapsulates the information to be displayed, and methods to get at
aspects of that information. So making the frame will take an instance
of that class as an init keyword and pull out the data as needed to
instantiate the subordinate panes.

Right now I'm really working in baby steps, just learning how the
current pieces fit together before I start adding mine.



References: