# ***********************************************************************
#
# Project: sml/Tk: an Tk Toolkit for sml
# Author: Stefan Westmeier, University of Bremen
# $Date: 2001/03/30 13:39:21 $
# $Revision: 3.0 $
# Purpose of this file: Functions related to Tk_Events
#
# ***********************************************************************
# Compiled by:
#
src/lib/tk/src/tk.sublibpackage tk_event
: (weak) Tk_Event # Tk_Event is from
src/lib/tk/src/tk_event.api{
stipulate
include package basic_tk_types;
include package basic_utilities;
herein
fun get_button (TK_EVENT (b, _, _, _, _, _)) = b;
fun get_state (TK_EVENT(_, s, _, _, _, _)) = s;
fun get_x_coordinate (TK_EVENT(_, _, x, _, _, _)) = x;
fun get_y_coordinate (TK_EVENT(_, _, _, y, _, _)) = y;
fun get_root_x_coordinate (TK_EVENT(_, _, _, _, x, _)) = x;
fun get_root_y_coordinate (TK_EVENT(_, _, _, _, _, y)) = y;
fun show ()
=
"(%b,%s,%x,%y,%X,%Y)";
fun unparse ev_v
=
{
include package string_util;
ev_v' = string::translate
(\\ c = if (is_open_paren c or is_close_paren c) "";
else str c; fi)
ev_v;
my bs . st . xs . ys . xrs . yrs . _
=
string::fields is_comma ev_v';
b = to_int bs;
x = to_int xs;
y = to_int ys;
x_root= to_int xrs;
y_root= to_int yrs;
TK_EVENT (b, st, x, y, x_root, y_root);
}
except
BIND => TK_EVENT (0, "", 0, 0, 0, 0); end ;
end;
};