-
Notifications
You must be signed in to change notification settings - Fork 130
Customising Tk
You can modify what the Tk window displays by modifying the tk_frame.pl
and tk_widgets.p
l members. tk_frame.pl
controls the general layout and size of the various scrolled lists. Modifying this member takes a little knowledge of perl Tk.
tk_widgets.pl
shows how you can add widgets to display various info and allow for buttons for manual control. The MisterHouse tk_xyz subroutines used here will add widgets to either the menu_bar or to the 'grid' frame defined in tk_frame.pl
.
Any change to tk_frame.pl
or tk_widgets
will be evaluated on a code reload, as will the tk_geometry
parm in mh.ini
.
tk_xyz
widgets can be added anywhere in your MisterHouse code, not just the tk_widgets.pl
member. See the weather_monitor.pl
, internet_mail.pl
, and tk_eye.pl
members in mh/code/bruce
for examples.
The tk_xyz
widgets are 'packed' into the menu_bar or grid in the order that they are evaluated. You can use the 'Position' directive at the top of your member.pl
code to control this. Position=1
is reserved for the tk_frame.pl
member, as this must be evaluated first.
Note, you can also use native Perl tk commands, or create or override the tk_xyz
subroutines in your own code for more flexibility.
For more info on the tk_xyz widgets
, see the MisterHouse Tk widget functions and the handy Tk utilities documentation.