## util_window.api
## (C) 1997-99, Bremen Institute for Safe Systems, Universitaet Bremen
## Author: cxl
# Compiled by:
#
src/lib/tk/src/toolkit/sources.sublib# **************************************************************************
# Utitility windows -- api file.
# Windows for errors, warnings, user confirmation and text entry,
# revised vision
#
# Supplements util_window.pkg.
# **************************************************************************
# export api
api Util_Window {
# display error or warning, then continue
error: String -> Void;
warning: String -> Void;
# display error or warning, then call fate
error_cc: (String, (Void -> Void)) -> Void;
warning_cc: (String, (Void -> Void)) -> Void;
# Demand confirmation, then call fate.
# If user clicks "cancel", do nothing
confirm: (String, (Void -> Void)) -> Void;
# Display an informative message. The returned closure closes this window,
# ideally after it has been displayed for at least 10 secs or something.
# This window can't be closed by the user.
info_cc: String -> (Void -> Void);
# As above, but let the user close the window ("display&forget")
info: String -> Void;
# Display a text
#
# There are two variations, one where the id of the text widget is
# explicitly passed along (although the widget has not been created
# at this point), one where it is created by this function and then
# passed to the cc function.
display: { title: String, width: Int, height: Int,
text: tk::Live_Text, cc: tk::Widget_Id -> Void } -> Void;
display_id: { window_id: tk::Window_Id, widget_id: tk::Widget_Id, title: String,
width: Int, height: Int, text: tk::Live_Text } -> Void;
# prompt the user to enter a text in a separate window w/ a text widget
#
# parameters are pretty self-explanatory, except for cc which is
# the fate to be called with the entered text.
enter_text: { title: String, prompt: String, default: String,
width: Int, height: Int,
cc: String -> Void } -> Void;
# Prompt the user to enter a line of text in a separate window
#
# Parameters are as before (but no height). This function uses an
# artificially intelligent semi-heuristic fuzzy logic based algorithm
# implemented in Java to determine wether the text entry should be
# alongside the prompt or below it.
enter_line: { title: String, prompt: String, default: String,
width: Int, cc: String -> Void } -> Void;
# (Actually, if the prompt is at least twice as long as the text entry,
# it is below the prompt, otherwise to its right).
# Auxiliary version of enterText which produces n entry widgets,
# as specified by a list of heights, also takes some more widgets
# and places them between the text widget, and the ok/cancel bottoms
enter_text0: { title: String, prompt: String, default: String,
widgetsbelow: List( tk::Widget ),
heights: List( Int ), headers: List( String ),
width: Int, cc: List( String ) -> Void } -> Void;
};