ttk::style



ttk::style

NAME
SYNOPSIS
NOTES
DEFINITIONS
DESCRIPTION
LAYOUTS
SEE ALSO
KEYWORDS

___________________________

NAME

ttk::style − Manipulate style database

SYNOPSIS

ttk::style option ?args? ___________________________

NOTES

See also the Tcl’2004 conference presentation, available at http://tktable.sourceforge.net/tile/tile-tcl2004.pdf

DEFINITIONS

Each widget is assigned a style, which specifies the set of elements making up the widget and how they are arranged, along with dynamic and default settings for element options. By default, the style name is the same as the widget’s class; this may be overridden by the −style option.

A theme is a collection of elements and styles which controls the overall look and feel of an application.

DESCRIPTION

The ttk::style command takes the following arguments:
ttk::style configure
style ?−option ?value option value...? ?

Sets the default value of the specified option(s) in style.

ttk::style map style ?−option { statespec value... }?

Sets dynamic values of the specified option(s) in style. Each statespec / value pair is examined in order; the value corresponding to the first matching statespec is used.

ttk::style lookup style −option ?state ?default??

Returns the value specified for −option in style style in state state, using the standard lookup rules for element options. state is a list of state names; if omitted, it defaults to all bits off (the “normal” state). If the default argument is present, it is used as a fallback value in case no specification for −option is found.

ttk::style layout style ?layoutSpec?

Define the widget layout for style style. See LAYOUTS below for the format of layoutSpec. If layoutSpec is omitted, return the layout specification for style style.

ttk::style element create elementName type ?args...?

Creates a new element in the current theme of type type. The only cross-platform built-in element type is image (see ttk_image(n)) but themes may define other element types (see Ttk_RegisterElementFactory). On suitable versions of Windows an element factory is registered to create Windows theme elements (see ttk_vsapi(n)).

ttk::style element names

Returns the list of elements defined in the current theme.

ttk::style element options element

Returns the list of element’s options.

ttk::style theme create themeName ?−parent basedon? ?−settings
script...
?

Creates a new theme. It is an error if themeName already exists. If −parent is specified, the new theme will inherit styles, elements, and layouts from the parent theme basedon. If −settings is present, script is evaluated in the context of the new theme as per ttk::style theme settings.

ttk::style theme settings themeName script

Temporarily sets the current theme to themeName, evaluate script, then restore the previous theme. Typically script simply defines styles and elements, though arbitrary Tcl code may appear.

ttk::style theme names

Returns a list of all known themes.

ttk::style theme use ?themeName?

Without an argument the result is the name of the current theme. Otherwise this command sets the current theme to themeName, and refreshes all widgets.

LAYOUTS

A layout specifies a list of elements, each followed by one or more options specifying how to arrange the element. The layout mechanism uses a simplified version of the pack geometry manager: given an initial cavity, each element is allocated a parcel. Valid options are:
−side
side

Specifies which side of the cavity to place the element; one of left, right, top, or bottom. If omitted, the element occupies the entire cavity.

−sticky [nswe]

Specifies where the element is placed inside its allocated parcel.

−children { sublayout... }

Specifies a list of elements to place inside the element.

For example:

ttk::style layout Horizontal.TScrollbar {
Scrollbar.trough −children {
Scrollbar.leftarrow −side left
Scrollbar.rightarrow −side right
Horizontal.Scrollbar.thumb −side left −sticky ew
}
}

SEE ALSO

ttk::intro(n), ttk::widget(n), photo(n), ttk_image(n)

KEYWORDS

style, theme, appearance







Opportunity


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.





Free Software


Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.


Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.





Free Books


The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.


Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.





Education


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.


Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.