Tcl::pTk::Tile - Tile/ttk Widget Support for Tcl::pTk
# 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);
Tcl::pTk::Tile provides some helper methods and mappings for Tile/ttk support Tcl::pTk package. Tile/ttk are the new themed widget set that is present in Tcl version 8.5 and above.
This package is auto-loaded and the tile widgets declared if a Tcl version > 8.5 is being used by Tcl::pTk.
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)
Set a Tile Theme
Usage:
$widget->ttkSetTheme($name);
Get a list of Tile/ttk theme names
my @themes $widget->ttkThemes;
Internal sub to declare the tile widgets. This is called when a mainwindow is created, if we are using a Tcl version >= 8.5.
_declareTileWidgets($interp); where $interp is the Tcl interp object
Internal method called at startup to provide mapping to the Tile methods. See the docs above on how mapping is done.
Tcl::pTk::Tile->_setupMapping($package, @mappingSpecs);
To install Tcl::pTk, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tcl::pTk
CPAN shell
perl -MCPAN -e shell install Tcl::pTk
For more information on module installation, please visit the detailed CPAN module installation guide.