## stdmark_ex.pkg
## (C) 1997, Bremen Institute for Safe Systems, Universitaet Bremen
## Author: cxl (Last modification by $Author: 2cxl $)
# Compiled by:
#
src/lib/tk/src/toolkit/tests+examples/sources.sublib# **************************************************************************
#
# tk Standard Markup Language: an example.
#
# $Date: 2001/03/30 13:40:04 $
# $Revision: 3.0 $
#
# **************************************************************************
package std_mark_ex: (weak) api { go: Void -> Void; } {
include package tk;
include package tk_21;
sometext =
"One can do <font bold>boldfaced<\\font> bits, and <font em>italic<\\font> bits.\n"$
"One can make things <font large>larger<\\font> and <font tiny>smaller<\\font>.\n"$
"There are <font tt>different<\\font> typefaces as well, such as that and <font sf>sans-serif<\\font>, and of course, <font symb>symbols<\\font>!\n"$
"And <font bold sf>all these things <\\font>can be <font bold it>combined<\\font>.\n"$
"You can <raise 5>boxes<\\raise>, <raise -5>lower<\\raise> and <box>box text<\\box>.\n"$
"There are also special characters: α, ω, Σ.\n";
fun text_widget window txt
=
{ twid = make_widget_id();
anno = standard_markup::get_livetext txt;
text_wid (twid, NOWHERE, anno,
[FILL ONLY_X, PACK_AT TOP], [ACTIVE FALSE], []);
};
fun quit_button window
=
button (
make_widget_id(),
[PACK_AT BOTTOM, FILL ONLY_X, EXPAND TRUE],
[ RELIEF RIDGE, BORDER_THICKNESS 2,
TEXT "Quit", CALLBACK (\\ () = close_window window)],
[]
);
fun main_window txt
=
{ my
wid = make_window_id ();
make_window {
window_id => wid,
traits => [WINDOW_TITLE "tk Standard Markup Test Window"],
subwidgets => PACKED [text_widget wid txt, quit_button wid],
event_callbacks => [],
init => null_callback
};
};
fun go ()
=
{ tk::start_tcl_and_trap_tcl_exceptions [ main_window sometext ];
();
};
};