NAME
Tcl::pTk::Tile - Tile/ttk Widget Support for Tcl::pTk
SYNOPSIS
# Get a list of defined Tile Themes
my
@themes
=
$widget
->ttkThemes;
# Set a Tile Theme
$widget
->ttkSetTheme(
$themeName
);
# Create a Tile/ttk widget
my
$check
->ttkCheckbutton(
-text
=>
'Enabled'
,
-variable
=> \
$enabled
);
# Check some of the ttk style settings
my
$font
=
$widget
->ttkStyleLookup(
$style
, -font);
DESCRIPTION
Tcl::pTk::Tile provides some helper methods and mappings for Tile/ttk support in the Tcl::pTk package. Tile/ttk are the new themed widget set that is present in Tcl/Tk 8.5 and above, and available for Tcl/Tk 8.4 in the Tile package.
This package is auto-loaded and the tile widgets declared if Tk 8.5 is being used by Tcl::pTk, or if the Tile package for Tk 8.4 is installed.
Style method mapping
The Tcl/Tk ttk::style command has be mapped to ttkStyle widget methods in Tcl::pTk. The following table defines this mapping:
Tcl Usage Equivalent Tcl::pTk Usage
------------------------------------------ --------------------------------------------------------
ttk::style configure
$style
-option
$value
$widget
->ttkStyleConfigure(
$style
, -option,
$value
)
ttk::style
map
$style
-option ...
$widget
->ttkStyleMap(
$style
, -option, ...)
ttk::style lookup
$style
-font
$widget
->ttkStyleLookup(
$style
, -font)
ttk::style layout
$style
...
$widget
->ttkStyleLayout(
$style
, ...)
ttk::style element create
$elementname
..
$widget
->ttkStyleElementCreate(
$elementname
,
$type
, ..)
ttk::style element names
$widget
->ttkStyleElementNames()
ttk::style element options
$element
$widget
->ttkStyleElementOptions(
$element
)
ttk::style theme create ...
$widget
->ttkThemeCreate( ... )
ttk::style theme settings ...
$widget
->ttkThemeSettings(...)
ttk::style theme names
$widget
->ttkThemeNames
ttk::style theme
use
$themename
$widget
->ttkThemeUse(
$themename
)
METHODS
ttkSetTheme
Set a Tile Theme
Usage:
$widget
->ttkSetTheme(
$name
);
ttkThemes
Get a list of Tile/ttk theme names
Usage:
my
@themes
$widget
->ttkThemes;
_declareTileWidgets
Internal sub to declare the tile widgets. This is called when a mainwindow is created, if we are using Tcl/Tk 8.5 or higher, or the Tile package for Tcl/Tk 8.4 is present.
Usage:
_declareTileWidgets(
$interp
);
where
$interp
is the Tcl interp object
_setupMapping
Internal method called at startup to provide mapping to the Tile methods. See the docs above on how mapping is done.
Usage:
Tcl::pTk::Tile->_setupMapping(
$package
,
@mappingSpecs
);