tinycobol/tcltk84/tk8.4/tablelist4.4/doc/tablelistThemeDefs.html

113 lines
4.1 KiB
HTML

<html>
<head>
<title>The tablelist::setThemeDefaults Command</title>
<meta name="Author" content="Csaba Nemethi">
<meta name="Keywords" content="tablelist, theme, tile">
</head>
<body bgcolor="#FFFFFF">
<div align="center">
<h1>The <code><b>tablelist::setThemeDefaults</b></code> Command</h1>
<h3>by</h3>
<h2>Csaba Nemethi</h2>
<address>
<a href="mailto:csaba.nemethi@t-online.de">csaba.nemethi@t-online.de</a>
</address>
</div>
<hr>
<dl>
<dt><b>NAME</b></dt>
<dd><code>tablelist::setThemeDefaults</code> - Set theme-specific default values of some tablelist configuration options</dd>
<dt><br>
<b>SYNOPSIS</b></dt>
<dd>
<pre>
<b>tablelist::setThemeDefaults</b>
</pre>
</dd>
<dt><b>DESCRIPTION</b></dt>
<dd>
This command should only be invoked when using the package
Tablelist_tile.&nbsp; It populates the array
<code><b>tablelist::themeDefaults</b></code> with theme-specific default
values of a series of Tablelist configuration options.&nbsp; The array
names are the command-line names of the options, and the corresponding
array values are the default values of these configuration options for
the currently set tile theme.
<p>The options whose names and values are written into the array
<code><b>tablelist::themeDefaults</b></code> are:
<code><b>-background</b></code>, <code><b>-foreground</b></code>,
<code><b>-disabledforeground</b></code>,
<code><b>-stripebackground</b></code>,
<code><b>-selectbackground</b></code>,
<code><b>-selectforeground</b></code>,
<code><b>-selectborderwidth</b></code>, <code><b>-font</b></code>,
<code><b>-labelbackground</b></code>,
<code><b>-labelforeground</b></code>,
<code><b>-labelfont</b></code>, <code><b>-labelborderwidth</b></code>,
<code><b>-labelpady</b></code>, <code><b>-arrowcolor</b></code>, and
<code><b>-arrowstyle</b></code>.&nbsp; In addition, the command sets some
other array elements to theme-specific default values of the background
and foreground colors of the column labels in
<code><b>disabled</b></code>, <code><b>active</b></code>, and
<code><b>pressed</b></code> states.&nbsp; (Tablelist needs the label
colors for handling sort arrows and images with transparent background in
the column labels.)</p>
<p>The <code><b>tablelist::setThemeDefaults</b></code> command is invoked
by Tablelist_tile automatically when the first tablelist widget is
createad or a <code><b>&lt;&lt;ThemeChanged&gt;&gt;</b></code> virtual
event is received by a tablelist widget.&nbsp; In the latter case, the
widget is reconfigured, using the new default values of those options
that were not set explicitly to values different from the corresponding
defaults.</p>
<p>Besides being used by the Tablelist_tile code, this command can also
be invoked in Tcl scripts, still before creating tile-based tablelist
widgets.&nbsp; By calling it explicitly and using the values written by
it into the array <code><b>tablelist::themeDefaults</b></code>, you can
make sure that classical Tk widgets, e.g., listbox and text, will have a
theme-specific appearance, just like the tile widgets.&nbsp; For example,
you can add some common configuration options to the option database as
follows:</p>
<blockquote>
<pre>
tablelist::setThemeDefaults
if {$tile::currentTheme eq "aqua"} {
option add *Listbox.selectBackground \
$tablelist::themeDefaults(-selectbackground)
option add *Listbox.selectForeground \
$tablelist::themeDefaults(-selectforeground)
} else {
option add *selectBackground $tablelist::themeDefaults(-selectbackground)
option add *selectForeground $tablelist::themeDefaults(-selectforeground)
}
option add *selectBorderWidth $tablelist::themeDefaults(-selectborderwidth)
</pre>
</blockquote>
</dd>
<dt><b>KEYWORDS</b></dt>
<dd>tablelist, theme, tile</dd>
</dl>
<div align="center">
<p><a href="index.html">Start page</a></p>
</div>
</body>
</html>