[Prev][Next][Index][Thread]
Re: Need help with <tab-control-page>
"Ron Franke-polz" <ron.franke-polz@iac.honeywell.com> writes:
> What's happening is that the application starts up with the first
> tab in front (the default behavior), but It's not displaying
> anything. If I select any other tab, that tab displays its contents,
> and then I can select the first tab, and it will display its
> contents.
What version of FD/HD are you using?
I tried something like what you posted in the released version of FD
2.0 and the tabs displayed correctly with the contents. The code I
tried was:
--------------------------8<--------------------
define method name(i)
format-to-string("%d", i)
end;
define method children?(i)
#t
end;
define method children(i)
list(1, 2, 3, 4);
end;
define frame <dfm-main-frame> (<simple-frame>)
pane part-tree (frame)
make(<tree-control>, label: "part",
label-key: name,
roots: list(1, 2, 3, 4),
children-predicate: children?,
children-generator:
method (x)
x.children;
end);
pane output-editor (frame)
make(<text-editor>, columns: 80,
lines: 25,
fixed-height?: #f,
fixed-width?: #f,
auto-scroll?: #t);
pane part-details-table (frame)
make(<table-control>);
pane define-part-pane (frame)
make(<tab-control-page>, label: "Define Part",
child: horizontally (spacing: 4)
frame.part-tree;
//frame.part-details-table;
end);
pane define-system-pane (frame)
make(<tab-control-page>, label: "Define System",
child: vertically (spacing: 4)
frame.output-editor;
end);
pane main-pane (frame)
make(<tab-control>,
pages: vector(frame.define-part-pane, frame.define-system-pane),
current-page: frame.define-part-pane);
layout (frame)
vertically (spacing: 4)
frame.main-pane;
end;
//*** MAYBE INCLUDE A TOOL BAR ***
/* tool-bar (frame)
make-command-tool-bar(frame-manager(frame), frame); */
status-bar (frame)
make(<status-bar>);
end frame <dfm-main-frame>;
define method main () => ()
start-frame(make(<dfm-main-frame>));
end method main;
--------------------------8<--------------------
Chris.
--
http://www.double.co.nz/dylan
References: