


## boxbutton-shape.pkg
#
# Shape for rectangular button.
# Compiled by:
# src/lib/x-kit/widget/xkit-widget.sublib### "If you have ambition, you might not achieve anything,
### but without ambition, you are almost certain
### not to achieve anything."
###
### -- Whitfield Diffie
# This package gets used in:
#
# src/lib/x-kit/widget/leaf/boxbutton-look.pkgstipulate
package d3 = three_d; # three_d is from src/lib/x-kit/widget/lib/three-d.pkg package xc = xclient; # xclient is from src/lib/x-kit/xclient/xclient.pkg package xg = xgeometry; # xgeometry is from src/lib/std/2d/xgeometry.pkg package wg = widget; # widget is from src/lib/x-kit/widget/basic/widget.pkgherein
package boxbutton_shape: (weak) Button_Shape { # Button_Shape is from src/lib/x-kit/widget/leaf/button-shape.api attributes = [];
fun drawfn (d, size, bwid)
=
draw
where
r = xg::box::make (xg::point::zero, size);
draw_box = d3::draw3drect d (r, bwid);
fun draw (base, top, bottom)
=
{ xc::fill_box d base r;
draw_box { top, bottom };
};
end;
fun sizefn (wid, ht)
=
wg::make_tight_size_preference
(
wid,
case ht
THE h => h;
NULL => wid;
esac
);
fun config _
=
(sizefn, drawfn);
};
end;
## COPYRIGHT (c) 1994 by AT&T Bell Laboratories See COPYRIGHT file for details.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2012,
## released under Gnu Public Licence version 3.


