Documentation
¶
Overview ¶
Package tk9.0 is a CGo-free, cross platform GUI toolkit for Go. It is similar to Tkinter for Python.
Hello world ¶
Also available in _examples/hello.go
package main import . "modernc.org/tk9.0" func main() { Pack(Button(Txt("Hello"), Command(func() { Destroy(App) }))) App.Wait() }
To execute the above program on any supported target issue something like
$ CGO_ENABLED=0 go run hello.go
The CGO_ENABLED=0 is optional and here it only demonstrates the program can be built without CGo.
In action ¶
Frequently Asked Questions ¶
Do I need to install the Tcl/Tk libraries on my system to use this package or programs that import it?
No. You still have to have a desktop environment installed on systems where that is not necessarily the case by default. That means some of the unix-like systems. Usually installing any desktop environment, like Gnome, Xfce etc. provides all the required library (.so) files. The minimum is the X Window System and this package was tested to work there, although with all the limitations one can expect in this case.
Windows: How to build an executable that doesn't open a console window when run?
From the documentation for cmd/link: On Windows, -H windowsgui writes a "GUI binary" instead of a "console binary.". To pass the flag to the Go build system use 'go build -ldflags -H=windowsgui somefile.go', for example.
What does CGo-free really mean?
cgo is a tool used by the Go build system when Go code uses the pseudo-import "C". For technical details please see the link. For us it is important that using CGo ends up invoking a C compiler during building of a Go program/package. The C compiler is used to determine exact, possibly locally dependent, values of C preprocessor constants and other defines, as well as the exact layout of C structs. This enables the Go compiler to correctly handle things like, schematically `C.someStruct.someField` appearing in Go code.
At runtime a Go program using CGo must switch stacks when calling into C. Additionally the runtime scheduler is made aware of such calls into C. The former is necessary, the later is not, but it is good to have as it improves performance and provides better resource management.
There is an evironment variable defined, `CGO_ENABLED`. When the Go build system compiles Go code, it checks for the value of this env var. If it is not set or its value is "1", then CGo is enabled and used when 'import "C"' is encountered. If the env var contains "0", CGo is disabled and programs using 'import "C"' will not compile.
After this longish intro we can finally get to the short answer: CGo-free means this package can be compiled with CGO_ENABLED=0. In other words, there's no 'import "C"' clause anywhere.
The consequences of being CGo-free follows from the above. The Go build system does not need to invoke a C compiler when compiling this package. Hence users don't have to have a C compiler installed in their machines.
There are advantages when a C compiler is not invoked during compilation/build of Go code. Programs can be installed on all targets supported by this package the easy way: '$ go install example.com/foo@latest' and programs for all supported targets can be cross-compiled on all Go-supported targets just by setting the respective env vars, like performing '$ GOOS=darwin GOARCH=arm64 go build' on a Windows/AMD64 machine, for example.
How does this package achieve being CGo-free?
The answer depends on the particular target in question. Targets supported by purego call into the Tcl/Tk C libraries without using CGo. See the source code at the link for how it is done.
On other targets CGo is avoided by transpiling all the C libraries and their transitive dependencies to Go.
In both cases the advantages are the same: CGo-free programs are go-installable and CGo-free programs can be cross-compiled without having a C compiler or a cross-C compiler tool chain installed.
Does being CGo-free remove the overhead of crossing the Go-C boundary?
For the purego targets, no. Only the C compiler is not involved anymore.
For other supported targets the boundary for calling Tcl/Tk C API from Go is gone. No free lunches though, the transpilled code has to care about additional things the C code does not need to - with the respective performance penalties, now just in different places.
Widget catalogue ¶
- ButtonWidget
- CanvasWidget
- EntryWidget
- FrameWidget
- CheckbuttonWidget
- LabelframeWidget
- LabelWidget
- ListboxWidget
- MenubuttonWidget
- MenuWidget
- MessageWidget
- OptionMenuWidget
- PanedwindowWidget
- RadiobuttonWidget
- ScaleWidget
- ScrollbarWidget
- SpinboxWidget
- TButtonWidget
- TComboboxWidget
- TEntryWidget
- TextWidget
- TFrameWidget
- TCheckbuttonWidget
- TLabelframeWidget
- TLabelWidget
- TMenubuttonWidget
- TNotebookWidget
- ToplevelWidget
- TPanedwindowWidget
- TProgressbarWidget
- TRadiobuttonWidget
- TScaleWidget
- TScrollbarWidget
- TSeparatorWidget
- TSizegripWidget
- TSpinboxWidget
- TTreeviewWidget
Debugging ¶
Consider this program in _examples/debugging.go:
// Build this program using -tags=tk.dmesg package main import . "modernc.org/tk9.0" func main() { Pack( TButton(Txt("Hello"), Command(func() { Destroy(App) })), Ipadx(10), Ipady(5), Padx(20), Pady(10), ) App.Wait() }
Execute the program using the tags as indicated, then close the window or click the Hello button. With the tk.dmesg tag the package initialization prints the debug messages path. So we can view it, for example, like this:
$ go run -tags=tk.dmesg _examples/debugging.go | tee log ... /tmp/debugging-18876-20240928-163046 $ cat /tmp/debugging-18876-20240928-163046 [18876 debugging] enter [dmesgon.go:32:0 proc.go:7278:doInit1 proc.go:7245:doInit] ... [18876 debugging] code=wm iconphoto . img2 -> r= err=<nil> [tk_purego.go:225:eval tk_purego.go:225:eval tk.go:354:evalErr] [18876 debugging] code=wm title . debugging -> r= err=<nil> [tk_purego.go:225:eval tk_purego.go:225:eval tk.go:354:evalErr] [18876 debugging] code=. configure -padx 4m -pady 3m -> r= err=<nil> [tk_purego.go:225:eval tk_purego.go:225:eval tk.go:354:evalErr] [18876 debugging] code=tk::PlaceWindow . center -> r= err=<nil> [tk_purego.go:225:eval tk_purego.go:225:eval tk.go:354:evalErr] [18876 debugging] code=ttk::button ..tbutton4 -text Hello -command {eventDispatcher 3} -> r=.tbutton4 err=<nil> [tk_purego.go:225:eval tk_purego.go:225:eval tk.go:342:newChild] [18876 debugging] code=pack .tbutton4 -ipadx 10 -ipady 5 -padx 20 -pady 10 -> r= err=<nil> [tk_purego.go:225:eval tk_purego.go:225:eval tk.go:354:evalErr] [18876 debugging] code=destroy . -> r= err=<nil> [tk_purego.go:225:eval tk_purego.go:225:eval tk.go:354:evalErr] [18876 debugging] code=tkwait window . -> r= err=<nil> [tk_purego.go:225:eval tk_purego.go:225:eval tk.go:354:evalErr] $
18876 was the process PID in this particular run. Using the tags allows to inspect the Tcl/Tk code executed during the lifetime of the process.
Supported targets ¶
These combinations of GOOS and GOARCH are currently supported
OS Arch ------------- darwin amd64 darwin arm64 freebsd amd64 freebsd arm64 linux 386 linux amd64 linux arm linux arm64 linux loong64 linux ppc64le linux riscv64 linux s390x windows 386 windows amd64 windows arm64
Specific to FreeBSD:
When building with cross-compiling or CGO_ENABLED=0, add the following argument to `go` so that these symbols are defined by making fakecgo the Cgo.
-gcflags="github.com/ebitengine/purego/internal/fakecgo=-std"
Builders ¶
Builder results available at modern-c.appspot.com.
Runtime dependencies ¶
- Img.Graph and CanvasWidget.Graph require the gnuplot executable available in $PATH.
Completeness ¶
At the moment the package is a MVP allowing to build at least some simple, yet useful programs. The full Tk API is not yet usable. Please report needed, but non-exposed Tk features at the issue tracker, thanks.
Providing feedback about the missing building blocks, bugs and your user experience is invaluable in helping this package to eventually reach version 1. See also RERO.
Error handling ¶
The ErrorMode variable selects the behaviour on errors for certain functions that do not return error.
When ErrorMode is PanicOnError, the default, errors will panic, providing a stack trace.
When ErrorMode is CollectErrors, errors will be recorded using errors.Join in the Error variable. Even if a function does not return error, it is still possible to handle errors in the usual way when needed, except that Error is now a static variable. That's a problem in the general case, but less so in this package that must be used from a single goroutine only, as documented elsewhere.
// Explicit error handling. ErrorMode = CollectErrors if SomeFunnction(someArgument); Error != nil { ... error handling goes here }
This is obviously a compromise enabling to have a way to check for errors and, at the same time, the ability to write concise code like:
// Deferred error handling. if b = Button(Txt("Foo"), Padx(5), Pady(10)); Error != nil { ... }
There are altogether four different places where the call to the Button function can produce errors as additionally to the call itself, every of its three arguments can independently fail as well. Checking each and one of them separately is not always necessary in GUI code. But the explicit option in the first example is still available when needed.
Themes ¶
There is a centralized theme register in Themes. Theme providers can opt in to call RegisterTheme at package initialization to make themes discoverable at run-time. Clients can use ActivateTheme to apply a theme by name. Example in _examples/azure.go.
VNC server ¶
There is a VNC over wbesockets functionality available for X11 backed hosts. See the tk9.0/vnc package for details.
Package initialization ¶
Package initialization is done lazily. This saves noticeable additional startup time and avoids screen flicker in hybrid programs that use the GUI only on demand. (For a hybrid example see _examples/ring.go.)
Early package initialization can be enforced by Initialize.
Initialization will fail if a Unix process starts on a machine with no X server or the process is started in a way that it has no access to the X server. On the other hand, this package may work on Unix machines with no X server if the process is started remotely using '$ ssh -X foo@bar' and the X forwarding is enabled/supported.
Darwin port uses the macOS GUI API and does not use X11.
The options pattern ¶
Zero or more options can be specified when creating a widget. For example
b := Button(Txt("Hello"), OverRelief("flat"))
or
lbl := myFrame.Label(State("disabled"), Width(200))
Widget path names, image and font names ¶
Tcl/Tk uses widget pathnames, image and font names explicitly set by user code. This package generates those names automatically and they are not directly needed in code that uses this package.
Renamed options ¶
There is, for a example, a Tcl/tk 'text' widget and a '-text' option. This package exports the widget as type 'TextWidget', its constructor as function 'Text' and the option as function 'Txt'. The complete list is:
- Button option is renamed to [Btn]
- Label option is renamed to Lbl
- Menu option is renamed to Mnu
- Message option is renamed to Msg
- Text option is renamed to Txt
OS thread ¶
This package should be used from the same goroutine that initialized the package. Package initialization performs a runtime.LockOSThread, meaning func main() will start execuing locked on the same OS thread.
Event handlers ¶
The Command() and similar options expect an argument that must be one of:
- An EventHandler or a function literal of the same signature.
- A func(). This can be used when the handler does not need the associated Event instance.
Specially handled types ¶
When passing an argument of type time.Durarion to a function accepting 'any', the duration is converted to an integer number of milliseconds.
When passing an argument of type image.Image to a function accepting 'any', the image is converted to a encoding/base64 encoded string of the PNG representation of the image.
- []byte
When passing an argument of type []byte to a function accepting 'any', the byte slice is converted to a encoding/base64 encoded string.
- []FileType
When passing an argument of type []FileType to a function accepting 'any', the slice is converted to the representation the Tcl/Tk -filetypes option expects.
Tcl/Tk code ¶
At least some minimal knowledge of reading Tcl/Tk code is probably required for using this package and/or using the related documentation. However you will not need to write any Tcl code and you do not need to care about the grammar of Tcl words/string literals and how it differs from Go.
There are several Tcl/Tk tutorials available, for example at tutorialspoint.
Hacking ¶
Merge requests for known issues are always welcome.
Please send merge requests for new features/APIs after filling and discussing the additions/changes at the issue tracker first.
Notes ¶
Most of the documentation is generated directly from the Tcl/Tk documentation and may not be entirely correct for the Go package. Those parts hopefully still serve as a quick/offline Tcl/Tk reference.
Additional copyrights ¶
Parts of the documentation are copied and/or modified from the tcl.tk site, see the LICENSE-TCLTK file for details.
Parts of the documentation are copied and/or modified from the tkinter.ttk site which is
---------------------------------------------------------------------------- © Copyright 2001-2024, Python Software Foundation, licensed under the Python Software Foundation License Version 2. ----------------------------------------------------------------------------
Sponsorship ¶
You can support the maintenance and further development of this package at jnml's LiberaPay (using PayPal).
"alt" theme style guide ¶
"Checkbutton.indicator" style element options:
- Background
- Bordercolor
- Foreground
- Indicatorcolor
- Indicatormargin
- Lightcolor
- [Shadecolor]
"Combobox.downarrow" style element options:
"Menubutton.indicator" style element options:
"Radiobutton.indicator" style element options:
- Background
- Bordercolor
- Foreground
- Indicatorcolor
- Indicatormargin
- Lightcolor
- [Shadecolor]
"Spinbox.downarrow" style element options:
"Spinbox.uparrow" style element options:
"Treeitem.indicator" style element options:
"arrow" style element options:
"border" style element options:
"downarrow" style element options:
"field" style element options:
- Bordercolor
- Fieldbackground
- Focuscolor
- [Focuswidth]
"leftarrow" style element options:
"rightarrow" style element options:
"slider" style element options:
- Background
- Bordercolor
- Borderwidth
- Orient
- Sliderrelief
- [Sliderthickness]
"thumb" style element options:
"uparrow" style element options:
"alt" theme style list
.
Style map: -foreground {disabled #a3a3a3} -background {disabled #d9d9d9 active #ececec} -embossed {disabled 1}
ComboboxPopdownFrame
Layout: ComboboxPopdownFrame.border -sticky nswe
Heading
Layout: Treeheading.cell -sticky nswe Treeheading.border -sticky nswe -children {Treeheading.padding -sticky nswe -children {Treeheading.image -side right -sticky {} Treeheading.text -sticky we}}
Item
Layout: Treeitem.padding -sticky nswe -children {Treeitem.indicator -side left -sticky {} Treeitem.image -side left -sticky {} Treeitem.text -sticky nswe}
Separator
Layout: Treeitem.separator -sticky nswe
TButton
Layout: Button.border -sticky nswe -border 1 -children {Button.focus -sticky nswe -children {Button.padding -sticky nswe -children {Button.label -sticky nswe}}}
Style map: -highlightcolor {alternate black} -relief { {pressed !disabled} sunken {active !disabled} raised }
TCheckbutton
Layout: Checkbutton.padding -sticky nswe -children {Checkbutton.indicator -side left -sticky {} Checkbutton.focus -side left -sticky w -children {Checkbutton.label -sticky nswe}}
Style map: -indicatorcolor {pressed #d9d9d9 alternate #aaaaaa disabled #d9d9d9}
TCombobox
Layout: Combobox.field -sticky nswe -children {Combobox.downarrow -side right -sticky ns Combobox.padding -sticky nswe -children {Combobox.textarea -sticky nswe}}
Style map: -fieldbackground {readonly #d9d9d9 disabled #d9d9d9} -arrowcolor {disabled #a3a3a3}
TEntry
Layout: Entry.field -sticky nswe -border 1 -children {Entry.padding -sticky nswe -children {Entry.textarea -sticky nswe}}
Style map: -fieldbackground {readonly #d9d9d9 disabled #d9d9d9}
TLabelframe
Layout: Labelframe.border -sticky nswe
TMenubutton
Layout: Menubutton.border -sticky nswe -children {Menubutton.focus -sticky nswe -children {Menubutton.indicator -side right -sticky {} Menubutton.padding -sticky we -children {Menubutton.label -side left -sticky {}}}}
TNotebook
Layout: Notebook.client -sticky nswe
TNotebook.Tab
Layout: Notebook.tab -sticky nswe -children {Notebook.padding -side top -sticky nswe -children {Notebook.focus -side top -sticky nswe -children {Notebook.label -side top -sticky {}}}}
Style map: -expand {selected {1.5p 1.5p 0.75p 0}} -background {selected #d9d9d9}
TProgressbar
-
TRadiobutton
Layout: Radiobutton.padding -sticky nswe -children {Radiobutton.indicator -side left -sticky {} Radiobutton.focus -side left -sticky {} -children {Radiobutton.label -sticky nswe}}
Style map: -indicatorcolor {pressed #d9d9d9 alternate #aaaaaa disabled #d9d9d9}
TScale
-
TScrollbar
-
TSpinbox
Layout: Spinbox.field -side top -sticky we -children {null -side right -sticky {} -children {Spinbox.uparrow -side top -sticky e Spinbox.downarrow -side bottom -sticky e} Spinbox.padding -sticky nswe -children {Spinbox.textarea -sticky nswe}}
Style map: -fieldbackground {readonly #d9d9d9 disabled #d9d9d9} -arrowcolor {disabled #a3a3a3}
Tab
Layout: Notebook.tab -sticky nswe -children {Notebook.padding -side top -sticky nswe -children {Notebook.focus -side top -sticky nswe -children {Notebook.label -side top -sticky {}}}}
Toolbutton
Layout: Toolbutton.border -sticky nswe -children {Toolbutton.focus -sticky nswe -children {Toolbutton.padding -sticky nswe -children {Toolbutton.label -sticky nswe}}}
Style map: -relief {disabled flat selected sunken pressed sunken active raised} -background {pressed #c3c3c3 active #ececec}
Treeview
Layout: Treeview.field -sticky nswe -border 1 -children {Treeview.padding -sticky nswe -children {Treeview.treearea -sticky nswe}}
Style map: -foreground {disabled #a3a3a3 selected #ffffff} -background {disabled #d9d9d9 selected #4a6984}
Treeview.Separator
Layout: Treeitem.separator -sticky nswe
"aqua" theme style guide ¶
"Button.button" style element options:
"Checkbutton.button" style element options:
"Combobox.button" style element options:
"DisclosureButton.button" style element options:
"Entry.field" style element options:
"GradientButton.button" style element options:
"HelpButton.button" style element options:
"Horizontal.Scrollbar.leftarrow" style element options:
"Horizontal.Scrollbar.rightarrow" style element options:
"Horizontal.Scrollbar.thumb" style element options:
"Horizontal.Scrollbar.trough" style element options:
"InlineButton.button" style element options:
"Labelframe.border" style element options:
"Menubutton.button" style element options:
"Notebook.client" style element options:
"Notebook.tab" style element options:
"Progressbar.track" style element options:
"Radiobutton.button" style element options:
"RecessedButton.button" style element options:
"RoundedRectButton.button" style element options:
"Scale.slider" style element options:
"Scale.trough" style element options:
"Searchbox.field" style element options:
"SidebarButton.button" style element options:
"Spinbox.downarrow" style element options:
"Spinbox.field" style element options:
"Spinbox.uparrow" style element options:
"Toolbar.background" style element options:
"Toolbutton.border" style element options:
"Treeheading.cell" style element options:
"Treeitem.indicator" style element options:
"Treeview.treearea" style element options:
"Vertical.Scrollbar.downarrow" style element options:
"Vertical.Scrollbar.thumb" style element options:
"Vertical.Scrollbar.trough" style element options:
"Vertical.Scrollbar.uparrow" style element options:
"background" style element options:
"field" style element options:
"fill" style element options:
"hseparator" style element options:
"separator" style element options:
"sizegrip" style element options:
"vseparator" style element options:
"aqua" theme style list
.
Style map: -selectforeground { background systemSelectedTextColor !focus systemSelectedTextColor} -foreground { disabled systemDisabledControlTextColor background systemLabelColor} -selectbackground { background systemSelectedTextBackgroundColor !focus systemSelectedTextBackgroundColor}
DisclosureButton
Layout: DisclosureButton.button -sticky nswe
GradientButton
Layout: GradientButton.button -sticky nswe -children {Button.padding -sticky nswe -children {Button.label -sticky nswe}}
Heading
Layout: Treeheading.cell -sticky nswe Treeheading.image -side right -sticky {} Treeheading.text -side top -sticky {}
HelpButton
Layout: HelpButton.button -sticky nswe
Horizontal.TScrollbar
Layout: Horizontal.Scrollbar.trough -sticky we -children {Horizontal.Scrollbar.thumb -sticky nswe Horizontal.Scrollbar.rightarrow -side right -sticky {} Horizontal.Scrollbar.leftarrow -side right -sticky {}}
ImageButton
Layout: Button.padding -sticky nswe -children {Button.label -sticky nswe}
Style map: -foreground { pressed systemLabelColor !pressed systemSecondaryLabelColor }
InlineButton
Layout: InlineButton.button -sticky nswe -children {Button.padding -sticky nswe -children {Button.label -sticky nswe}}
Style map: -foreground { disabled systemWindowBackgroundColor }
Item
Layout: Treeitem.padding -sticky nswe -children {Treeitem.indicator -side left -sticky {} Treeitem.image -side left -sticky {} Treeitem.text -side left -sticky {}}
Label
Layout: Label.fill -sticky nswe -children {Label.text -sticky nswe}
RecessedButton
Layout: RecessedButton.button -sticky nswe -children {Button.padding -sticky nswe -children {Button.label -sticky nswe}}
Style map: -font { selected RecessedFont active RecessedFont pressed RecessedFont } -foreground { {disabled selected} systemWindowBackgroundColor3 {disabled !selected} systemDisabledControlTextColor selected systemTextBackgroundColor active white pressed white }
RoundedRectButton
Layout: RoundedRectButton.button -sticky nswe -children {Button.padding -sticky nswe -children {Button.label -sticky nswe}}
Searchbox
Layout: Searchbox.field -sticky nswe -border 1 -children {Entry.padding -sticky nswe -children {Entry.textarea -sticky nswe}}
SidebarButton
Layout: SidebarButton.button -sticky nswe -children {Button.padding -sticky nswe -children {Button.label -sticky nswe}}
Style map: -foreground { {disabled selected} systemWindowBackgroundColor3 {disabled !selected} systemDisabledControlTextColor selected systemTextColor active systemTextColor pressed systemTextColor }
TButton
Layout: Button.button -sticky nswe -children {Button.padding -sticky nswe -children {Button.label -sticky nswe}}
Style map: -foreground { pressed white {alternate !pressed !background} white disabled systemDisabledControlTextColor}
TCheckbutton
Layout: Checkbutton.button -sticky nswe -children {Checkbutton.padding -sticky nswe -children {Checkbutton.label -side left -sticky {}}}
TCombobox
Layout: Combobox.button -sticky nswe -children {Combobox.padding -sticky nswe -children {Combobox.textarea -sticky nswe}}
Style map: -foreground { disabled systemDisabledControlTextColor } -selectbackground { !focus systemUnemphasizedSelectedTextBackgroundColor }
TEntry
Layout: Entry.field -sticky nswe -border 1 -children {Entry.padding -sticky nswe -children {Entry.textarea -sticky nswe}}
Style map: -foreground { disabled systemDisabledControlTextColor } -selectbackground { !focus systemUnemphasizedSelectedTextBackgroundColor }
TLabelframe
Layout: Labelframe.border -sticky nswe
TLabelframe.Label
Layout: Label.fill -sticky nswe -children {Label.text -sticky nswe}
TMenubutton
Layout: Menubutton.button -sticky nswe -children {Menubutton.padding -sticky nswe -children {Menubutton.label -side left -sticky {}}}
TNotebook
Layout: Notebook.client -sticky nswe
TNotebook.Tab
Layout: Notebook.tab -sticky nswe -children {Notebook.padding -sticky nswe -children {Notebook.label -sticky nswe}}
Style map: -foreground { {background !selected} systemControlTextColor {background selected} black {!background selected} systemSelectedTabTextColor disabled systemDisabledControlTextColor}
TProgressbar
Layout: Progressbar.track -sticky nswe
TRadiobutton
Layout: Radiobutton.button -sticky nswe -children {Radiobutton.padding -sticky nswe -children {Radiobutton.label -side left -sticky {}}}
TScrollbar
-
TSpinbox
Layout: Spinbox.buttons -side right -sticky {} -children {Spinbox.uparrow -side top -sticky e Spinbox.downarrow -side bottom -sticky e} Spinbox.field -sticky we -children {Spinbox.textarea -sticky we}
Style map: -foreground { disabled systemDisabledControlTextColor } -selectbackground { !focus systemUnemphasizedSelectedTextBackgroundColor }
Tab
Layout: Notebook.tab -sticky nswe -children {Notebook.padding -sticky nswe -children {Notebook.label -sticky nswe}}
Toolbar
Layout: Toolbar.background -sticky nswe
Toolbutton
Layout: Toolbutton.border -sticky nswe -children {Toolbutton.focus -sticky nswe -children {Toolbutton.padding -sticky nswe -children {Toolbutton.label -sticky nswe}}}
Treeview
Layout: Treeview.field -sticky nswe -children {Treeview.padding -sticky nswe -children {Treeview.treearea -sticky nswe}}
Style map: -background { selected systemSelectedTextBackgroundColor }
Vertical.TScrollbar
Layout: Vertical.Scrollbar.trough -sticky ns -children {Vertical.Scrollbar.thumb -sticky nswe Vertical.Scrollbar.downarrow -side bottom -sticky {} Vertical.Scrollbar.uparrow -side bottom -sticky {}}
"clam" theme style guide ¶
"Checkbutton.indicator" style element options:
- Indicatorbackground
- [Indicatorforeground]
- Indicatormargin
- [Lowerbordercolor]
- [Upperbordercolor]
"Combobox.field" style element options:
"Radiobutton.indicator" style element options:
- Indicatorbackground
- [Indicatorforeground]
- Indicatormargin
- [Lowerbordercolor]
- [Upperbordercolor]
"Spinbox.downarrow" style element options:
- Arrowcolor
- Arrowsize
- Background
- Bordercolor
- Darkcolor
- Gripsize
- Lightcolor
- Orient
- Sliderlength
- Troughcolor
"Spinbox.uparrow" style element options:
- Arrowcolor
- Arrowsize
- Background
- Bordercolor
- Darkcolor
- Gripsize
- Lightcolor
- Orient
- Sliderlength
- Troughcolor
"arrow" style element options:
- Arrowcolor
- Arrowsize
- Background
- Bordercolor
- Darkcolor
- Gripsize
- Lightcolor
- Orient
- Sliderlength
- Troughcolor
"bar" style element options:
- Arrowcolor
- Arrowsize
- Background
- Bordercolor
- Darkcolor
- Gripsize
- Lightcolor
- Orient
- Sliderlength
- Troughcolor
"border" style element options:
"client" style element options:
"downarrow" style element options:
- Arrowcolor
- Arrowsize
- Background
- Bordercolor
- Darkcolor
- Gripsize
- Lightcolor
- Orient
- Sliderlength
- Troughcolor
"field" style element options:
"hgrip" style element options:
"leftarrow" style element options:
- Arrowcolor
- Arrowsize
- Background
- Bordercolor
- Darkcolor
- Gripsize
- Lightcolor
- Orient
- Sliderlength
- Troughcolor
"pbar" style element options:
- Arrowcolor
- Arrowsize
- Background
- Bordercolor
- Darkcolor
- Gripsize
- Lightcolor
- Orient
- Sliderlength
- Troughcolor
"rightarrow" style element options:
- Arrowcolor
- Arrowsize
- Background
- Bordercolor
- Darkcolor
- Gripsize
- Lightcolor
- Orient
- Sliderlength
- Troughcolor
"slider" style element options:
- Arrowcolor
- Arrowsize
- Background
- Bordercolor
- Darkcolor
- Gripsize
- Lightcolor
- Orient
- Sliderlength
- Troughcolor
"tab" style element options:
"thumb" style element options:
- Arrowcolor
- Arrowsize
- Background
- Bordercolor
- Darkcolor
- Gripsize
- Lightcolor
- Orient
- Sliderlength
- Troughcolor
"trough" style element options:
- Arrowcolor
- Arrowsize
- Background
- Bordercolor
- Darkcolor
- Gripsize
- Lightcolor
- Orient
- Sliderlength
- Troughcolor
"uparrow" style element options:
- Arrowcolor
- Arrowsize
- Background
- Bordercolor
- Darkcolor
- Gripsize
- Lightcolor
- Orient
- Sliderlength
- Troughcolor
"vgrip" style element options:
"clam" theme style list
.
Style map: -selectforeground {!focus white} -foreground {disabled #999999} -selectbackground {!focus #9e9a91} -background {disabled #dcdad5 active #eeebe7}
ComboboxPopdownFrame
Layout: ComboboxPopdownFrame.border -sticky nswe
Heading
Layout: Treeheading.cell -sticky nswe Treeheading.border -sticky nswe -children {Treeheading.padding -sticky nswe -children {Treeheading.image -side right -sticky {} Treeheading.text -sticky we}}
Horizontal.Sash
Layout: Sash.hsash -sticky nswe -children {Sash.hgrip -sticky nswe}
Item
Layout: Treeitem.padding -sticky nswe -children {Treeitem.indicator -side left -sticky {} Treeitem.image -side left -sticky {} Treeitem.text -sticky nswe}
Sash
-
Separator
Layout: Treeitem.separator -sticky nswe
TButton
Layout: Button.border -sticky nswe -border 1 -children {Button.focus -sticky nswe -children {Button.padding -sticky nswe -children {Button.label -sticky nswe}}}
Style map: -lightcolor {pressed #bab5ab} -background {disabled #dcdad5 pressed #bab5ab active #eeebe7} -bordercolor {alternate #000000} -darkcolor {pressed #bab5ab}
TCheckbutton
Layout: Checkbutton.padding -sticky nswe -children {Checkbutton.indicator -side left -sticky {} Checkbutton.focus -side left -sticky w -children {Checkbutton.label -sticky nswe}}
Style map: -indicatorbackground {pressed #dcdad5 {!disabled alternate} #5895bc {disabled alternate} #a0a0a0 disabled #dcdad5}
TCombobox
Layout: Combobox.downarrow -side right -sticky ns Combobox.field -sticky nswe -children {Combobox.padding -sticky nswe -children {Combobox.textarea -sticky nswe}}
Style map: -foreground {{readonly focus} #ffffff} -fieldbackground {{readonly focus} #4a6984 readonly #dcdad5} -background {active #eeebe7 pressed #eeebe7} -bordercolor {focus #4a6984} -arrowcolor {disabled #999999}
TEntry
Layout: Entry.field -sticky nswe -border 1 -children {Entry.padding -sticky nswe -children {Entry.textarea -sticky nswe}}
Style map: -lightcolor {focus #6f9dc6} -background {readonly #dcdad5} -bordercolor {focus #4a6984}
TLabelframe
Layout: Labelframe.border -sticky nswe
TMenubutton
Layout: Menubutton.border -sticky nswe -children {Menubutton.focus -sticky nswe -children {Menubutton.indicator -side right -sticky {} Menubutton.padding -sticky we -children {Menubutton.label -side left -sticky {}}}}
TNotebook.Tab
Layout: Notebook.tab -sticky nswe -children {Notebook.padding -side top -sticky nswe -children {Notebook.focus -side top -sticky nswe -children {Notebook.label -side top -sticky {}}}}
Style map: -lightcolor {selected #eeebe7 {} #cfcdc8} -padding {selected {4.5p 3p 4.5p 1.5p}} -background {selected #dcdad5 {} #bab5ab}
TProgressbar
-
TRadiobutton
Layout: Radiobutton.padding -sticky nswe -children {Radiobutton.indicator -side left -sticky {} Radiobutton.focus -side left -sticky {} -children {Radiobutton.label -sticky nswe}}
Style map: -indicatorbackground {pressed #dcdad5 {!disabled alternate} #5895bc {disabled alternate} #a0a0a0 disabled #dcdad5}
TScale
-
TScrollbar
-
TSpinbox
Layout: Spinbox.field -side top -sticky we -children {null -side right -sticky {} -children {Spinbox.uparrow -side top -sticky e Spinbox.downarrow -side bottom -sticky e} Spinbox.padding -sticky nswe -children {Spinbox.textarea -sticky nswe}}
Style map: -background {readonly #dcdad5} -bordercolor {focus #4a6984} -arrowcolor {disabled #999999}
Tab
Layout: Notebook.tab -sticky nswe -children {Notebook.padding -side top -sticky nswe -children {Notebook.focus -side top -sticky nswe -children {Notebook.label -side top -sticky {}}}}
Toolbutton
Layout: Toolbutton.border -sticky nswe -children {Toolbutton.focus -sticky nswe -children {Toolbutton.padding -sticky nswe -children {Toolbutton.label -sticky nswe}}}
Style map: -lightcolor {pressed #bab5ab} -relief {disabled flat selected sunken pressed sunken active raised} -background {disabled #dcdad5 pressed #bab5ab active #eeebe7} -darkcolor {pressed #bab5ab}
Treeview
Layout: Treeview.field -sticky nswe -border 1 -children {Treeview.padding -sticky nswe -children {Treeview.treearea -sticky nswe}}
Style map: -foreground {disabled #999999 selected #ffffff} -background {disabled #dcdad5 selected #4a6984} -bordercolor {focus #4a6984}
Treeview.Separator
Layout: Treeitem.separator -sticky nswe
Vertical.Sash
Layout: Sash.vsash -sticky nswe -children {Sash.vgrip -sticky nswe}
"classic" theme style guide ¶
"Button.border" style element options:
"Checkbutton.indicator" style element options:
"Combobox.downarrow" style element options:
"Menubutton.indicator" style element options:
- Background
- [Indicatorborderwidth]
- [Indicatorheight]
- Indicatormargin
- Indicatorrelief
- [Indicatorwidth]
"Radiobutton.indicator" style element options:
"Spinbox.downarrow" style element options:
"Spinbox.uparrow" style element options:
"arrow" style element options:
"downarrow" style element options:
"highlight" style element options:
"hsash" style element options:
"leftarrow" style element options:
"rightarrow" style element options:
"slider" style element options:
- Background
- Orient
- [Sliderborderwidth]
- Sliderlength
- Sliderrelief
- [Sliderthickness]
"uparrow" style element options:
"vsash" style element options:
"classic" theme style list
.
Style map: -highlightcolor {focus black} -foreground {disabled #a3a3a3} -background {disabled #d9d9d9 active #ececec}
ComboboxPopdownFrame
Layout: ComboboxPopdownFrame.border -sticky nswe
Heading
Layout: Treeheading.cell -sticky nswe Treeheading.border -sticky nswe -children {Treeheading.padding -sticky nswe -children {Treeheading.image -side right -sticky {} Treeheading.text -sticky we}}
Horizontal.TScale
Layout: Horizontal.Scale.highlight -sticky nswe -children {Horizontal.Scale.trough -sticky nswe -children {Horizontal.Scale.slider -side left -sticky {}}}
Item
Layout: Treeitem.padding -sticky nswe -children {Treeitem.indicator -side left -sticky {} Treeitem.image -side left -sticky {} Treeitem.text -sticky nswe}
Sash
-
Separator
Layout: Treeitem.separator -sticky nswe
TButton
Layout: Button.highlight -sticky nswe -children {Button.border -sticky nswe -border 1 -children {Button.padding -sticky nswe -children {Button.label -sticky nswe}}}
Style map: -relief {{!disabled pressed} sunken}
TCheckbutton
Layout: Checkbutton.highlight -sticky nswe -children {Checkbutton.border -sticky nswe -children {Checkbutton.padding -sticky nswe -children {Checkbutton.indicator -side left -sticky {} Checkbutton.label -side left -sticky nswe}}}
Style map: -indicatorrelief {alternate raised selected sunken pressed sunken} -indicatorcolor {pressed #d9d9d9 alternate #b05e5e selected #b03060}
TCombobox
Layout: Combobox.highlight -sticky nswe -children {Combobox.field -sticky nswe -children {Combobox.downarrow -side right -sticky ns Combobox.padding -sticky nswe -children {Combobox.textarea -sticky nswe}}}
Style map: -fieldbackground {readonly #d9d9d9 disabled #d9d9d9}
TEntry
Layout: Entry.highlight -sticky nswe -children {Entry.field -sticky nswe -border 1 -children {Entry.padding -sticky nswe -children {Entry.textarea -sticky nswe}}}
Style map: -fieldbackground {readonly #d9d9d9 disabled #d9d9d9}
TLabelframe
Layout: Labelframe.border -sticky nswe
TMenubutton
Layout: Menubutton.highlight -sticky nswe -children {Menubutton.border -sticky nswe -children {Menubutton.indicator -side right -sticky {} Menubutton.padding -sticky we -children {Menubutton.label -sticky {}}}}
TNotebook.Tab
Layout: Notebook.tab -sticky nswe -children {Notebook.padding -side top -sticky nswe -children {Notebook.focus -side top -sticky nswe -children {Notebook.label -side top -sticky {}}}}
Style map: -background {selected #d9d9d9}
TProgressbar
-
TRadiobutton
Layout: Radiobutton.highlight -sticky nswe -children {Radiobutton.border -sticky nswe -children {Radiobutton.padding -sticky nswe -children {Radiobutton.indicator -side left -sticky {} Radiobutton.label -side left -sticky nswe}}}
Style map: -indicatorrelief {alternate raised selected sunken pressed sunken} -indicatorcolor {pressed #d9d9d9 alternate #b05e5e selected #b03060}
TScale
Style map: -sliderrelief {{pressed !disabled} sunken}
TScrollbar
Style map: -relief {{pressed !disabled} sunken}
TSpinbox
Layout: Spinbox.highlight -sticky nswe -children {Spinbox.field -sticky nswe -children {null -side right -sticky {} -children {Spinbox.uparrow -side top -sticky e Spinbox.downarrow -side bottom -sticky e} Spinbox.padding -sticky nswe -children {Spinbox.textarea -sticky nswe}}}
Style map: -fieldbackground {readonly #d9d9d9 disabled #d9d9d9}
Tab
Layout: Notebook.tab -sticky nswe -children {Notebook.padding -side top -sticky nswe -children {Notebook.focus -side top -sticky nswe -children {Notebook.label -side top -sticky {}}}}
Toolbutton
Layout: Toolbutton.focus -sticky nswe -children {Toolbutton.border -sticky nswe -children {Toolbutton.padding -sticky nswe -children {Toolbutton.label -sticky nswe}}}
Style map: -relief {disabled flat selected sunken pressed sunken active raised} -background {pressed #b3b3b3 active #ececec}
Treeview
Layout: Treeview.highlight -sticky nswe -children {Treeview.field -sticky nswe -border 1 -children {Treeview.padding -sticky nswe -children {Treeview.treearea -sticky nswe}}}
Style map: -foreground {disabled #a3a3a3 selected #000000} -background {disabled #d9d9d9 selected #c3c3c3}
Treeview.Separator
Layout: Treeitem.separator -sticky nswe
Vertical.TScale
Layout: Vertical.Scale.highlight -sticky nswe -children {Vertical.Scale.trough -sticky nswe -children {Vertical.Scale.slider -side top -sticky {}}}
"default" theme style guide ¶
"" style element options:
"Checkbutton.indicator" style element options:
- Bordercolor
- Indicatorbackground
- [Indicatorforeground]
- Indicatormargin
"Combobox.downarrow" style element options:
"Menubutton.indicator" style element options:
- Arrowcolor
- [Arrowpadding]
- Arrowsize
"Radiobutton.indicator" style element options:
- Bordercolor
- Indicatorbackground
- [Indicatorforeground]
- Indicatormargin
"Spinbox.downarrow" style element options:
"Spinbox.uparrow" style element options:
"Treeheading.cell" style element options:
- Background
- [Rownumber]
"Treeitem.indicator" style element options:
"Treeitem.row" style element options:
- Background
- [Rownumber]
"Treeitem.separator" style element options:
- Background
- [Rownumber]
"arrow" style element options:
"background" style element options:
"border" style element options:
"client" style element options:
- Background
- Borderwidth
- [Highlight]
- Highlightcolor
"ctext" style element options:
- Anchor
- [Embossed]
- Font
- Foreground
- Justify
- Text
- Underline
- Width
- Wraplength
"downarrow" style element options:
"field" style element options:
- Borderwidth
- Fieldbackground
- Focuscolor
- [Focuswidth]
"fill" style element options:
"focus" style element options:
"hsash" style element options:
"hseparator" style element options:
"image" style element options:
"indicator" style element options:
"label" style element options:
- Anchor
- Background
- Compound
- [Embossed]
- Font
- Foreground
- Image
- Justify
- [Space]
- Stipple
- Text
- Underline
- Width
- Wraplength
"leftarrow" style element options:
"padding" style element options:
"pbar" style element options:
- Background
- [Barsize]
- Borderwidth
- Orient
- [Pbarrelief]
- [Thickness]
"rightarrow" style element options:
"separator" style element options:
"sizegrip" style element options:
"slider" style element options:
- Bordercolor
- [Innercolor]
- Orient
- [Outercolor]
"tab" style element options:
- Background
- Borderwidth
- [Highlight]
- Highlightcolor
"text" style element options:
- Anchor
- [Embossed]
- Font
- Foreground
- Justify
- Text
- Underline
- Width
- Wraplength
"textarea" style element options:
"thumb" style element options:
"treearea" style element options:
"trough" style element options:
- Groovewidth
- Orient
- [Troughborderwidth]
- Troughcolor
- Troughrelief
"uparrow" style element options:
"vsash" style element options:
"vseparator" style element options:
"default" theme style list
.
Style map: -foreground {disabled #a3a3a3} -background {disabled #edeceb active #ececec}
Cell
Layout: Treedata.padding -sticky nswe -children {Treeitem.image -side left -sticky {} Treeitem.text -sticky nswe}
ComboboxPopdownFrame
Layout: ComboboxPopdownFrame.border -sticky nswe
Heading
Layout: Treeheading.cell -sticky nswe Treeheading.border -sticky nswe -children {Treeheading.padding -sticky nswe -children {Treeheading.image -side right -sticky {} Treeheading.text -sticky we}}
Horizontal.Sash
Layout: Sash.hsash -sticky we
Horizontal.TProgressbar
Layout: Horizontal.Progressbar.trough -sticky nswe -children {Horizontal.Progressbar.pbar -side left -sticky ns Horizontal.Progressbar.ctext -side left -sticky {}}
Horizontal.TScale
Layout: Horizontal.Scale.focus -sticky nswe -children {Horizontal.Scale.padding -sticky nswe -children {Horizontal.Scale.trough -sticky nswe -children {Horizontal.Scale.slider -side left -sticky {}}}}
Horizontal.TScrollbar
Layout: Horizontal.Scrollbar.trough -sticky we -children {Horizontal.Scrollbar.leftarrow -side left -sticky {} Horizontal.Scrollbar.rightarrow -side right -sticky {} Horizontal.Scrollbar.thumb -sticky nswe}
Item
Layout: Treeitem.padding -sticky nswe -children {Treeitem.indicator -side left -sticky {} Treeitem.image -side left -sticky {} Treeitem.text -sticky nswe}
Label
Layout: Label.fill -sticky nswe -children {Label.text -sticky nswe}
Row
Layout: Treeitem.row -sticky nswe
Sash
-
Separator
Layout: Treeitem.separator -sticky nswe
TButton
Layout: Button.border -sticky nswe -border 1 -children {Button.focus -sticky nswe -children {Button.padding -sticky nswe -children {Button.label -sticky nswe}}}
Style map: -relief {{!disabled pressed} sunken}
TCheckbutton
Layout: Checkbutton.padding -sticky nswe -children {Checkbutton.indicator -side left -sticky {} Checkbutton.focus -side left -sticky w -children {Checkbutton.label -sticky nswe}}
Style map: -indicatorbackground {{alternate disabled} #a3a3a3 {alternate pressed} #5895bc alternate #4a6984 {selected disabled} #a3a3a3 {selected pressed} #5895bc selected #4a6984 disabled #edeceb pressed #c3c3c3}
TCombobox
Layout: Combobox.field -sticky nswe -children {Combobox.downarrow -side right -sticky ns Combobox.padding -sticky nswe -children {Combobox.textarea -sticky nswe}}
Style map: -fieldbackground {readonly #edeceb disabled #edeceb} -arrowcolor {disabled #a3a3a3}
TEntry
Layout: Entry.field -sticky nswe -border 1 -children {Entry.padding -sticky nswe -children {Entry.textarea -sticky nswe}}
Style map: -fieldbackground {readonly #edeceb disabled #edeceb}
TFrame
Layout: Frame.border -sticky nswe
TLabel
Layout: Label.border -sticky nswe -border 1 -children {Label.padding -sticky nswe -border 1 -children {Label.label -sticky nswe}}
TLabelframe
Layout: Labelframe.border -sticky nswe
TMenubutton
Layout: Menubutton.border -sticky nswe -children {Menubutton.focus -sticky nswe -children {Menubutton.indicator -side right -sticky {} Menubutton.padding -sticky we -children {Menubutton.label -side left -sticky {}}}}
Style map: -arrowcolor {disabled #a3a3a3}
TNotebook
Layout: Notebook.client -sticky nswe
TNotebook.Tab
Layout: Notebook.tab -sticky nswe -children {Notebook.padding -side top -sticky nswe -children {Notebook.focus -side top -sticky nswe -children {Notebook.label -side top -sticky {}}}}
Style map: -highlightcolor {selected #4a6984} -highlight {selected 1} -background {selected #edeceb}
TPanedwindow
Layout: Panedwindow.background -sticky {}
TProgressbar
-
TRadiobutton
Layout: Radiobutton.padding -sticky nswe -children {Radiobutton.indicator -side left -sticky {} Radiobutton.focus -side left -sticky {} -children {Radiobutton.label -sticky nswe}}
Style map: -indicatorbackground {{alternate disabled} #a3a3a3 {alternate pressed} #5895bc alternate #4a6984 {selected disabled} #a3a3a3 {selected pressed} #5895bc selected #4a6984 disabled #edeceb pressed #c3c3c3}
TScale
Style map: -outercolor {active #ececec}
TScrollbar
Style map: -arrowcolor {disabled #a3a3a3}
TSeparator
Layout: Separator.separator -sticky nswe
TSizegrip
Layout: Sizegrip.sizegrip -side bottom -sticky se
TSpinbox
Layout: Spinbox.field -side top -sticky we -children {null -side right -sticky {} -children {Spinbox.uparrow -side top -sticky e Spinbox.downarrow -side bottom -sticky e} Spinbox.padding -sticky nswe -children {Spinbox.textarea -sticky nswe}}
Style map: -fieldbackground {readonly #edeceb disabled #edeceb} -arrowcolor {disabled #a3a3a3}
Tab
Layout: Notebook.tab -sticky nswe -children {Notebook.padding -side top -sticky nswe -children {Notebook.focus -side top -sticky nswe -children {Notebook.label -side top -sticky {}}}}
Toolbutton
Layout: Toolbutton.border -sticky nswe -children {Toolbutton.focus -sticky nswe -children {Toolbutton.padding -sticky nswe -children {Toolbutton.label -sticky nswe}}}
Style map: -relief {disabled flat selected sunken pressed sunken active raised} -background {pressed #c3c3c3 active #ececec}
Treeview
Layout: Treeview.field -sticky nswe -border 1 -children {Treeview.padding -sticky nswe -children {Treeview.treearea -sticky nswe}}
Style map: -foreground {disabled #a3a3a3 selected #ffffff} -background {disabled #edeceb selected #4a6984}
Treeview.Separator
Layout: Treeitem.separator -sticky nswe
Vertical.Sash
Layout: Sash.vsash -sticky ns
Vertical.TProgressbar
Layout: Vertical.Progressbar.trough -sticky nswe -children {Vertical.Progressbar.pbar -side bottom -sticky we}
Vertical.TScale
Layout: Vertical.Scale.focus -sticky nswe -children {Vertical.Scale.padding -sticky nswe -children {Vertical.Scale.trough -sticky nswe -children {Vertical.Scale.slider -side top -sticky {}}}}
Vertical.TScrollbar
Layout: Vertical.Scrollbar.trough -sticky ns -children {Vertical.Scrollbar.uparrow -side top -sticky {} Vertical.Scrollbar.downarrow -side bottom -sticky {} Vertical.Scrollbar.thumb -sticky nswe}PASS
"vista" theme style guide ¶
"Combobox.background" style element options:
"Combobox.border" style element options:
"Combobox.rightdownarrow" style element options:
"ComboboxPopdownFrame.background" style element options:
"Entry.background" style element options:
"Entry.field" style element options:
"Horizontal.Progressbar.pbar" style element options:
"Horizontal.Scale.slider" style element options:
"Horizontal.Scrollbar.grip" style element options:
"Horizontal.Scrollbar.leftarrow" style element options:
"Horizontal.Scrollbar.rightarrow" style element options:
"Horizontal.Scrollbar.thumb" style element options:
"Horizontal.Scrollbar.trough" style element options:
"Menubutton.dropdown" style element options:
"Spinbox.background" style element options:
"Spinbox.downarrow" style element options:
"Spinbox.field" style element options:
"Spinbox.innerbg" style element options:
"Spinbox.uparrow" style element options:
"Vertical.Progressbar.pbar" style element options:
"Vertical.Scale.slider" style element options:
"Vertical.Scrollbar.downarrow" style element options:
"Vertical.Scrollbar.grip" style element options:
"Vertical.Scrollbar.thumb" style element options:
"Vertical.Scrollbar.trough" style element options:
"Vertical.Scrollbar.uparrow" style element options:
"vista" theme style list
.
Style map: -foreground {disabled SystemGrayText}
ComboboxPopdownFrame
Layout: ComboboxPopdownFrame.background -sticky nswe -border 1 -children {ComboboxPopdownFrame.padding -sticky nswe}
Heading
Layout: Treeheading.cell -sticky nswe Treeheading.border -sticky nswe -children {Treeheading.padding -sticky nswe -children {Treeheading.image -side right -sticky {} Treeheading.text -sticky we}}
Horizontal.TProgressbar
Layout: Horizontal.Progressbar.trough -sticky nswe -children {Horizontal.Progressbar.pbar -side left -sticky ns Horizontal.Progressbar.ctext -sticky nswe}
Horizontal.TScale
Layout: Scale.focus -sticky nswe -children {Horizontal.Scale.trough -sticky nswe -children {Horizontal.Scale.track -sticky we Horizontal.Scale.slider -side left -sticky {}}}
Item
Layout: Treeitem.padding -sticky nswe -children {Treeitem.indicator -side left -sticky {} Treeitem.image -side left -sticky {} Treeitem.text -sticky nswe}
Label
Layout: Label.fill -sticky nswe -children {Label.text -sticky nswe}
Separator
Layout: Treeitem.separator -sticky nswe
TButton
Layout: Button.button -sticky nswe -children {Button.focus -sticky nswe -children {Button.padding -sticky nswe -children {Button.label -sticky nswe}}}
TCheckbutton
Layout: Checkbutton.padding -sticky nswe -children {Checkbutton.indicator -side left -sticky {} Checkbutton.focus -side left -sticky w -children {Checkbutton.label -sticky nswe}}
TCombobox
Layout: Combobox.border -sticky nswe -children {Combobox.rightdownarrow -side right -sticky ns Combobox.padding -sticky nswe -children {Combobox.background -sticky nswe -children {Combobox.focus -sticky nswe -children {Combobox.textarea -sticky nswe}}}}
Style map: -focusfill {{readonly focus} SystemHighlight} -foreground {disabled SystemGrayText {readonly focus} SystemHighlightText} -selectforeground {!focus SystemWindowText} -selectbackground {!focus SystemWindow}
TEntry
Layout: Entry.field -sticky nswe -children {Entry.background -sticky nswe -children {Entry.padding -sticky nswe -children {Entry.textarea -sticky nswe}}}
Style map: -selectforeground {!focus SystemWindowText} -selectbackground {!focus SystemWindow}
TLabelframe.Label
Layout: Label.fill -sticky nswe -children {Label.text -sticky nswe}
TMenubutton
Layout: Menubutton.dropdown -side right -sticky ns Menubutton.button -sticky nswe -children {Menubutton.padding -sticky we -children {Menubutton.label -sticky {}}}
TNotebook
Layout: Notebook.client -sticky nswe
TNotebook.Tab
Layout: Notebook.tab -sticky nswe -children {Notebook.padding -side top -sticky nswe -children {Notebook.focus -side top -sticky nswe -children {Notebook.label -side top -sticky {}}}}
Style map: -expand {selected {2 2 2 2}}
TProgressbar
-
TRadiobutton
Layout: Radiobutton.padding -sticky nswe -children {Radiobutton.indicator -side left -sticky {} Radiobutton.focus -side left -sticky {} -children {Radiobutton.label -sticky nswe}}
TScale
-
TSpinbox
Layout: Spinbox.field -sticky nswe -children {Spinbox.background -sticky nswe -children {Spinbox.padding -sticky nswe -children {Spinbox.innerbg -sticky nswe -children {Spinbox.textarea -sticky nswe}} Spinbox.uparrow -side top -sticky nse Spinbox.downarrow -side bottom -sticky nse}}
Style map: -selectforeground {!focus SystemWindowText} -selectbackground {!focus SystemWindow}
Tab
Layout: Notebook.tab -sticky nswe -children {Notebook.padding -side top -sticky nswe -children {Notebook.focus -side top -sticky nswe -children {Notebook.label -side top -sticky {}}}}
Toolbutton
Layout: Toolbutton.border -sticky nswe -children {Toolbutton.focus -sticky nswe -children {Toolbutton.padding -sticky nswe -children {Toolbutton.label -sticky nswe}}}
Treeview
Layout: Treeview.field -sticky nswe -border 1 -children {Treeview.padding -sticky nswe -children {Treeview.treearea -sticky nswe}}
Style map: -foreground {disabled SystemGrayText selected SystemHighlightText} -background {disabled SystemButtonFace selected SystemHighlight}
Treeview.Separator
Layout: Treeitem.separator -sticky nswe
Vertical.TProgressbar
Layout: Vertical.Progressbar.trough -sticky nswe -children {Vertical.Progressbar.pbar -side bottom -sticky we}
Vertical.TScale
Layout: Scale.focus -sticky nswe -children {Vertical.Scale.trough -sticky nswe -children {Vertical.Scale.track -sticky ns Vertical.Scale.slider -side top -sticky {}}}
"winnative" theme style guide ¶
"Button.border" style element options:
"Checkbutton.indicator" style element options:
"Combobox.focus" style element options:
"ComboboxPopdownFrame.border" style element options:
"Radiobutton.indicator" style element options:
"Scrollbar.trough" style element options:
"Spinbox.downarrow" style element options:
"Spinbox.uparrow" style element options:
"border" style element options:
"client" style element options:
"downarrow" style element options:
"field" style element options:
"focus" style element options:
"leftarrow" style element options:
"rightarrow" style element options:
"sizegrip" style element options:
"slider" style element options:
"tab" style element options:
"thumb" style element options:
"uparrow" style element options:
"winnative" theme style list
.
Style map: -foreground {disabled SystemGrayText} -embossed {disabled 1}
ComboboxPopdownFrame
Layout: ComboboxPopdownFrame.border -sticky nswe
Heading
Layout: Treeheading.cell -sticky nswe Treeheading.border -sticky nswe -children {Treeheading.padding -sticky nswe -children {Treeheading.image -side right -sticky {} Treeheading.text -sticky we}}
Item
Layout: Treeitem.padding -sticky nswe -children {Treeitem.indicator -side left -sticky {} Treeitem.image -side left -sticky {} Treeitem.text -sticky nswe}
Label
Layout: Label.fill -sticky nswe -children {Label.text -sticky nswe}
Separator
Layout: Treeitem.separator -sticky nswe
TButton
Layout: Button.border -sticky nswe -children {Button.padding -sticky nswe -children {Button.label -sticky nswe}}
Style map: -relief {{!disabled pressed} sunken}
TCheckbutton
Layout: Checkbutton.padding -sticky nswe -children {Checkbutton.indicator -side left -sticky {} Checkbutton.focus -side left -sticky w -children {Checkbutton.label -sticky nswe}}
TCombobox
Layout: Combobox.field -sticky nswe -children {Combobox.downarrow -side right -sticky ns Combobox.padding -sticky nswe -children {Combobox.focus -sticky nswe -children {Combobox.textarea -sticky nswe}}}
Style map: -focusfill {{readonly focus} SystemHighlight} -foreground {disabled SystemGrayText {readonly focus} SystemHighlightText} -selectforeground {!focus SystemWindowText} -fieldbackground {readonly SystemButtonFace disabled SystemButtonFace} -selectbackground {!focus SystemWindow}
TEntry
Layout: Entry.field -sticky nswe -border 1 -children {Entry.padding -sticky nswe -children {Entry.textarea -sticky nswe}}
Style map: -selectforeground {!focus SystemWindowText} -selectbackground {!focus SystemWindow} -fieldbackground {readonly SystemButtonFace disabled SystemButtonFace}
TLabelframe
Layout: Labelframe.border -sticky nswe
TLabelframe.Label
Layout: Label.fill -sticky nswe -children {Label.text -sticky nswe}
TMenubutton
Layout: Menubutton.border -sticky nswe -children {Menubutton.focus -sticky nswe -children {Menubutton.indicator -side right -sticky {} Menubutton.padding -sticky we -children {Menubutton.label -side left -sticky {}}}}
TNotebook
Layout: Notebook.client -sticky nswe
TNotebook.Tab
Layout: Notebook.tab -sticky nswe -children {Notebook.padding -side top -sticky nswe -children {Notebook.focus -side top -sticky nswe -children {Notebook.label -side top -sticky {}}}}
Style map: -expand {selected {2 2 2 0}}
TProgressbar
-
TRadiobutton
Layout: Radiobutton.padding -sticky nswe -children {Radiobutton.indicator -side left -sticky {} Radiobutton.focus -side left -sticky {} -children {Radiobutton.label -sticky nswe}}
TScale
-
TSpinbox
Layout: Spinbox.field -side top -sticky we -children {null -side right -sticky {} -children {Spinbox.uparrow -side top -sticky e Spinbox.downarrow -side bottom -sticky e} Spinbox.padding -sticky nswe -children {Spinbox.textarea -sticky nswe}}
Tab
Layout: Notebook.tab -sticky nswe -children {Notebook.padding -side top -sticky nswe -children {Notebook.focus -side top -sticky nswe -children {Notebook.label -side top -sticky {}}}}
Toolbutton
Layout: Toolbutton.border -sticky nswe -children {Toolbutton.focus -sticky nswe -children {Toolbutton.padding -sticky nswe -children {Toolbutton.label -sticky nswe}}}
Style map: -relief {disabled flat selected sunken pressed sunken active raised}
Treeview
Layout: Treeview.field -sticky nswe -border 1 -children {Treeview.padding -sticky nswe -children {Treeview.treearea -sticky nswe}}
Style map: -foreground {disabled SystemGrayText selected SystemHighlightText} -background {disabled SystemButtonFace selected SystemHighlight}
Treeview.Separator
Layout: Treeitem.separator -sticky nswe
"xpnative" theme style guide ¶
"Button.button" style element options:
"Checkbutton.indicator" style element options:
"Combobox.downarrow" style element options:
"Combobox.field" style element options:
"Entry.field" style element options:
"Horizontal.Progressbar.pbar" style element options:
"Horizontal.Progressbar.trough" style element options:
"Horizontal.Scale.slider" style element options:
"Horizontal.Scale.track" style element options:
"Horizontal.Scrollbar.grip" style element options:
"Horizontal.Scrollbar.thumb" style element options:
"Horizontal.Scrollbar.trough" style element options:
"Labelframe.border" style element options:
"Menubutton.button" style element options:
"Menubutton.dropdown" style element options:
"NotebookPane.background" style element options:
"Radiobutton.indicator" style element options:
"Scale.trough" style element options:
"Scrollbar.downarrow" style element options:
"Scrollbar.leftarrow" style element options:
"Scrollbar.rightarrow" style element options:
"Scrollbar.uparrow" style element options:
"Spinbox.downarrow" style element options:
"Spinbox.field" style element options:
"Spinbox.uparrow" style element options:
"Toolbutton.border" style element options:
"Treeheading.border" style element options:
"Treeitem.indicator" style element options:
"Treeview.field" style element options:
"Vertical.Progressbar.pbar" style element options:
"Vertical.Progressbar.trough" style element options:
"Vertical.Scale.slider" style element options:
"Vertical.Scale.track" style element options:
"Vertical.Scrollbar.grip" style element options:
"Vertical.Scrollbar.thumb" style element options:
"Vertical.Scrollbar.trough" style element options:
"client" style element options:
"sizegrip" style element options:
"tab" style element options:
"xpnative" theme style list
.
Style map: -foreground {disabled SystemGrayText}
Heading
Layout: Treeheading.cell -sticky nswe Treeheading.border -sticky nswe -children {Treeheading.padding -sticky nswe -children {Treeheading.image -side right -sticky {} Treeheading.text -sticky we}}
Horizontal.TScale
Layout: Scale.focus -sticky nswe -children {Horizontal.Scale.trough -sticky nswe -children {Horizontal.Scale.track -sticky we Horizontal.Scale.slider -side left -sticky {}}}
Horizontal.TScrollbar
Layout: Horizontal.Scrollbar.trough -sticky we -children {Horizontal.Scrollbar.leftarrow -side left -sticky {} Horizontal.Scrollbar.rightarrow -side right -sticky {} Horizontal.Scrollbar.thumb -sticky nswe -unit 1 -children {Horizontal.Scrollbar.grip -sticky {}}}
Item
Layout: Treeitem.padding -sticky nswe -children {Treeitem.indicator -side left -sticky {} Treeitem.image -side left -sticky {} Treeitem.text -sticky nswe}
Label
Layout: Label.fill -sticky nswe -children {Label.text -sticky nswe}
Separator
Layout: Treeitem.separator -sticky nswe
TButton
Layout: Button.button -sticky nswe -children {Button.focus -sticky nswe -children {Button.padding -sticky nswe -children {Button.label -sticky nswe}}}
TCheckbutton
Layout: Checkbutton.padding -sticky nswe -children {Checkbutton.indicator -side left -sticky {} Checkbutton.focus -side left -sticky w -children {Checkbutton.label -sticky nswe}}
TCombobox
Layout: Combobox.field -sticky nswe -children {Combobox.downarrow -side right -sticky ns Combobox.padding -sticky nswe -children {Combobox.focus -sticky nswe -children {Combobox.textarea -sticky nswe}}}
Style map: -focusfill {{readonly focus} SystemHighlight} -foreground {disabled SystemGrayText {readonly focus} SystemHighlightText} -selectforeground {!focus SystemWindowText} -selectbackground {!focus SystemWindow}
TEntry
Layout: Entry.field -sticky nswe -border 1 -children {Entry.padding -sticky nswe -children {Entry.textarea -sticky nswe}}
Style map: -selectforeground {!focus SystemWindowText} -selectbackground {!focus SystemWindow}
TLabelframe.Label
Layout: Label.fill -sticky nswe -children {Label.text -sticky nswe}
TMenubutton
Layout: Menubutton.dropdown -side right -sticky ns Menubutton.button -sticky nswe -children {Menubutton.padding -sticky we -children {Menubutton.label -sticky {}}}
TNotebook
Layout: Notebook.client -sticky nswe
TNotebook.Tab
Layout: Notebook.tab -sticky nswe -children {Notebook.padding -side top -sticky nswe -children {Notebook.focus -side top -sticky nswe -children {Notebook.label -side top -sticky {}}}}
Style map: -expand {selected {2 2 2 2}}
TProgressbar
-
TRadiobutton
Layout: Radiobutton.padding -sticky nswe -children {Radiobutton.indicator -side left -sticky {} Radiobutton.focus -side left -sticky {} -children {Radiobutton.label -sticky nswe}}
TScale
-
TScrollbar
-
TSpinbox
Layout: Spinbox.field -side top -sticky we -children {null -side right -sticky {} -children {Spinbox.uparrow -side top -sticky e Spinbox.downarrow -side bottom -sticky e} Spinbox.padding -sticky nswe -children {Spinbox.textarea -sticky nswe}}
Style map: -selectforeground {!focus SystemWindowText} -selectbackground {!focus SystemWindow}
Tab
Layout: Notebook.tab -sticky nswe -children {Notebook.padding -side top -sticky nswe -children {Notebook.focus -side top -sticky nswe -children {Notebook.label -side top -sticky {}}}}
Toolbutton
Layout: Toolbutton.border -sticky nswe -children {Toolbutton.focus -sticky nswe -children {Toolbutton.padding -sticky nswe -children {Toolbutton.label -sticky nswe}}}
Treeview
Layout: Treeview.field -sticky nswe -border 1 -children {Treeview.padding -sticky nswe -children {Treeview.treearea -sticky nswe}}
Style map: -foreground {disabled SystemGrayText selected SystemHighlightText} -background {disabled SystemButtonFace selected SystemHighlight}
Treeview.Separator
Layout: Treeitem.separator -sticky nswe
Vertical.TScale
Layout: Scale.focus -sticky nswe -children {Vertical.Scale.trough -sticky nswe -children {Vertical.Scale.track -sticky ns Vertical.Scale.slider -side top -sticky {}}}
Vertical.TScrollbar
Layout: Vertical.Scrollbar.trough -sticky ns -children {Vertical.Scrollbar.uparrow -side top -sticky {} Vertical.Scrollbar.downarrow -side bottom -sticky {} Vertical.Scrollbar.thumb -sticky nswe -unit 1 -children {Vertical.Scrollbar.grip -sticky {}}}PASS
Index ¶
- Constants
- Variables
- func ActivateTheme(name string) (err error)
- func Bell(options ...Opt)
- func Bind(options ...any)
- func Bindtags(w *Window, tagList ...any) (r []string)
- func ChooseColor(options ...Opt) string
- func ChooseDirectory(options ...Opt) string
- func ClipboardAppend(data string, options ...Opt)
- func ClipboardClear(options ...Opt)
- func ClipboardGet(options ...Opt) string
- func CourierFont() string
- func CurrentThemeName() (r string)
- func Destroy(options ...Opt)
- func Finalize() (err error)
- func Focus(options ...Opt) string
- func FontConfigure(name string, options ...any) []string
- func FontFamilies(options ...Opt) []string
- func Fontchooser(options ...Opt)
- func FontchooserFont() []string
- func FontchooserHide()
- func FontchooserShow()
- func GetOpenFile(options ...Opt) (r []string)
- func GetSaveFile(options ...Opt) string
- func Grab(options ...Opt)
- func GrabCurrent(options ...Opt) []string
- func GrabRelease(w Opt)
- func GrabSet(options ...Opt)
- func GrabStatus(w Opt) string
- func Grid(w Widget, options ...Opt)
- func GridAnchor(w *Window, anchor string) string
- func GridColumnConfigure(w Widget, index int, options ...Opt)
- func GridForget(w ...*Window)
- func GridRemove(w ...*Window)
- func GridRowConfigure(w Widget, index int, options ...Opt)
- func Initialize()
- func InitializeExtension(name string) (err error)
- func MessageBox(options ...Opt) string
- func Pack(options ...Opt)
- func Place(options ...Opt)
- func Popup(menu *Window, x, y int, entry any)
- func StyleConfigure(style string, options ...any) []string
- func StyleElementCreate(elementName, typ string, options ...any) string
- func StyleElementNames() []string
- func StyleElementOptions(element string) []string
- func StyleLayout(style string, options ...any) string
- func StyleLookup(style string, options ...any) string
- func StyleMap(style string, options ...any) string
- func StyleThemeNames() []string
- func StyleThemeStyles(themeName ...string) []string
- func StyleThemeUse(themeName ...string) string
- func TclAfter(ms time.Duration, script ...any) string
- func TclAfterCancel(id string)
- func TclAfterIdle(script any) string
- func TeX(src string, scale float64) (png []byte)
- func TeX2(src string, scale float64) (png []byte, err error)
- func TeXImg(src string, scale float64) (img image.Image)
- func TeXImg2(src string, scale float64) (img image.Image, err error)
- func TkScaling(options ...any) float64
- func TooltipClear(pattern string)
- func TooltipConfigure(options ...any) string
- func TooltipDelay(delay time.Duration) string
- func TooltipFade(v bool) string
- func TooltipOff(v bool) string
- func TooltipOn(v bool) string
- func Update()
- func WinfoHeight(w *Window) string
- func WinfoScreenHeight(w *Window) string
- func WinfoScreenWidth(w *Window) string
- func WinfoWidth(w *Window) string
- func WmAttributes(w *Window, options ...any) string
- func WmDeiconify(w *Window)
- func WmGeometry(w *Window, geometry ...string) string
- func WmIconify(w *Window)
- func WmMaxSize(w *Window) (width, height int)
- func WmMinSize(w *Window, widthHeight ...any) (r string)
- func WmProtocol(w *Window, name string, command any) string
- func WmSetMaxSize(w *Window, width, height int)
- func WmTransient(options ...Opt) string
- func WmWithdraw(w *Window)
- type ButtonWidget
- type CanvasWidget
- func (w *CanvasWidget) Bbox(tagIds ...string) []string
- func (w *CanvasWidget) CreateArc(x1, y1, x2, y2 any, options ...any) (r string)
- func (w *CanvasWidget) CreateBitmap(x, y any, options ...any) (r string)
- func (w *CanvasWidget) CreateImage(x, y any, options ...any) (r string)
- func (w *CanvasWidget) CreateLine(x1, y1 any, options ...any) (r string)
- func (w *CanvasWidget) CreateOval(x1, y1, x2, y2 any, options ...any) (r string)
- func (w *CanvasWidget) CreatePolygon(x1, y1 any, options ...any) (r string)
- func (w *CanvasWidget) CreateRectangle(x1, y1, x2, y2 any, options ...any) (r string)
- func (w *CanvasWidget) CreateText(x, y any, options ...any) (r string)
- func (w *CanvasWidget) CreateWindow(x, y any, options ...any) (r string)
- func (w *CanvasWidget) Delete(tagOrId ...any) (r string)
- func (w *CanvasWidget) Graph(script string) *CanvasWidget
- type CheckbuttonWidget
- type EntryWidget
- type Event
- type EventHandler
- type Extension
- type ExtensionContext
- type ExtensionKey
- type FileType
- type FontFace
- type FrameWidget
- type Img
- type LC
- type LabelWidget
- type LabelframeWidget
- type ListboxWidget
- type MenuItem
- type MenuWidget
- func (w *MenuWidget) AddCascade(options ...Opt) *MenuItem
- func (w *MenuWidget) AddCheckbutton(options ...Opt) *MenuItem
- func (w *MenuWidget) AddCommand(options ...Opt) *MenuItem
- func (w *MenuWidget) AddRadiobutton(options ...Opt) *MenuItem
- func (w *MenuWidget) AddSeparator(options ...Opt) *MenuItem
- func (w *MenuWidget) EntryConfigure(index uint, options ...Opt)
- func (w *MenuWidget) Invoke(index uint)
- type MenubuttonWidget
- type MessageWidget
- type Modifier
- type Opt
- func Accelerator(val any) Opt
- func Activebackground(val any) Opt
- func Activebitmap(bitmap any) Opt
- func Activeborderwidth(val any) Opt
- func Activedash(pattern ...int) Opt
- func Activefill(color any) Opt
- func Activeforeground(val any) Opt
- func Activeimage(val any) Opt
- func Activeoutline(color any) Opt
- func Activeoutlinestipple(bitmap any) Opt
- func Activerelief(val any) Opt
- func Activestipple(bitmap any) Opt
- func Activestyle(val any) Opt
- func Activewidth(outlineWidth any) Opt
- func After(val any) Opt
- func Align(val any) Opt
- func Anchor(val any) Opt
- func Angle(rotationDegrees any) Opt
- func Arrowcolor(val any) Opt
- func Arrowshape(a, b, c any) Opt
- func Arrowsize(val any) Opt
- func Aspect(val any) Opt
- func Autoseparators(val any) Opt
- func Background(val any) Opt
- func Backgroundimage(val any) Opt
- func Backward() Opt
- func Before(val any) Opt
- func Bgstipple(val any) Opt
- func Bigincrement(val any) Opt
- func Bitmap(val any) Opt
- func Blockcursor(val any) Opt
- func Border(val any) Opt
- func Bordercolor(val any) Opt
- func Bordermode(val any) Opt
- func Borderwidth(val any) Opt
- func Buttonbackground(val any) Opt
- func Buttoncursor(val any) Opt
- func Buttondownrelief(val any) Opt
- func Buttonuprelief(val any) Opt
- func Capstyle(style any) Opt
- func Chars() Opt
- func Children(list ...any) Opt
- func Class(val any) Opt
- func Closeenough(val any) Opt
- func Colormap(val any) Opt
- func Column(val any) Opt
- func Columnbreak(val any) Opt
- func Columns(val any) Opt
- func Columnseparatorwidth(val any) Opt
- func Columnspan(val any) Opt
- func Command(handler any) Opt
- func Compound(val any) Opt
- func Confine(val any) Opt
- func Confirmoverwrite(val any) Opt
- func Container(val any) Opt
- func Cursor(val any) Opt
- func Darkcolor(val any) Opt
- func Dash(pattern ...int) Opt
- func Dashoffset(offset any) Opt
- func Data(val any) Opt
- func Default(val any) Opt
- func DefaultIcon(val ...any) Opt
- func Defaultextension(val any) Opt
- func Detail(val any) Opt
- func Digits(val any) Opt
- func Direction(val any) Opt
- func Disabledbackground(val any) Opt
- func Disabledbitmap(bitmap any) Opt
- func Disableddash(pattern ...int) Opt
- func Disabledfill(color any) Opt
- func Disabledforeground(val any) Opt
- func Disabledimage(val any) Opt
- func Disabledoutline(color any) Opt
- func Disabledoutlinestipple(bitmap any) Opt
- func Disabledstipple(bitmap any) Opt
- func Disabledwidth(outlineWidth any) Opt
- func Displaychars() Opt
- func Displaycolumns(val any) Opt
- func Displayindices() Opt
- func Displaylines() Opt
- func Displayof(val any) Opt
- func Elementborderwidth(val any) Opt
- func Elide(val any) Opt
- func Endline(val any) Opt
- func ExitHandler() Opt
- func Expand(val any) Opt
- func Exportselection(val any) Opt
- func Extent(degrees any) Opt
- func Family(val any) Opt
- func Fgstipple(val any) Opt
- func Fieldbackground(val any) Opt
- func File(val any) Opt
- func Filetypes(val any) Opt
- func Fill(val any) Opt
- func Focuscolor(val any) Opt
- func Focusfill(val any) Opt
- func Focussolid(val any) Opt
- func Focusthickness(val any) Opt
- func Font(list ...any) Opt
- func Force(val any) Opt
- func Foreground(val any) Opt
- func Format(val any) Opt
- func Forward() Opt
- func From(val ...any) Opt
- func Gamma(val any) Opt
- func Global() Opt
- func Gripsize(val any) Opt
- func Groovewidth(val any) Opt
- func Handlepad(val any) Opt
- func Handlesize(val any) Opt
- func Heading(columnId string) Opt
- func Height(val any) Opt
- func Hidemargin(val any) Opt
- func Highlightbackground(val any) Opt
- func Highlightcolor(val any) Opt
- func Highlightthickness(val any) Opt
- func Icon(val any) Opt
- func Id(val any) Opt
- func Image(val any) Opt
- func In(val any) Opt
- func Inactiveselectbackground(val any) Opt
- func Increment(val any) Opt
- func Indent(val any) Opt
- func Index(index any) Opt
- func Indicatorbackground(val any) Opt
- func Indicatorcolor(val any) Opt
- func Indicatormargin(val any) Opt
- func Indicatormargins(val any) Opt
- func Indicatoron(val any) Opt
- func Indicatorrelief(val any) Opt
- func Indicatorsize(val any) Opt
- func Indices() Opt
- func Info(info string) Opt
- func Initialcolor(val any) Opt
- func Initialdir(val any) Opt
- func Initialfile(val any) Opt
- func Insertbackground(val any) Opt
- func Insertborderwidth(val any) Opt
- func Insertcolor(val any) Opt
- func Insertofftime(val any) Opt
- func Insertontime(val any) Opt
- func Insertunfocussed(val any) Opt
- func Insertwidth(val any) Opt
- func Invalidcommand(handler any) Opt
- func Ipadx(val any) Opt
- func Ipady(val any) Opt
- func ItemWindow(w *Window) Opt
- func Items(items ...any) Opt
- func Joinstyle(style any) Opt
- func Jump(val any) Opt
- func Justify(val any) Opt
- func Labelanchor(val any) Opt
- func Labelmargins(val any) Opt
- func Labeloutside(val any) Opt
- func Labelwidget(val any) Opt
- func Lastfor(val any) Opt
- func Lbl(val any) Opt
- func Length(val any) Opt
- func Lightcolor(val any) Opt
- func Linearrow(where any) Opt
- func Lines() Opt
- func Listvariable(val any) Opt
- func Lmargin1(val any) Opt
- func Lmargin2(val any) Opt
- func Lmargincolor(val any) Opt
- func Maskdata(val any) Opt
- func Maskfile(val any) Opt
- func Maximum(val any) Opt
- func Maxphase(val any) Opt
- func Maxundo(val any) Opt
- func Metadata(val any) Opt
- func Minsize(val ...any) Opt
- func Mnu(val any) Opt
- func Mode(val any) Opt
- func Msg(val any) Opt
- func Multiple(val any) Opt
- func Mustexist(val any) Opt
- func Nice(val any) Opt
- func Nocase() Opt
- func Offrelief(val any) Opt
- func Offset(val any) Opt
- func Offvalue(val any) Opt
- func Onvalue(val any) Opt
- func Opaqueresize(val any) Opt
- func Open(val bool) Opt
- func Orient(val any) Opt
- func Outline(color any) Opt
- func Outlineoffset(offset any) Opt
- func Outlinestipple(bitmap any) Opt
- func Overrelief(val any) Opt
- func Overstrike(val any) Opt
- func Overstrikefg(val any) Opt
- func Pad(val any) Opt
- func Padding(val any) Opt
- func Padx(val any) Opt
- func Pady(val any) Opt
- func Palette(val any) Opt
- func Parent(val any) Opt
- func Period(val any) Opt
- func Phase(val any) Opt
- func Placeholder(val any) Opt
- func Placeholderforeground(val any) Opt
- func Postcommand(handler any) Opt
- func Postoffset(val any) Opt
- func Proxybackground(val any) Opt
- func Proxyborderwidth(val any) Opt
- func Proxyrelief(val any) Opt
- func Readonlybackground(val any) Opt
- func Regexp() Opt
- func Relheight(val any) Opt
- func Relief(val any) Opt
- func Relwidth(val any) Opt
- func Relx(val any) Opt
- func Rely(val any) Opt
- func Repeatdelay(val any) Opt
- func Repeatinterval(val any) Opt
- func Resolution(val any) Opt
- func Rmargin(val any) Opt
- func Rmargincolor(val any) Opt
- func Row(val any) Opt
- func Rowheight(val any) Opt
- func Rowspan(val any) Opt
- func Sashcursor(val any) Opt
- func Sashpad(val any) Opt
- func Sashrelief(val any) Opt
- func Sashthickness(val any) Opt
- func Sashwidth(val any) Opt
- func Screen(val any) Opt
- func Scrollregion(val any) Opt
- func Selectbackground(val any) Opt
- func Selectborderwidth(val any) Opt
- func Selectcolor(val any) Opt
- func Selectforeground(val any) Opt
- func Selectimage(val any) Opt
- func Selectmode(val any) Opt
- func Selecttype(val any) Opt
- func Setgrid(val any) Opt
- func Shiftrelief(val any) Opt
- func Show(val any) Opt
- func Showhandle(val any) Opt
- func Showvalue(val any) Opt
- func Side(val any) Opt
- func Size(val any) Opt
- func Slant(val any) Opt
- func Sliderlength(val any) Opt
- func Sliderrelief(val any) Opt
- func Sliderwidth(val any) Opt
- func Smooth(smoothMethod any) Opt
- func Spacing1(val any) Opt
- func Spacing2(val any) Opt
- func Spacing3(val any) Opt
- func Splinesteps(number any) Opt
- func Start(degrees any) Opt
- func Startline(val any) Opt
- func State(val any) Opt
- func Sticky(val any) Opt
- func Stipple(bitmap any) Opt
- func Stretch(when string) Opt
- func Striped(val any) Opt
- func Stripedbackground(val any) Opt
- func Style(val any) Opt
- func Tab(tabId any) Opt
- func Tabmargins(val any) Opt
- func Tabposition(val any) Opt
- func Tabs(val any) Opt
- func Tabstyle(val any) Opt
- func Tag(name string) Opt
- func Tags(tagList ...string) Opt
- func Takefocus(val any) Opt
- func Tearoff(val any) Opt
- func Tearoffcommand(handler any) Opt
- func Textvariable(s string) Opt
- func Tickinterval(val any) Opt
- func Tile(val any) Opt
- func Title(val any) Opt
- func Titlecolumns(val any) Opt
- func Titleitems(val any) Opt
- func To(val ...any) Opt
- func Topmost(v bool) Opt
- func Tristateimage(val any) Opt
- func Tristatevalue(val any) Opt
- func Troughcolor(val any) Opt
- func Troughrelief(val any) Opt
- func Txt(val any) Opt
- func Type(val any) Opt
- func Underline(val any) Opt
- func Underlinefg(val any) Opt
- func Undo(val any) Opt
- func Use(val any) Opt
- func Validate(val any) Opt
- func Validatecommand(handler any) Opt
- func Value(val any) Opt
- func Values(val any) Opt
- func Visual(val any) Opt
- func Weight(val any) Opt
- func Width(val any) Opt
- func Win(val any) Opt
- func Wrap(val any) Opt
- func Wraplength(val any) Opt
- func X(val any) Opt
- func Xpixels() Opt
- func Xscrollcommand(handler any) Opt
- func Xscrollincrement(val any) Opt
- func Y(val any) Opt
- func Ypixels() Opt
- func Yscrollcommand(handler any) Opt
- func Yscrollincrement(val any) Opt
- type OptionMenuWidget
- type Opts
- type PanedwindowWidget
- type RadiobuttonWidget
- type ScaleWidget
- type ScrollbarWidget
- type SpinboxWidget
- type TButtonWidget
- type TCheckbuttonWidget
- type TComboboxWidget
- type TEntryWidget
- type TFrameWidget
- type TLabelWidget
- type TLabelframeWidget
- type TMenubuttonWidget
- type TNotebookWidget
- type TPanedwindowWidget
- type TProgressbarWidget
- type TRadiobuttonWidget
- type TScaleWidget
- type TScrollbarWidget
- type TSeparatorWidget
- type TSizegripWidget
- type TSpinboxWidget
- type TTreeviewWidget
- func (w *TTreeviewWidget) Children(item any, newChildren ...any) (r []string)
- func (w *TTreeviewWidget) Column(column any, options ...Opt) (r string)
- func (w *TTreeviewWidget) Delete(itemList ...any)
- func (w *TTreeviewWidget) Focus(item ...any) (r string)
- func (w *TTreeviewWidget) Heading(column any, options ...Opt) (r string)
- func (w *TTreeviewWidget) IdentifyCell(x, y int) (r []string)
- func (w *TTreeviewWidget) IdentifyColumn(x, y int) (r string)
- func (w *TTreeviewWidget) IdentifyElement(x, y int) (r string)
- func (w *TTreeviewWidget) IdentifyItem(x, y int) (r string)
- func (w *TTreeviewWidget) IdentifyRegion(x, y int) (r string)
- func (w *TTreeviewWidget) Index(item any) (r int)
- func (w *TTreeviewWidget) Insert(parent, index any, options ...Opt) (r string)
- func (w *TTreeviewWidget) Item(item any, options ...any) (r string)
- func (w *TTreeviewWidget) Parent(item any) (r string)
- func (w *TTreeviewWidget) See(item any)
- func (w *TTreeviewWidget) Selection(selop string, itemList ...any) (r []string)
- func (w *TTreeviewWidget) TagAdd(tag string, items ...any)
- func (w *TTreeviewWidget) TagConfigure(tag string, options ...any) (r string)
- type TextWidget
- func (w *TextWidget) Clear()
- func (w *TextWidget) Copy()
- func (w *TextWidget) Count(options ...any) []string
- func (w *TextWidget) Cut()
- func (w *TextWidget) Delete(options ...any)
- func (w *TextWidget) EditReset()
- func (w *TextWidget) Get(options ...any) (r []string)
- func (w *TextWidget) ImageCreate(index any, options ...Opt)
- func (w *TextWidget) Index(index any) (r string)
- func (w *TextWidget) Insert(index any, chars string, options ...string) any
- func (w *TextWidget) InsertML(list ...any)
- func (w *TextWidget) MarkGravity(markName, direction string)
- func (w *TextWidget) MarkNames() []string
- func (w *TextWidget) MarkSet(markName string, index any)
- func (w *TextWidget) MarkUnset(markName ...string)
- func (w *TextWidget) Modified() bool
- func (w *TextWidget) Paste()
- func (w *TextWidget) Redo()
- func (w *TextWidget) Search(options ...any) string
- func (w *TextWidget) See(index any)
- func (w *TextWidget) SelectAll()
- func (w *TextWidget) SetModified(v bool)
- func (w *TextWidget) TagAdd(tagName string, indexes ...any) string
- func (w *TextWidget) TagBind(tag, sequence string, handler any) string
- func (w *TextWidget) TagConfigure(tagName string, options ...Opt)
- func (w *TextWidget) TagDelete(tags ...string)
- func (w *TextWidget) TagNames(index string) []string
- func (w *TextWidget) TagRanges(tagName string) (r []string)
- func (w *TextWidget) TagRemove(tagName string, indexes ...any) string
- func (w *TextWidget) Text() string
- func (w *TextWidget) Undo()
- func (w *TextWidget) WindowCreate(index any, options ...Opt)
- func (w *TextWidget) Xview() string
- func (w *TextWidget) Yview() string
- func (w *TextWidget) Yviewmoveto(fraction any) string
- type Theme
- type ThemeContext
- type ThemeKey
- type Ticker
- type ToplevelWidget
- type VariableOpt
- type Widget
- type Window
- func (w *Window) Activebackground() string
- func (w *Window) Activeborderwidth() string
- func (w *Window) Activeforeground() string
- func (w *Window) Activerelief() string
- func (w *Window) Activestyle() string
- func (w *Window) Anchor() string
- func (w *Window) Aspect() string
- func (w *Window) Autoseparators() string
- func (w *Window) Background() string
- func (w *Window) Backgroundimage() string
- func (w *Window) Bigincrement() string
- func (w *Window) Bitmap() string
- func (w *Window) Blockcursor() string
- func (w *Window) Borderwidth() string
- func (w *Window) Busy(options ...Opt)
- func (w *Window) BusyForget(options ...Opt)
- func (w *Window) Button(options ...Opt) *ButtonWidget
- func (w *Window) Buttonbackground() string
- func (w *Window) Buttoncursor() string
- func (w *Window) Buttondownrelief() string
- func (w *Window) Buttonuprelief() string
- func (w *Window) Canvas(options ...Opt) *CanvasWidget
- func (w *Window) Center() *Window
- func (w *Window) Checkbutton(options ...Opt) *CheckbuttonWidget
- func (w *Window) Class() string
- func (w *Window) Closeenough() string
- func (w *Window) Colormap() string
- func (w *Window) Columns() string
- func (w *Window) Compound() string
- func (w *Window) Configure(options ...Opt) *Window
- func (w *Window) Confine() string
- func (w *Window) Container() string
- func (w *Window) Cursor() string
- func (w *Window) Default() string
- func (w *Window) Digits() string
- func (w *Window) Direction() string
- func (w *Window) Disabledbackground() string
- func (w *Window) Disabledforeground() string
- func (w *Window) Displaycolumns() string
- func (w *Window) Elementborderwidth() string
- func (w *Window) Endline() string
- func (w *Window) Entry(options ...Opt) *EntryWidget
- func (w *Window) Exit(options ...Opt) *ButtonWidget
- func (w *Window) Exportselection() string
- func (w *Window) Font() string
- func (w *Window) Foreground() string
- func (w *Window) Format() string
- func (w *Window) Frame(options ...Opt) *FrameWidget
- func (w *Window) Handlepad() string
- func (w *Window) Handlesize() string
- func (w *Window) Height() string
- func (w *Window) Highlightbackground() string
- func (w *Window) Highlightcolor() string
- func (w *Window) Highlightthickness() string
- func (w *Window) IconPhoto(options ...Opt)
- func (w *Window) Image() string
- func (w *Window) Inactiveselectbackground() string
- func (w *Window) Increment() string
- func (w *Window) Indicatoron() string
- func (w *Window) Insertbackground() string
- func (w *Window) Insertborderwidth() string
- func (w *Window) Insertofftime() string
- func (w *Window) Insertontime() string
- func (w *Window) Insertunfocussed() string
- func (w *Window) Insertwidth() string
- func (w *Window) Jump() string
- func (w *Window) Justify() string
- func (w *Window) Label(options ...Opt) *LabelWidget
- func (w *Window) Labelanchor() string
- func (w *Window) Labelframe(options ...Opt) *LabelframeWidget
- func (w *Window) Labelwidget() string
- func (w *Window) Lbl() string
- func (w *Window) Length() string
- func (w *Window) Listbox(options ...Opt) *ListboxWidget
- func (w *Window) Listvariable() string
- func (w *Window) Lower(belowThis Widget)
- func (w *Window) Maximum() string
- func (w *Window) Maxundo() string
- func (w *Window) Menu(options ...Opt) *MenuWidget
- func (w *Window) Menubutton(options ...Opt) *MenubuttonWidget
- func (w *Window) Message(options ...Opt) *MessageWidget
- func (w *Window) Mnu() string
- func (w *Window) Mode() string
- func (w *Window) Offrelief() string
- func (w *Window) Offvalue() string
- func (w *Window) Onvalue() string
- func (w *Window) Opaqueresize() string
- func (w *Window) OptionMenu(varName *VariableOpt, options ...any) (r *OptionMenuWidget)
- func (w *Window) Orient() string
- func (w *Window) Overrelief() string
- func (w *Window) Padding() string
- func (w *Window) Padx() string
- func (w *Window) Pady() string
- func (w *Window) Panedwindow(options ...Opt) *PanedwindowWidget
- func (w *Window) Phase() string
- func (w *Window) Placeholder() string
- func (w *Window) Placeholderforeground() string
- func (w *Window) Proxybackground() string
- func (w *Window) Proxyborderwidth() string
- func (w *Window) Proxyrelief() string
- func (w *Window) Radiobutton(options ...Opt) *RadiobuttonWidget
- func (w *Window) Raise(aboveThis Widget)
- func (w *Window) Readonlybackground() string
- func (w *Window) Relief() string
- func (w *Window) Repeatdelay() string
- func (w *Window) Repeatinterval() string
- func (w *Window) Resolution() string
- func (w *Window) Sashcursor() string
- func (w *Window) Sashpad() string
- func (w *Window) Sashrelief() string
- func (w *Window) Sashwidth() string
- func (w *Window) Scale(options ...Opt) *ScaleWidget
- func (w *Window) Screen() string
- func (w *Window) Scrollbar(options ...Opt) *ScrollbarWidget
- func (w *Window) Scrollregion() string
- func (w *Window) Selectbackground() string
- func (w *Window) Selectborderwidth() string
- func (w *Window) Selectcolor() string
- func (w *Window) Selectforeground() string
- func (w *Window) Selectimage() string
- func (w *Window) Selectmode() string
- func (w *Window) Selecttype() string
- func (w *Window) SetResizable(width, height bool)
- func (w *Window) Setgrid() string
- func (w *Window) Show() string
- func (w *Window) Showhandle() string
- func (w *Window) Showvalue() string
- func (w *Window) Sliderlength() string
- func (w *Window) Sliderrelief() string
- func (w *Window) Spacing1() string
- func (w *Window) Spacing2() string
- func (w *Window) Spacing3() string
- func (w *Window) Spinbox(options ...Opt) *SpinboxWidget
- func (w *Window) Startline() string
- func (w *Window) State() string
- func (w *Window) String() (r string)
- func (w *Window) Striped() string
- func (w *Window) Style() string
- func (w *Window) TButton(options ...Opt) *TButtonWidget
- func (w *Window) TCheckbutton(options ...Opt) *TCheckbuttonWidget
- func (w *Window) TCombobox(options ...Opt) *TComboboxWidget
- func (w *Window) TEntry(options ...Opt) *TEntryWidget
- func (w *Window) TExit(options ...Opt) *TButtonWidget
- func (w *Window) TFrame(options ...Opt) *TFrameWidget
- func (w *Window) TLabel(options ...Opt) *TLabelWidget
- func (w *Window) TLabelframe(options ...Opt) *TLabelframeWidget
- func (w *Window) TMenubutton(options ...Opt) *TMenubuttonWidget
- func (w *Window) TNotebook(options ...Opt) *TNotebookWidget
- func (w *Window) TPanedwindow(options ...Opt) *TPanedwindowWidget
- func (w *Window) TProgressbar(options ...Opt) *TProgressbarWidget
- func (w *Window) TRadiobutton(options ...Opt) *TRadiobuttonWidget
- func (w *Window) TScale(options ...Opt) *TScaleWidget
- func (w *Window) TScrollbar(options ...Opt) *TScrollbarWidget
- func (w *Window) TSeparator(options ...Opt) *TSeparatorWidget
- func (w *Window) TSizegrip(options ...Opt) *TSizegripWidget
- func (w *Window) TSpinbox(options ...Opt) *TSpinboxWidget
- func (w *Window) TTreeview(options ...Opt) *TTreeviewWidget
- func (w *Window) Tabs() string
- func (w *Window) Tabstyle() string
- func (w *Window) Takefocus() string
- func (w *Window) Tearoff() string
- func (w *Window) Text(options ...Opt) *TextWidget
- func (w *Window) Textvariable() (r string)
- func (w *Window) Tickinterval() string
- func (w *Window) Tile() string
- func (w *Window) Title() string
- func (w *Window) Titlecolumns() string
- func (w *Window) Titleitems() string
- func (w *Window) Toplevel(options ...Opt) *ToplevelWidget
- func (w *Window) Tristateimage() string
- func (w *Window) Tristatevalue() string
- func (w *Window) Troughcolor() string
- func (w *Window) Txt() string
- func (w *Window) Type() string
- func (w *Window) Underline() string
- func (w *Window) Undo() string
- func (w *Window) Use() string
- func (w *Window) Validate() string
- func (w *Window) Value() string
- func (w *Window) Values() string
- func (w *Window) Variable() string
- func (w *Window) Visual() string
- func (w *Window) Wait()
- func (w *Window) WaitVisibility()
- func (w *Window) WidgetState(stateSpec string) (r string)
- func (w *Window) Width() string
- func (w *Window) WmTitle(s string) string
- func (w *Window) Wrap() string
- func (w *Window) Wraplength() string
- func (w *Window) Xscrollincrement() string
- func (w *Window) Yscrollincrement() string
- Bugs
Constants ¶
const ( Arrow = cursor("arrow") BasedArrowDown = cursor("based_arrow_down") BasedArrowUp = cursor("based_arrow_up") Boat = cursor("boat") Bogosity = cursor("bogosity") BottomLeftCorner = cursor("bottom_left_corner") BottomRightCorner = cursor("bottom_right_corner") BottomSide = cursor("bottom_side") BottomTee = cursor("bottom_tee") BoxSpiral = cursor("box_spiral") CenterPtr = cursor("center_ptr") Circle = cursor("circle") Clock = cursor("clock") CoffeeMug = cursor("coffee_mug") Cross = cursor("cross") CrossReverse = cursor("cross_reverse") Crosshair = cursor("crosshair") CursorIcon = cursor("icon") DiamondCross = cursor("diamond_cross") Dot = cursor("dot") Dotbox = cursor("dotbox") DoubleArrow = cursor("double_arrow") DraftLarge = cursor("draft_large") DraftSmall = cursor("draft_small") DrapedBox = cursor("draped_box") Exchange = cursor("exchange") Fleur = cursor("fleur") Gobbler = cursor("gobbler") Gumby = cursor("gumby") Hand1 = cursor("hand1") Hand2 = cursor("hand2") Heart = cursor("heart") IronCross = cursor("iron_cross") LeftPtr = cursor("left_ptr") LeftSide = cursor("left_side") LeftTee = cursor("left_tee") LlAngle = cursor("ll_angle") LrAngle = cursor("lr_angle") Man = cursor("man") Mouse = cursor("mouse") None = cursor("none") Pencil = cursor("pencil") Pirate = cursor("pirate") Plus = cursor("plus") QuestionArrow = cursor("question_arrow") RightPtr = cursor("right_ptr") RightSide = cursor("right_side") RightTee = cursor("right_tee") RtlLogo = cursor("rtl_logo") Sailboat = cursor("sailboat") SbDownArrow = cursor("sb_down_arrow") SbHDoubleArrow = cursor("sb_h_double_arrow") SbLeftArrow = cursor("sb_left_arrow") SbRightArrow = cursor("sb_right_arrow") SbUpArrow = cursor("sb_up_arrow") SbVDoubleArrow = cursor("sb_v_double_arrow") Shuttle = cursor("shuttle") Sizing = cursor("sizing") Spider = cursor("spider") Spraycan = cursor("spraycan") Star = cursor("star") Target = cursor("target") Tcross = cursor("tcross") TopLeftArrow = cursor("top_left_arrow") TopLeftCorner = cursor("top_left_corner") TopRightCorner = cursor("top_right_corner") TopSide = cursor("top_side") TopTee = cursor("top_tee") Trek = cursor("trek") UlAngle = cursor("ul_angle") Umbrella = cursor("umbrella") UrAngle = cursor("ur_angle") Watch = cursor("watch") XCursor = cursor("X_cursor") Xterm = cursor("xterm") )
Named cursor constants recognized on all platforms.
Writing, for example, 'Arrow' as an option is the same as writing 'Cursor("arrow")', but the compiler will catch any typos in the cursor name.
const ( CursorSize = cursor("size") No = cursor("no") SizeNeSw = cursor("size_ne_sw") SizeNs = cursor("size_ns") SizeNwSe = cursor("size_nw_se") SizeWe = cursor("size_we") Starting = cursor("starting") Uparrow = cursor("uparrow") )
Additional Windows cursors.
const ( Aliasarrow = cursor("aliasarrow") Bucket = cursor("bucket") Cancel = cursor("cancel") Closedhand = cursor("closedhand") Copyarrow = cursor("copyarrow") Countingdownhand = cursor("countingdownhand") Countingupanddownhand = cursor("countingupanddownhand") Countinguphand = cursor("countinguphand") CrossHair = cursor("cross-hair") CursorText = cursor("text") Eyedrop = cursor("eyedrop") EyedropFull = cursor("eyedrop-full") Fist = cursor("fist") Hand = cursor("hand") Help = cursor("help") Movearrow = cursor("movearrow") Notallowed = cursor("notallowed") Openhand = cursor("openhand") Pointinghand = cursor("pointinghand") Poof = cursor("poof") Resize = cursor("resize") Resizebottomleft = cursor("resizebottomleft") Resizebottomright = cursor("resizebottomright") Resizedown = cursor("resizedown") Resizeleft = cursor("resizeleft") Resizeleftright = cursor("resizeleftright") Resizeright = cursor("resizeright") Resizetopleft = cursor("resizetopleft") Resizetopright = cursor("resizetopright") Resizeup = cursor("resizeup") Resizeupdown = cursor("resizeupdown") Spinning = cursor("spinning") ZoomIn = cursor("zoom-in") ZoomOut = cursor("zoom-out") )
Additional macOS cursors.
const ( Agua = "agua" // R:0 G:255 B:255 AliceBlue = "AliceBlue" // R:240 G:248 B:255 AntiqueWhite = "AntiqueWhite" // R:250 G:235 B:215 AntiqueWhite1 = "AntiqueWhite1" // R:255 G:239 B:219 AntiqueWhite2 = "AntiqueWhite2" // R:238 G:223 B:204 AntiqueWhite3 = "AntiqueWhite3" // R:205 G:192 B:176 AntiqueWhite4 = "AntiqueWhite4" // R:139 G:131 B:120 Aquamarine = "aquamarine" // R:127 G:255 B:212 Aquamarine1 = "aquamarine1" // R:127 G:255 B:212 Aquamarine2 = "aquamarine2" // R:118 G:238 B:198 Aquamarine3 = "aquamarine3" // R:102 G:205 B:170 Aquamarine4 = "aquamarine4" // R:69 G:139 B:116 Azure = "azure" // R:240 G:255 B:255 Azure1 = "azure1" // R:240 G:255 B:255 Azure2 = "azure2" // R:224 G:238 B:238 Azure3 = "azure3" // R:193 G:205 B:205 Azure4 = "azure4" // R:131 G:139 B:139 Beige = "beige" // R:245 G:245 B:220 Bisque = "bisque" // R:255 G:228 B:196 Bisque1 = "bisque1" // R:255 G:228 B:196 Bisque2 = "bisque2" // R:238 G:213 B:183 Bisque3 = "bisque3" // R:205 G:183 B:158 Bisque4 = "bisque4" // R:139 G:125 B:107 Black = "black" // R:0 G:0 B:0 BlanchedAlmond = "BlanchedAlmond" // R:255 G:235 B:205 Blue = "blue" // R:0 G:0 B:255 Blue1 = "blue1" // R:0 G:0 B:255 Blue2 = "blue2" // R:0 G:0 B:238 Blue3 = "blue3" // R:0 G:0 B:205 Blue4 = "blue4" // R:0 G:0 B:139 BlueViolet = "BlueViolet" // R:138 G:43 B:226 Brown = "brown" // R:165 G:42 B:42 Brown1 = "brown1" // R:255 G:64 B:64 Brown2 = "brown2" // R:238 G:59 B:59 Brown3 = "brown3" // R:205 G:51 B:51 Brown4 = "brown4" // R:139 G:35 B:35 Burlywood = "burlywood" // R:222 G:184 B:135 Burlywood1 = "burlywood1" // R:255 G:211 B:155 Burlywood2 = "burlywood2" // R:238 G:197 B:145 Burlywood3 = "burlywood3" // R:205 G:170 B:125 Burlywood4 = "burlywood4" // R:139 G:115 B:85 CadetBlue = "CadetBlue" // R:95 G:158 B:160 CadetBlue1 = "CadetBlue1" // R:152 G:245 B:255 CadetBlue2 = "CadetBlue2" // R:142 G:229 B:238 CadetBlue3 = "CadetBlue3" // R:122 G:197 B:205 CadetBlue4 = "CadetBlue4" // R:83 G:134 B:139 Chartreuse = "chartreuse" // R:127 G:255 B:0 Chartreuse1 = "chartreuse1" // R:127 G:255 B:0 Chartreuse2 = "chartreuse2" // R:118 G:238 B:0 Chartreuse3 = "chartreuse3" // R:102 G:205 B:0 Chartreuse4 = "chartreuse4" // R:69 G:139 B:0 Chocolate = "chocolate" // R:210 G:105 B:30 Chocolate1 = "chocolate1" // R:255 G:127 B:36 Chocolate2 = "chocolate2" // R:238 G:118 B:33 Chocolate3 = "chocolate3" // R:205 G:102 B:29 Chocolate4 = "chocolate4" // R:139 G:69 B:19 Coral = "coral" // R:255 G:127 B:80 Coral1 = "coral1" // R:255 G:114 B:86 Coral2 = "coral2" // R:238 G:106 B:80 Coral3 = "coral3" // R:205 G:91 B:69 Coral4 = "coral4" // R:139 G:62 B:47 CornflowerBlue = "CornflowerBlue" // R:100 G:149 B:237 Cornsilk = "cornsilk" // R:255 G:248 B:220 Cornsilk1 = "cornsilk1" // R:255 G:248 B:220 Cornsilk2 = "cornsilk2" // R:238 G:232 B:205 Cornsilk3 = "cornsilk3" // R:205 G:200 B:177 Cornsilk4 = "cornsilk4" // R:139 G:136 B:120 Crymson = "crymson" // R:220 G:20 B:60 Cyan = "cyan" // R:0 G:255 B:255 Cyan1 = "cyan1" // R:0 G:255 B:255 Cyan2 = "cyan2" // R:0 G:238 B:238 Cyan3 = "cyan3" // R:0 G:205 B:205 Cyan4 = "cyan4" // R:0 G:139 B:139 DarkBlue = "DarkBlue" // R:0 G:0 B:139 DarkCyan = "DarkCyan" // R:0 G:139 B:139 DarkGoldenrod = "DarkGoldenrod" // R:184 G:134 B:11 DarkGoldenrod1 = "DarkGoldenrod1" // R:255 G:185 B:15 DarkGoldenrod2 = "DarkGoldenrod2" // R:238 G:173 B:14 DarkGoldenrod3 = "DarkGoldenrod3" // R:205 G:149 B:12 DarkGoldenrod4 = "DarkGoldenrod4" // R:139 G:101 B:8 DarkGray = "DarkGray" // R:169 G:169 B:169 DarkGreen = "DarkGreen" // R:0 G:100 B:0 DarkGrey = "DarkGrey" // R:169 G:169 B:169 DarkKhaki = "DarkKhaki" // R:189 G:183 B:107 DarkMagenta = "DarkMagenta" // R:139 G:0 B:139 DarkOliveGreen = "DarkOliveGreen" // R:85 G:107 B:47 DarkOliveGreen1 = "DarkOliveGreen1" // R:202 G:255 B:112 DarkOliveGreen2 = "DarkOliveGreen2" // R:188 G:238 B:104 DarkOliveGreen3 = "DarkOliveGreen3" // R:162 G:205 B:90 DarkOliveGreen4 = "DarkOliveGreen4" // R:110 G:139 B:61 DarkOrange = "DarkOrange" // R:255 G:140 B:0 DarkOrange1 = "DarkOrange1" // R:255 G:127 B:0 DarkOrange2 = "DarkOrange2" // R:238 G:118 B:0 DarkOrange3 = "DarkOrange3" // R:205 G:102 B:0 DarkOrange4 = "DarkOrange4" // R:139 G:69 B:0 DarkOrchid = "DarkOrchid" // R:153 G:50 B:204 DarkOrchid1 = "DarkOrchid1" // R:191 G:62 B:255 DarkOrchid2 = "DarkOrchid2" // R:178 G:58 B:238 DarkOrchid3 = "DarkOrchid3" // R:154 G:50 B:205 DarkOrchid4 = "DarkOrchid4" // R:104 G:34 B:139 DarkRed = "DarkRed" // R:139 G:0 B:0 DarkSalmon = "DarkSalmon" // R:233 G:150 B:122 DarkSeaGreen = "DarkSeaGreen" // R:143 G:188 B:143 DarkSeaGreen1 = "DarkSeaGreen1" // R:193 G:255 B:193 DarkSeaGreen2 = "DarkSeaGreen2" // R:180 G:238 B:180 DarkSeaGreen3 = "DarkSeaGreen3" // R:155 G:205 B:155 DarkSeaGreen4 = "DarkSeaGreen4" // R:105 G:139 B:105 DarkSlateBlue = "DarkSlateBlue" // R:72 G:61 B:139 DarkSlateGray = "DarkSlateGray" // R:47 G:79 B:79 DarkSlateGray1 = "DarkSlateGray1" // R:151 G:255 B:255 DarkSlateGray2 = "DarkSlateGray2" // R:141 G:238 B:238 DarkSlateGray3 = "DarkSlateGray3" // R:121 G:205 B:205 DarkSlateGray4 = "DarkSlateGray4" // R:82 G:139 B:139 DarkSlateGrey = "DarkSlateGrey" // R:47 G:79 B:79 DarkTurquoise = "DarkTurquoise" // R:0 G:206 B:209 DarkViolet = "DarkViolet" // R:148 G:0 B:211 DeepPink = "DeepPink" // R:255 G:20 B:147 DeepPink1 = "DeepPink1" // R:255 G:20 B:147 DeepPink2 = "DeepPink2" // R:238 G:18 B:137 DeepPink3 = "DeepPink3" // R:205 G:16 B:118 DeepPink4 = "DeepPink4" // R:139 G:10 B:80 DeepSkyBlue = "DeepSkyBlue" // R:0 G:191 B:255 DeepSkyBlue1 = "DeepSkyBlue1" // R:0 G:191 B:255 DeepSkyBlue2 = "DeepSkyBlue2" // R:0 G:178 B:238 DeepSkyBlue3 = "DeepSkyBlue3" // R:0 G:154 B:205 DeepSkyBlue4 = "DeepSkyBlue4" // R:0 G:104 B:139 DimGray = "DimGray" // R:105 G:105 B:105 DimGrey = "DimGrey" // R:105 G:105 B:105 DodgerBlue = "DodgerBlue" // R:30 G:144 B:255 DodgerBlue1 = "DodgerBlue1" // R:30 G:144 B:255 DodgerBlue2 = "DodgerBlue2" // R:28 G:134 B:238 DodgerBlue3 = "DodgerBlue3" // R:24 G:116 B:205 DodgerBlue4 = "DodgerBlue4" // R:16 G:78 B:139 Firebrick = "firebrick" // R:178 G:34 B:34 Firebrick1 = "firebrick1" // R:255 G:48 B:48 Firebrick2 = "firebrick2" // R:238 G:44 B:44 Firebrick3 = "firebrick3" // R:205 G:38 B:38 Firebrick4 = "firebrick4" // R:139 G:26 B:26 FloralWhite = "FloralWhite" // R:255 G:250 B:240 ForestGreen = "ForestGreen" // R:34 G:139 B:34 Fuchsia = "fuchsia" // R:255 G:0 B:255 Gainsboro = "gainsboro" // R:220 G:220 B:220 GhostWhite = "GhostWhite" // R:248 G:248 B:255 Gold = "gold" // R:255 G:215 B:0 Gold1 = "gold1" // R:255 G:215 B:0 Gold2 = "gold2" // R:238 G:201 B:0 Gold3 = "gold3" // R:205 G:173 B:0 Gold4 = "gold4" // R:139 G:117 B:0 Goldenrod = "goldenrod" // R:218 G:165 B:32 Goldenrod1 = "goldenrod1" // R:255 G:193 B:37 Goldenrod2 = "goldenrod2" // R:238 G:180 B:34 Goldenrod3 = "goldenrod3" // R:205 G:155 B:29 Goldenrod4 = "goldenrod4" // R:139 G:105 B:20 Gray = "gray" // R:128 G:128 B:128 Gray0 = "gray0" // R:0 G:0 B:0 Gray1 = "gray1" // R:3 G:3 B:3 Gray10 = "gray10" // R:26 G:26 B:26 Gray100 = "gray100" // R:255 G:255 B:255 Gray11 = "gray11" // R:28 G:28 B:28 Gray12 = "gray12" // R:31 G:31 B:31 Gray13 = "gray13" // R:33 G:33 B:33 Gray14 = "gray14" // R:36 G:36 B:36 Gray15 = "gray15" // R:38 G:38 B:38 Gray16 = "gray16" // R:41 G:41 B:41 Gray17 = "gray17" // R:43 G:43 B:43 Gray18 = "gray18" // R:46 G:46 B:46 Gray19 = "gray19" // R:48 G:48 B:48 Gray2 = "gray2" // R:5 G:5 B:5 Gray20 = "gray20" // R:51 G:51 B:51 Gray21 = "gray21" // R:54 G:54 B:54 Gray22 = "gray22" // R:56 G:56 B:56 Gray23 = "gray23" // R:59 G:59 B:59 Gray24 = "gray24" // R:61 G:61 B:61 Gray25 = "gray25" // R:64 G:64 B:64 Gray26 = "gray26" // R:66 G:66 B:66 Gray27 = "gray27" // R:69 G:69 B:69 Gray28 = "gray28" // R:71 G:71 B:71 Gray29 = "gray29" // R:74 G:74 B:74 Gray3 = "gray3" // R:8 G:8 B:8 Gray30 = "gray30" // R:77 G:77 B:77 Gray31 = "gray31" // R:79 G:79 B:79 Gray32 = "gray32" // R:82 G:82 B:82 Gray33 = "gray33" // R:84 G:84 B:84 Gray34 = "gray34" // R:87 G:87 B:87 Gray35 = "gray35" // R:89 G:89 B:89 Gray36 = "gray36" // R:92 G:92 B:92 Gray37 = "gray37" // R:94 G:94 B:94 Gray38 = "gray38" // R:97 G:97 B:97 Gray39 = "gray39" // R:99 G:99 B:99 Gray4 = "gray4" // R:10 G:10 B:10 Gray40 = "gray40" // R:102 G:102 B:102 Gray41 = "gray41" // R:105 G:105 B:105 Gray42 = "gray42" // R:107 G:107 B:107 Gray43 = "gray43" // R:110 G:110 B:110 Gray44 = "gray44" // R:112 G:112 B:112 Gray45 = "gray45" // R:115 G:115 B:115 Gray46 = "gray46" // R:117 G:117 B:117 Gray47 = "gray47" // R:120 G:120 B:120 Gray48 = "gray48" // R:122 G:122 B:122 Gray49 = "gray49" // R:125 G:125 B:125 Gray5 = "gray5" // R:13 G:13 B:13 Gray50 = "gray50" // R:127 G:127 B:127 Gray51 = "gray51" // R:130 G:130 B:130 Gray52 = "gray52" // R:133 G:133 B:133 Gray53 = "gray53" // R:135 G:135 B:135 Gray54 = "gray54" // R:138 G:138 B:138 Gray55 = "gray55" // R:140 G:140 B:140 Gray56 = "gray56" // R:143 G:143 B:143 Gray57 = "gray57" // R:145 G:145 B:145 Gray58 = "gray58" // R:148 G:148 B:148 Gray59 = "gray59" // R:150 G:150 B:150 Gray6 = "gray6" // R:15 G:15 B:15 Gray60 = "gray60" // R:153 G:153 B:153 Gray61 = "gray61" // R:156 G:156 B:156 Gray62 = "gray62" // R:158 G:158 B:158 Gray63 = "gray63" // R:161 G:161 B:161 Gray64 = "gray64" // R:163 G:163 B:163 Gray65 = "gray65" // R:166 G:166 B:166 Gray66 = "gray66" // R:168 G:168 B:168 Gray67 = "gray67" // R:171 G:171 B:171 Gray68 = "gray68" // R:173 G:173 B:173 Gray69 = "gray69" // R:176 G:176 B:176 Gray7 = "gray7" // R:18 G:18 B:18 Gray70 = "gray70" // R:179 G:179 B:179 Gray71 = "gray71" // R:181 G:181 B:181 Gray72 = "gray72" // R:184 G:184 B:184 Gray73 = "gray73" // R:186 G:186 B:186 Gray74 = "gray74" // R:189 G:189 B:189 Gray75 = "gray75" // R:191 G:191 B:191 Gray76 = "gray76" // R:194 G:194 B:194 Gray77 = "gray77" // R:196 G:196 B:196 Gray78 = "gray78" // R:199 G:199 B:199 Gray79 = "gray79" // R:201 G:201 B:201 Gray8 = "gray8" // R:20 G:20 B:20 Gray80 = "gray80" // R:204 G:204 B:204 Gray81 = "gray81" // R:207 G:207 B:207 Gray82 = "gray82" // R:209 G:209 B:209 Gray83 = "gray83" // R:212 G:212 B:212 Gray84 = "gray84" // R:214 G:214 B:214 Gray85 = "gray85" // R:217 G:217 B:217 Gray86 = "gray86" // R:219 G:219 B:219 Gray87 = "gray87" // R:222 G:222 B:222 Gray88 = "gray88" // R:224 G:224 B:224 Gray89 = "gray89" // R:227 G:227 B:227 Gray9 = "gray9" // R:23 G:23 B:23 Gray90 = "gray90" // R:229 G:229 B:229 Gray91 = "gray91" // R:232 G:232 B:232 Gray92 = "gray92" // R:235 G:235 B:235 Gray93 = "gray93" // R:237 G:237 B:237 Gray94 = "gray94" // R:240 G:240 B:240 Gray95 = "gray95" // R:242 G:242 B:242 Gray96 = "gray96" // R:245 G:245 B:245 Gray97 = "gray97" // R:247 G:247 B:247 Gray98 = "gray98" // R:250 G:250 B:250 Gray99 = "gray99" // R:252 G:252 B:252 Green = "green" // R:0 G:128 B:0 Green1 = "green1" // R:0 G:255 B:0 Green2 = "green2" // R:0 G:238 B:0 Green3 = "green3" // R:0 G:205 B:0 Green4 = "green4" // R:0 G:139 B:0 GreenYellow = "GreenYellow" // R:173 G:255 B:47 Grey = "grey" // R:128 G:128 B:128 Grey0 = "grey0" // R:0 G:0 B:0 Grey1 = "grey1" // R:3 G:3 B:3 Grey10 = "grey10" // R:26 G:26 B:26 Grey100 = "grey100" // R:255 G:255 B:255 Grey11 = "grey11" // R:28 G:28 B:28 Grey12 = "grey12" // R:31 G:31 B:31 Grey13 = "grey13" // R:33 G:33 B:33 Grey14 = "grey14" // R:36 G:36 B:36 Grey15 = "grey15" // R:38 G:38 B:38 Grey16 = "grey16" // R:41 G:41 B:41 Grey17 = "grey17" // R:43 G:43 B:43 Grey18 = "grey18" // R:46 G:46 B:46 Grey19 = "grey19" // R:48 G:48 B:48 Grey2 = "grey2" // R:5 G:5 B:5 Grey20 = "grey20" // R:51 G:51 B:51 Grey21 = "grey21" // R:54 G:54 B:54 Grey22 = "grey22" // R:56 G:56 B:56 Grey23 = "grey23" // R:59 G:59 B:59 Grey24 = "grey24" // R:61 G:61 B:61 Grey25 = "grey25" // R:64 G:64 B:64 Grey26 = "grey26" // R:66 G:66 B:66 Grey27 = "grey27" // R:69 G:69 B:69 Grey28 = "grey28" // R:71 G:71 B:71 Grey29 = "grey29" // R:74 G:74 B:74 Grey3 = "grey3" // R:8 G:8 B:8 Grey30 = "grey30" // R:77 G:77 B:77 Grey31 = "grey31" // R:79 G:79 B:79 Grey32 = "grey32" // R:82 G:82 B:82 Grey33 = "grey33" // R:84 G:84 B:84 Grey34 = "grey34" // R:87 G:87 B:87 Grey35 = "grey35" // R:89 G:89 B:89 Grey36 = "grey36" // R:92 G:92 B:92 Grey37 = "grey37" // R:94 G:94 B:94 Grey38 = "grey38" // R:97 G:97 B:97 Grey39 = "grey39" // R:99 G:99 B:99 Grey4 = "grey4" // R:10 G:10 B:10 Grey40 = "grey40" // R:102 G:102 B:102 Grey41 = "grey41" // R:105 G:105 B:105 Grey42 = "grey42" // R:107 G:107 B:107 Grey43 = "grey43" // R:110 G:110 B:110 Grey44 = "grey44" // R:112 G:112 B:112 Grey45 = "grey45" // R:115 G:115 B:115 Grey46 = "grey46" // R:117 G:117 B:117 Grey47 = "grey47" // R:120 G:120 B:120 Grey48 = "grey48" // R:122 G:122 B:122 Grey49 = "grey49" // R:125 G:125 B:125 Grey5 = "grey5" // R:13 G:13 B:13 Grey50 = "grey50" // R:127 G:127 B:127 Grey51 = "grey51" // R:130 G:130 B:130 Grey52 = "grey52" // R:133 G:133 B:133 Grey53 = "grey53" // R:135 G:135 B:135 Grey54 = "grey54" // R:138 G:138 B:138 Grey55 = "grey55" // R:140 G:140 B:140 Grey56 = "grey56" // R:143 G:143 B:143 Grey57 = "grey57" // R:145 G:145 B:145 Grey58 = "grey58" // R:148 G:148 B:148 Grey59 = "grey59" // R:150 G:150 B:150 Grey6 = "grey6" // R:15 G:15 B:15 Grey60 = "grey60" // R:153 G:153 B:153 Grey61 = "grey61" // R:156 G:156 B:156 Grey62 = "grey62" // R:158 G:158 B:158 Grey63 = "grey63" // R:161 G:161 B:161 Grey64 = "grey64" // R:163 G:163 B:163 Grey65 = "grey65" // R:166 G:166 B:166 Grey66 = "grey66" // R:168 G:168 B:168 Grey67 = "grey67" // R:171 G:171 B:171 Grey68 = "grey68" // R:173 G:173 B:173 Grey69 = "grey69" // R:176 G:176 B:176 Grey7 = "grey7" // R:18 G:18 B:18 Grey70 = "grey70" // R:179 G:179 B:179 Grey71 = "grey71" // R:181 G:181 B:181 Grey72 = "grey72" // R:184 G:184 B:184 Grey73 = "grey73" // R:186 G:186 B:186 Grey74 = "grey74" // R:189 G:189 B:189 Grey75 = "grey75" // R:191 G:191 B:191 Grey76 = "grey76" // R:194 G:194 B:194 Grey77 = "grey77" // R:196 G:196 B:196 Grey78 = "grey78" // R:199 G:199 B:199 Grey79 = "grey79" // R:201 G:201 B:201 Grey8 = "grey8" // R:20 G:20 B:20 Grey80 = "grey80" // R:204 G:204 B:204 Grey81 = "grey81" // R:207 G:207 B:207 Grey82 = "grey82" // R:209 G:209 B:209 Grey83 = "grey83" // R:212 G:212 B:212 Grey84 = "grey84" // R:214 G:214 B:214 Grey85 = "grey85" // R:217 G:217 B:217 Grey86 = "grey86" // R:219 G:219 B:219 Grey87 = "grey87" // R:222 G:222 B:222 Grey88 = "grey88" // R:224 G:224 B:224 Grey89 = "grey89" // R:227 G:227 B:227 Grey9 = "grey9" // R:23 G:23 B:23 Grey90 = "grey90" // R:229 G:229 B:229 Grey91 = "grey91" // R:232 G:232 B:232 Grey92 = "grey92" // R:235 G:235 B:235 Grey93 = "grey93" // R:237 G:237 B:237 Grey94 = "grey94" // R:240 G:240 B:240 Grey95 = "grey95" // R:242 G:242 B:242 Grey96 = "grey96" // R:245 G:245 B:245 Grey97 = "grey97" // R:247 G:247 B:247 Grey98 = "grey98" // R:250 G:250 B:250 Grey99 = "grey99" // R:252 G:252 B:252 Honeydew = "honeydew" // R:240 G:255 B:240 Honeydew1 = "honeydew1" // R:240 G:255 B:240 Honeydew2 = "honeydew2" // R:224 G:238 B:224 Honeydew3 = "honeydew3" // R:193 G:205 B:193 Honeydew4 = "honeydew4" // R:131 G:139 B:131 HotPink = "HotPink" // R:255 G:105 B:180 HotPink1 = "HotPink1" // R:255 G:110 B:180 HotPink2 = "HotPink2" // R:238 G:106 B:167 HotPink3 = "HotPink3" // R:205 G:96 B:144 HotPink4 = "HotPink4" // R:139 G:58 B:98 IndianRed = "IndianRed" // R:205 G:92 B:92 IndianRed1 = "IndianRed1" // R:255 G:106 B:106 IndianRed2 = "IndianRed2" // R:238 G:99 B:99 IndianRed3 = "IndianRed3" // R:205 G:85 B:85 IndianRed4 = "IndianRed4" // R:139 G:58 B:58 Indigo = "indigo" // R:75 G:0 B:130 Ivory = "ivory" // R:255 G:255 B:240 Ivory1 = "ivory1" // R:255 G:255 B:240 Ivory2 = "ivory2" // R:238 G:238 B:224 Ivory3 = "ivory3" // R:205 G:205 B:193 Ivory4 = "ivory4" // R:139 G:139 B:131 Khaki = "khaki" // R:240 G:230 B:140 Khaki1 = "khaki1" // R:255 G:246 B:143 Khaki2 = "khaki2" // R:238 G:230 B:133 Khaki3 = "khaki3" // R:205 G:198 B:115 Khaki4 = "khaki4" // R:139 G:134 B:78 Lavender = "lavender" // R:230 G:230 B:250 LavenderBlush = "LavenderBlush" // R:255 G:240 B:245 LavenderBlush1 = "LavenderBlush1" // R:255 G:240 B:245 LavenderBlush2 = "LavenderBlush2" // R:238 G:224 B:229 LavenderBlush3 = "LavenderBlush3" // R:205 G:193 B:197 LavenderBlush4 = "LavenderBlush4" // R:139 G:131 B:134 LawnGreen = "LawnGreen" // R:124 G:252 B:0 LemonChiffon = "LemonChiffon" // R:255 G:250 B:205 LemonChiffon1 = "LemonChiffon1" // R:255 G:250 B:205 LemonChiffon2 = "LemonChiffon2" // R:238 G:233 B:191 LemonChiffon3 = "LemonChiffon3" // R:205 G:201 B:165 LemonChiffon4 = "LemonChiffon4" // R:139 G:137 B:112 LightBlue = "LightBlue" // R:173 G:216 B:230 LightBlue1 = "LightBlue1" // R:191 G:239 B:255 LightBlue2 = "LightBlue2" // R:178 G:223 B:238 LightBlue3 = "LightBlue3" // R:154 G:192 B:205 LightBlue4 = "LightBlue4" // R:104 G:131 B:139 LightCoral = "LightCoral" // R:240 G:128 B:128 LightCyan = "LightCyan" // R:224 G:255 B:255 LightCyan1 = "LightCyan1" // R:224 G:255 B:255 LightCyan2 = "LightCyan2" // R:209 G:238 B:238 LightCyan3 = "LightCyan3" // R:180 G:205 B:205 LightCyan4 = "LightCyan4" // R:122 G:139 B:139 LightGoldenrod = "LightGoldenrod" // R:238 G:221 B:130 LightGoldenrod1 = "LightGoldenrod1" // R:255 G:236 B:139 LightGoldenrod2 = "LightGoldenrod2" // R:238 G:220 B:130 LightGoldenrod3 = "LightGoldenrod3" // R:205 G:190 B:112 LightGoldenrod4 = "LightGoldenrod4" // R:139 G:129 B:76 LightGoldenrodYellow = "LightGoldenrodYellow" // R:250 G:250 B:210 LightGray = "LightGray" // R:211 G:211 B:211 LightGreen = "LightGreen" // R:144 G:238 B:144 LightGrey = "LightGrey" // R:211 G:211 B:211 LightPink = "LightPink" // R:255 G:182 B:193 LightPink1 = "LightPink1" // R:255 G:174 B:185 LightPink2 = "LightPink2" // R:238 G:162 B:173 LightPink3 = "LightPink3" // R:205 G:140 B:149 LightPink4 = "LightPink4" // R:139 G:95 B:101 LightSalmon = "LightSalmon" // R:255 G:160 B:122 LightSalmon1 = "LightSalmon1" // R:255 G:160 B:122 LightSalmon2 = "LightSalmon2" // R:238 G:149 B:114 LightSalmon3 = "LightSalmon3" // R:205 G:129 B:98 LightSalmon4 = "LightSalmon4" // R:139 G:87 B:66 LightSeaGreen = "LightSeaGreen" // R:32 G:178 B:170 LightSkyBlue = "LightSkyBlue" // R:135 G:206 B:250 LightSkyBlue1 = "LightSkyBlue1" // R:176 G:226 B:255 LightSkyBlue2 = "LightSkyBlue2" // R:164 G:211 B:238 LightSkyBlue3 = "LightSkyBlue3" // R:141 G:182 B:205 LightSkyBlue4 = "LightSkyBlue4" // R:96 G:123 B:139 LightSlateBlue = "LightSlateBlue" // R:132 G:112 B:255 LightSlateGray = "LightSlateGray" // R:119 G:136 B:153 LightSlateGrey = "LightSlateGrey" // R:119 G:136 B:153 LightSteelBlue = "LightSteelBlue" // R:176 G:196 B:222 LightSteelBlue1 = "LightSteelBlue1" // R:202 G:225 B:255 LightSteelBlue2 = "LightSteelBlue2" // R:188 G:210 B:238 LightSteelBlue3 = "LightSteelBlue3" // R:162 G:181 B:205 LightSteelBlue4 = "LightSteelBlue4" // R:110 G:123 B:139 LightYellow = "LightYellow" // R:255 G:255 B:224 LightYellow1 = "LightYellow1" // R:255 G:255 B:224 LightYellow2 = "LightYellow2" // R:238 G:238 B:209 LightYellow3 = "LightYellow3" // R:205 G:205 B:180 LightYellow4 = "LightYellow4" // R:139 G:139 B:122 Lime = "lime" // R:0 G:255 B:0 LimeGreen = "LimeGreen" // R:50 G:205 B:50 Linen = "linen" // R:250 G:240 B:230 Magenta = "magenta" // R:255 G:0 B:255 Magenta1 = "magenta1" // R:255 G:0 B:255 Magenta2 = "magenta2" // R:238 G:0 B:238 Magenta3 = "magenta3" // R:205 G:0 B:205 Magenta4 = "magenta4" // R:139 G:0 B:139 Maroon = "maroon" // R:128 G:0 B:0 Maroon1 = "maroon1" // R:255 G:52 B:179 Maroon2 = "maroon2" // R:238 G:48 B:167 Maroon3 = "maroon3" // R:205 G:41 B:144 Maroon4 = "maroon4" // R:139 G:28 B:98 MediumAquamarine = "MediumAquamarine" // R:102 G:205 B:170 MediumBlue = "MediumBlue" // R:0 G:0 B:205 MediumOrchid = "MediumOrchid" // R:186 G:85 B:211 MediumOrchid1 = "MediumOrchid1" // R:224 G:102 B:255 MediumOrchid2 = "MediumOrchid2" // R:209 G:95 B:238 MediumOrchid3 = "MediumOrchid3" // R:180 G:82 B:205 MediumOrchid4 = "MediumOrchid4" // R:122 G:55 B:139 MediumPurple = "MediumPurple" // R:147 G:112 B:219 MediumPurple1 = "MediumPurple1" // R:171 G:130 B:255 MediumPurple2 = "MediumPurple2" // R:159 G:121 B:238 MediumPurple3 = "MediumPurple3" // R:137 G:104 B:205 MediumPurple4 = "MediumPurple4" // R:93 G:71 B:139 MediumSeaGreen = "MediumSeaGreen" // R:60 G:179 B:113 MediumSlateBlue = "MediumSlateBlue" // R:123 G:104 B:238 MediumSpringGreen = "MediumSpringGreen" // R:0 G:250 B:154 MediumTurquoise = "MediumTurquoise" // R:72 G:209 B:204 MediumVioletRed = "MediumVioletRed" // R:199 G:21 B:133 MidnightBlue = "MidnightBlue" // R:25 G:25 B:112 MintCream = "MintCream" // R:245 G:255 B:250 MistyRose = "MistyRose" // R:255 G:228 B:225 MistyRose1 = "MistyRose1" // R:255 G:228 B:225 MistyRose2 = "MistyRose2" // R:238 G:213 B:210 MistyRose3 = "MistyRose3" // R:205 G:183 B:181 MistyRose4 = "MistyRose4" // R:139 G:125 B:123 Moccasin = "moccasin" // R:255 G:228 B:181 OldLace = "OldLace" // R:253 G:245 B:230 Olive = "olive" // R:128 G:128 B:0 OliveDrab = "OliveDrab" // R:107 G:142 B:35 OliveDrab1 = "OliveDrab1" // R:192 G:255 B:62 OliveDrab2 = "OliveDrab2" // R:179 G:238 B:58 OliveDrab3 = "OliveDrab3" // R:154 G:205 B:50 OliveDrab4 = "OliveDrab4" // R:105 G:139 B:34 Orange = "orange" // R:255 G:165 B:0 Orange1 = "orange1" // R:255 G:165 B:0 Orange2 = "orange2" // R:238 G:154 B:0 Orange3 = "orange3" // R:205 G:133 B:0 Orange4 = "orange4" // R:139 G:90 B:0 OrangeRed = "OrangeRed" // R:255 G:69 B:0 OrangeRed1 = "OrangeRed1" // R:255 G:69 B:0 OrangeRed2 = "OrangeRed2" // R:238 G:64 B:0 OrangeRed3 = "OrangeRed3" // R:205 G:55 B:0 OrangeRed4 = "OrangeRed4" // R:139 G:37 B:0 Orchid = "orchid" // R:218 G:112 B:214 Orchid1 = "orchid1" // R:255 G:131 B:250 Orchid2 = "orchid2" // R:238 G:122 B:233 Orchid3 = "orchid3" // R:205 G:105 B:201 Orchid4 = "orchid4" // R:139 G:71 B:137 PaleGoldenrod = "PaleGoldenrod" // R:238 G:232 B:170 PaleGreen = "PaleGreen" // R:152 G:251 B:152 PaleGreen1 = "PaleGreen1" // R:154 G:255 B:154 PaleGreen2 = "PaleGreen2" // R:144 G:238 B:144 PaleGreen3 = "PaleGreen3" // R:124 G:205 B:124 PaleGreen4 = "PaleGreen4" // R:84 G:139 B:84 PaleTurquoise = "PaleTurquoise" // R:175 G:238 B:238 PaleTurquoise1 = "PaleTurquoise1" // R:187 G:255 B:255 PaleTurquoise2 = "PaleTurquoise2" // R:174 G:238 B:238 PaleTurquoise3 = "PaleTurquoise3" // R:150 G:205 B:205 PaleTurquoise4 = "PaleTurquoise4" // R:102 G:139 B:139 PaleVioletRed = "PaleVioletRed" // R:219 G:112 B:147 PaleVioletRed1 = "PaleVioletRed1" // R:255 G:130 B:171 PaleVioletRed2 = "PaleVioletRed2" // R:238 G:121 B:159 PaleVioletRed3 = "PaleVioletRed3" // R:205 G:104 B:127 PaleVioletRed4 = "PaleVioletRed4" // R:139 G:71 B:93 PapayaWhip = "PapayaWhip" // R:255 G:239 B:213 PeachPuff = "PeachPuff" // R:255 G:218 B:185 PeachPuff1 = "PeachPuff1" // R:255 G:218 B:185 PeachPuff2 = "PeachPuff2" // R:238 G:203 B:173 PeachPuff3 = "PeachPuff3" // R:205 G:175 B:149 PeachPuff4 = "PeachPuff4" // R:139 G:119 B:101 Peru = "peru" // R:205 G:133 B:63 Pink = "pink" // R:255 G:192 B:203 Pink1 = "pink1" // R:255 G:181 B:197 Pink2 = "pink2" // R:238 G:169 B:184 Pink3 = "pink3" // R:205 G:145 B:158 Pink4 = "pink4" // R:139 G:99 B:108 Plum = "plum" // R:221 G:160 B:221 Plum1 = "plum1" // R:255 G:187 B:255 Plum2 = "plum2" // R:238 G:174 B:238 Plum3 = "plum3" // R:205 G:150 B:205 Plum4 = "plum4" // R:139 G:102 B:139 PowderBlue = "PowderBlue" // R:176 G:224 B:230 Purple = "purple" // R:128 G:0 B:128 Purple1 = "purple1" // R:155 G:48 B:255 Purple2 = "purple2" // R:145 G:44 B:238 Purple3 = "purple3" // R:125 G:38 B:205 Purple4 = "purple4" // R:85 G:26 B:139 Red = "red" // R:255 G:0 B:0 Red1 = "red1" // R:255 G:0 B:0 Red2 = "red2" // R:238 G:0 B:0 Red3 = "red3" // R:205 G:0 B:0 Red4 = "red4" // R:139 G:0 B:0 RosyBrown = "RosyBrown" // R:188 G:143 B:143 RosyBrown1 = "RosyBrown1" // R:255 G:193 B:193 RosyBrown2 = "RosyBrown2" // R:238 G:180 B:180 RosyBrown3 = "RosyBrown3" // R:205 G:155 B:155 RosyBrown4 = "RosyBrown4" // R:139 G:105 B:105 RoyalBlue = "RoyalBlue" // R:65 G:105 B:225 RoyalBlue1 = "RoyalBlue1" // R:72 G:118 B:255 RoyalBlue2 = "RoyalBlue2" // R:67 G:110 B:238 RoyalBlue3 = "RoyalBlue3" // R:58 G:95 B:205 RoyalBlue4 = "RoyalBlue4" // R:39 G:64 B:139 SaddleBrown = "SaddleBrown" // R:139 G:69 B:19 Salmon = "salmon" // R:250 G:128 B:114 Salmon1 = "salmon1" // R:255 G:140 B:105 Salmon2 = "salmon2" // R:238 G:130 B:98 Salmon3 = "salmon3" // R:205 G:112 B:84 Salmon4 = "salmon4" // R:139 G:76 B:57 SandyBrown = "SandyBrown" // R:244 G:164 B:96 SeaGreen = "SeaGreen" // R:46 G:139 B:87 SeaGreen1 = "SeaGreen1" // R:84 G:255 B:159 SeaGreen2 = "SeaGreen2" // R:78 G:238 B:148 SeaGreen3 = "SeaGreen3" // R:67 G:205 B:128 SeaGreen4 = "SeaGreen4" // R:46 G:139 B:87 Seashell = "seashell" // R:255 G:245 B:238 Seashell1 = "seashell1" // R:255 G:245 B:238 Seashell2 = "seashell2" // R:238 G:229 B:222 Seashell3 = "seashell3" // R:205 G:197 B:191 Seashell4 = "seashell4" // R:139 G:134 B:130 Sienna = "sienna" // R:160 G:82 B:45 Sienna1 = "sienna1" // R:255 G:130 B:71 Sienna2 = "sienna2" // R:238 G:121 B:66 Sienna3 = "sienna3" // R:205 G:104 B:57 Sienna4 = "sienna4" // R:139 G:71 B:38 Silver = "silver" // R:192 G:192 B:192 SkyBlue = "SkyBlue" // R:135 G:206 B:235 SkyBlue1 = "SkyBlue1" // R:135 G:206 B:255 SkyBlue2 = "SkyBlue2" // R:126 G:192 B:238 SkyBlue3 = "SkyBlue3" // R:108 G:166 B:205 SkyBlue4 = "SkyBlue4" // R:74 G:112 B:139 SlateBlue = "SlateBlue" // R:106 G:90 B:205 SlateBlue1 = "SlateBlue1" // R:131 G:111 B:255 SlateBlue2 = "SlateBlue2" // R:122 G:103 B:238 SlateBlue3 = "SlateBlue3" // R:105 G:89 B:205 SlateBlue4 = "SlateBlue4" // R:71 G:60 B:139 SlateGray = "SlateGray" // R:112 G:128 B:144 SlateGray1 = "SlateGray1" // R:198 G:226 B:255 SlateGray2 = "SlateGray2" // R:185 G:211 B:238 SlateGray3 = "SlateGray3" // R:159 G:182 B:205 SlateGray4 = "SlateGray4" // R:108 G:123 B:139 SlateGrey = "SlateGrey" // R:112 G:128 B:144 Snow = "snow" // R:255 G:250 B:250 Snow1 = "snow1" // R:255 G:250 B:250 Snow2 = "snow2" // R:238 G:233 B:233 Snow3 = "snow3" // R:205 G:201 B:201 Snow4 = "snow4" // R:139 G:137 B:137 SpringGreen = "SpringGreen" // R:0 G:255 B:127 SpringGreen1 = "SpringGreen1" // R:0 G:255 B:127 SpringGreen2 = "SpringGreen2" // R:0 G:238 B:118 SpringGreen3 = "SpringGreen3" // R:0 G:205 B:102 SpringGreen4 = "SpringGreen4" // R:0 G:139 B:69 SteelBlue = "SteelBlue" // R:70 G:130 B:180 SteelBlue1 = "SteelBlue1" // R:99 G:184 B:255 SteelBlue2 = "SteelBlue2" // R:92 G:172 B:238 SteelBlue3 = "SteelBlue3" // R:79 G:148 B:205 SteelBlue4 = "SteelBlue4" // R:54 G:100 B:139 Tan = "tan" // R:210 G:180 B:140 Tan1 = "tan1" // R:255 G:165 B:79 Tan2 = "tan2" // R:238 G:154 B:73 Tan3 = "tan3" // R:205 G:133 B:63 Tan4 = "tan4" // R:139 G:90 B:43 Teal = "teal" // R:0 G:128 B:128 Thistle = "thistle" // R:216 G:191 B:216 Thistle1 = "thistle1" // R:255 G:225 B:255 Thistle2 = "thistle2" // R:238 G:210 B:238 Thistle3 = "thistle3" // R:205 G:181 B:205 Thistle4 = "thistle4" // R:139 G:123 B:139 Tomato = "tomato" // R:255 G:99 B:71 Tomato1 = "tomato1" // R:255 G:99 B:71 Tomato2 = "tomato2" // R:238 G:92 B:66 Tomato3 = "tomato3" // R:205 G:79 B:57 Tomato4 = "tomato4" // R:139 G:54 B:38 Turquoise = "turquoise" // R:64 G:224 B:208 Turquoise1 = "turquoise1" // R:0 G:245 B:255 Turquoise2 = "turquoise2" // R:0 G:229 B:238 Turquoise3 = "turquoise3" // R:0 G:197 B:205 Turquoise4 = "turquoise4" // R:0 G:134 B:139 Violet = "violet" // R:238 G:130 B:238 VioletRed = "VioletRed" // R:208 G:32 B:144 VioletRed1 = "VioletRed1" // R:255 G:62 B:150 VioletRed2 = "VioletRed2" // R:238 G:58 B:140 VioletRed3 = "VioletRed3" // R:205 G:50 B:120 VioletRed4 = "VioletRed4" // R:139 G:34 B:82 Wheat = "wheat" // R:245 G:222 B:179 Wheat1 = "wheat1" // R:255 G:231 B:186 Wheat2 = "wheat2" // R:238 G:216 B:174 Wheat3 = "wheat3" // R:205 G:186 B:150 Wheat4 = "wheat4" // R:139 G:126 B:102 White = "white" // R:255 G:255 B:255 WhiteSmoke = "WhiteSmoke" // R:245 G:245 B:245 Yellow = "yellow" // R:255 G:255 B:0 Yellow1 = "yellow1" // R:255 G:255 B:0 Yellow2 = "yellow2" // R:238 G:238 B:0 Yellow3 = "yellow3" // R:205 G:205 B:0 Yellow4 = "yellow4" // R:139 G:139 B:0 YellowGreen = "YellowGreen" // R:154 G:205 B:50 )
Named colors. Writing, for example, 'Background(Agua)' is the same as writing 'Background("agua")' but the compiler can catch any typos in the color name.
const ( SystemActiveAreaFill = "systemActiveAreaFill" SystemAlertBackgroundActive = "systemAlertBackgroundActive" SystemAlertBackgroundInactive = "systemAlertBackgroundInactive" SystemAlternatePrimaryHighlightColor = "systemAlternatePrimaryHighlightColor" SystemAppleGuideCoachmark = "systemAppleGuideCoachmark" SystemBevelActiveDark = "systemBevelActiveDark" SystemBevelActiveLight = "systemBevelActiveLight" SystemBevelInactiveDark = "systemBevelInactiveDark" SystemBevelInactiveLight = "systemBevelInactiveLight" SystemBlack = "systemBlack" SystemButtonActiveDarkHighlight = "systemButtonActiveDarkHighlight" SystemButtonActiveDarkShadow = "systemButtonActiveDarkShadow" SystemButtonActiveLightHighlight = "systemButtonActiveLightHighlight" SystemButtonActiveLightShadow = "systemButtonActiveLightShadow" SystemButtonFaceActive = "systemButtonFaceActive" SystemButtonFaceInactive = "systemButtonFaceInactive" SystemButtonFacePressed = "systemButtonFacePressed" SystemButtonFrame = "systemButtonFrame" SystemButtonFrameActive = "systemButtonFrameActive" SystemButtonFrameInactive = "systemButtonFrameInactive" SystemButtonInactiveDarkHighlight = "systemButtonInactiveDarkHighlight" SystemButtonInactiveDarkShadow = "systemButtonInactiveDarkShadow" SystemButtonInactiveLightHighlight = "systemButtonInactiveLightHighlight" SystemButtonInactiveLightShadow = "systemButtonInactiveLightShadow" SystemButtonPressedDarkHighlight = "systemButtonPressedDarkHighlight" SystemButtonPressedDarkShadow = "systemButtonPressedDarkShadow" SystemButtonPressedLightHighlight = "systemButtonPressedLightHighlight" SystemButtonPressedLightShadow = "systemButtonPressedLightShadow" SystemChasingArrows = "systemChasingArrows" SystemControlAccentColor = "systemControlAccentColor" SystemControlTextColor = "systemControlTextColor" SystemDialogBackgroundActive = "systemDialogBackgroundActive" SystemDialogBackgroundInactive = "systemDialogBackgroundInactive" SystemDisabledControlTextColor = "systemDisabledControlTextColor" SystemDocumentWindowBackground = "systemDocumentWindowBackground" SystemDragHilite = "systemDragHilite" SystemDrawerBackground = "systemDrawerBackground" SystemFinderWindowBackground = "systemFinderWindowBackground" SystemFocusHighlight = "systemFocusHighlight" SystemHighlightAlternate = "systemHighlightAlternate" SystemHighlightSecondary = "systemHighlightSecondary" SystemIconLabelBackground = "systemIconLabelBackground" SystemIconLabelBackgroundSelected = "systemIconLabelBackgroundSelected" SystemLabelColor = "systemLabelColor" SystemLinkColor = "systemLinkColor" SystemListViewBackground = "systemListViewBackground" SystemListViewColumnDivider = "systemListViewColumnDivider" SystemListViewEvenRowBackground = "systemListViewEvenRowBackground" SystemListViewOddRowBackground = "systemListViewOddRowBackground" SystemListViewSeparator = "systemListViewSeparator" SystemListViewSortColumnBackground = "systemListViewSortColumnBackground" SystemMenuActive = "systemMenuActive" SystemMenuBackground = "systemMenuBackground" SystemMenuBackgroundSelected = "systemMenuBackgroundSelected" SystemModelessDialogBackgroundActive = "systemModelessDialogBackgroundActive" SystemModelessDialogBackgroundInactive = "systemModelessDialogBackgroundInactive" SystemMovableModalBackground = "systemMovableModalBackground" SystemNotificationWindowBackground = "systemNotificationWindowBackground" SystemPlaceholderTextColor = "systemPlaceholderTextColor" SystemPopupArrowActive = "systemPopupArrowActive" SystemPopupArrowInactive = "systemPopupArrowInactive" SystemPopupArrowPressed = "systemPopupArrowPressed" SystemPrimaryHighlightColor = "systemPrimaryHighlightColor" SystemScrollBarDelimiterActive = "systemScrollBarDelimiterActive" SystemScrollBarDelimiterInactive = "systemScrollBarDelimiterInactive" SystemSecondaryHighlightColor = "systemSecondaryHighlightColor" SystemSelectedTabTextColor = "systemSelectedTabTextColor" SystemSelectedTextBackgroundColor = "systemSelectedTextBackgroundColor" SystemSelectedTextColor = "systemSelectedTextColor" SystemSeparatorColor = "systemSeparatorColor" SystemSheetBackground = "systemSheetBackground" SystemSheetBackgroundOpaque = "systemSheetBackgroundOpaque" SystemSheetBackgroundTransparent = "systemSheetBackgroundTransparent" SystemStaticAreaFill = "systemStaticAreaFill" SystemTextBackgroundColor = "systemTextBackgroundColor" SystemTextColor = "systemTextColor" SystemToolbarBackground = "systemToolbarBackground" SystemTransparent = "systemTransparent" SystemUtilityWindowBackgroundActive = "systemUtilityWindowBackgroundActive" SystemUtilityWindowBackgroundInactive = "systemUtilityWindowBackgroundInactive" SystemWhite = "systemWhite" SystemWindowBackgroundColor = "systemWindowBackgroundColor" SystemWindowBackgroundColor1 = "systemWindowBackgroundColor1" SystemWindowBackgroundColor2 = "systemWindowBackgroundColor2" SystemWindowBackgroundColor3 = "systemWindowBackgroundColor3" SystemWindowBackgroundColor4 = "systemWindowBackgroundColor4" SystemWindowBackgroundColor5 = "systemWindowBackgroundColor5" SystemWindowBackgroundColor6 = "systemWindowBackgroundColor6" SystemWindowBackgroundColor7 = "systemWindowBackgroundColor7" SystemWindowBody = "systemWindowBody" )
Additional system colors available on macOS.
const ( System3dDarkShadow = "system3dDarkShadow" System3dLight = "system3dLight" SystemActiveBorder = "systemActiveBorder" SystemActiveCaption = "systemActiveCaption" SystemAppWorkspace = "systemAppWorkspace" SystemBackground = "systemBackground" SystemButtonHighlight = "systemButtonHighlight" SystemButtonShadow = "systemButtonShadow" SystemButtonText = "systemButtonText" SystemCaptionText = "systemCaptionText" SystemDisabledText = "systemDisabledText" SystemGrayText = "systemGrayText" SystemHighlightText = "systemHighlightText" SystemInactiveBorder = "systemInactiveBorder" SystemInactiveCaption = "systemInactiveCaption" SystemInactiveCaptionText = "systemInactiveCaptionText" SystemInfoBackground = "systemInfoBackground" SystemInfoText = "systemInfoText" SystemMenuText = "systemMenuText" SystemScrollbar = "systemScrollbar" SystemWindow = "systemWindow" SystemWindowFrame = "systemWindowFrame" SystemWindowText = "systemWindowText" )
Additional system colors available on Windows. Note that the actual color values depend on the currently active OS theme.
const ( SystemButtonFace = "systemButtonFace" SystemHighlight = "systemHighlight" SystemMenu = "systemMenu" )
Additional system colors available both on macOS and Windows.
const ( DefaultFont = "TkDefaultFont" // Default for items not otherwise specified. TextFont = "TkTextFont" // Used for entry widgets, listboxes, etc. FixedFont = "TkFixedFont" // A standard fixed-width font. MenuFont = "TkMenuFont" // The font used for menu items. HeadingFont = "TkHeadingFont" // Font for column headings in lists and tables. CaptionFont = "TkCaptionFont" // A font for window and dialog caption bars. SmallCaptionFont = "TkSmallCaptionFont" // A smaller caption font for tool dialogs. IconFont = "TkIconFont" // A font for icon captions. TooltipFont = "TkTooltipFont" // A font for tooltips. )
Default generic font names
const ( // Font attributes NORMAL = "normal" BOLD = "bold" ITALIC = "italic" ROMAN = "roman" UNDERLINE = "underline" OVERSTRIKE = "overstrike" // Common font names (for Courier use the CourierFont() function) HELVETICA = "helvetica" TIMES = "times" // Text justify attributes (also used in other contexts) CENTER = "center" // also used as an anchor LEFT = "left" // also used as a pack side option RIGHT = "right" // also used as a pack side option // Text wrapping NONE = "none" // Also used as a Treeview select mode CHAR = "char" WORD = "word" // Text end position END = "end" // MessageBox icon names INFO = "info" QUESTION = "question" WARNING = "warning" ERROR = "error" // Anchor and sticky options (CENTER is also an anchor option) N = "n" S = "s" W = "w" E = "e" NEWS = "nswe" WE = "we" NS = "ns" // Pack fill options FILL_X = "x" FILL_Y = "y" FILL_BOTH = "both" // Pack side options (can also use LEFT and RIGHT) TOP = "top" BOTTOM = "bottom" // Orientation (e.g., for TPanedWindow) VERTICAL = "vertical" HORIZONTAL = "horizontal" // Select mode EXTENDED = "extended" BROWSE = "browse" // Select type CELL = "cell" ITEM = "item" // Relief FLAT = "flat" GROOVE = "groove" RAISED = "raised" RIDGE = "ridge" SOLID = "solid" SUNKEN = "sunken" // Window Manager protocols WM_TAKE_FOCUS = "WM_TAKE_FOCUS" WM_DELETE_WINDOW = "WM_DELETE_WINDOW" )
Common Tk-specific words.
Although Go's style guide recommends MixedCase, these are all in ALL_CAPS to avoid namespace collisions. For the pack fill options a prefix is used to avoid colliding with the X() and Y() option functions.
See https://gitlab.com/cznic/tk9.0/-/issues/25
const ( // ThemeEnvVar, if non-blank and containing a valid built-in theme // name, is used to set the default application theme. Calling // StyleThemeUse() will override the default. ThemeEnvVar = "TK9_THEME" // ScaleEnvVar, if a valid (floating point) number, sets the TkScaling // value at package initialization to NativeScaling*TK9_SCALE. ScaleEnvVar = "TK9_SCALE" )
const ( // Errors will panic with a stack trace. PanicOnError = iota // Errors will be recorded into the Error variable using errors.Join CollectErrors )
Error modes
const (
Wait = cursor("wait")
)
Additional macOS and Windows cursors.
Variables ¶
var ( // Extensions register Tk extensions or extra packages. User code must // not directly mutate Extensions. Extensions = map[ExtensionKey]Extension{} AlreadyInitialized = errors.New("Already initialized") NotInitialized = errors.New("Not initialized") )
var ( // Themes register Tk themes. User code must not directly mutate Themes. Themes = map[ThemeKey]Theme{} AlreadyActivated = errors.New("Already activated") AlreadyRegistered = errors.New("Already registered") Finalized = errors.New("Finalized") NotActivated = errors.New("Not activated") NotFound = errors.New("Not found") )
var App = &Window{}
App is the main/root application window.
var Error error
Error records errors when CollectErrors is true.
var ErrorMode int
ErrorMode selects the action taken on errors.
var NativeScaling float64
NativeScaling is the value returned by TKScaling in package initialization before it is possibly changed using the ScaleEnvVar value.
Functions ¶
func ActivateTheme ¶ added in v0.53.0
ActivateTheme searches Themes to find first theme named like 'name' and call its Activate method. The search is case insensitive, using strings.ToLower, and white space is normalized. If there's no match, ActivateTheme returns NotFound.
Any package can register themes but only the main package can activate a theme.
func Bell ¶ added in v0.4.8
func Bell(options ...Opt)
Bell — Ring a display's bell
Description ¶
This command rings the bell on the display for window and returns an empty string. If the -displayof option is omitted, the display of the application's main window is used by default. The command uses the current bell-related settings for the display, which may be modified with programs such as xset.
If -nice is not specified, this command also resets the screen saver for the screen. Some screen savers will ignore this, but others will reset so that the screen becomes visible again.
More information might be available at the Tcl/Tk bell page.
func Bind ¶ added in v0.4.10
func Bind(options ...any)
bind — Arrange for X events to invoke functions
Description ¶
Bind tag options...
The bind command associates commands with X events. If all three arguments are specified, bind will arrange for script (a Tcl script called the “binding script”) to be evaluated whenever the event(s) given by sequence occur in the window(s) identified by tag. If script is prefixed with a “+”, then it is appended to any existing binding for sequence; otherwise script replaces any existing binding. If script is an empty string then the current binding for sequence is destroyed, leaving sequence unbound. In all of the cases where a script argument is provided, bind returns an empty string.
If sequence is specified without a script, then the script currently bound to sequence is returned, or an empty string is returned if there is no binding for sequence. If neither sequence nor script is specified, then the return value is a list whose elements are all the sequences for which there exist bindings for tag.
The tag argument determines which window(s) the binding applies to. If tag begins with a dot, as in .a.b.c, then it must be the path name for a window; otherwise it may be an arbitrary string. Each window has an associated list of tags, and a binding applies to a particular window if its tag is among those specified for the window. Although the Bindtags command may be used to assign an arbitrary set of binding tags to a window, the default binding tags provide the following behavior:
- If a tag is the name of an internal window the binding applies to that window.
- If the tag is the name of a class of widgets, such as Button, the binding applies to all widgets in that class.
- If the tag is the name of a toplevel window the binding applies to the toplevel window and all its internal windows.
- If tag has the value all, the binding applies to all windows in the application.
Example usage in _examples/events.go.
Additional information might be available at the Tcl/Tk bind page.
func Bindtags ¶ added in v0.58.0
bindtags — Determine which bindings apply to a window, and order of evaluation
Description ¶
When a binding is created with the bind command, it is associated either with a particular window such as .a.b.c, a class name such as Button, the keyword all, or any other string. All of these forms are called binding tags. Each window contains a list of binding tags that determine how events are processed for the window. When an event occurs in a window, it is applied to each of the window's tags in order: for each tag, the most specific binding that matches the given tag and event is executed. See the bind command for more information on the matching process.
By default, each window has four binding tags consisting of the name of the window, the window's class name, the name of the window's nearest toplevel ancestor, and all, in that order. Toplevel windows have only three tags by default, since the toplevel name is the same as that of the window. The bindtags command allows the binding tags for a window to be read and modified.
If bindtags is invoked with only one argument, then the current set of binding tags for window is returned as a list. If the tagList argument is specified to bindtags, then it must be a proper list; the tags for window are changed to the elements of the list. The elements of tagList may be arbitrary strings; however, any tag starting with a dot is treated as the name of a window; if no window by that name exists at the time an event is processed, then the tag is ignored for that event. The order of the elements in tagList determines the order in which binding scripts are executed in response to events. For example, the command
Bindtags(myBtn, "all", App, "Button", myBtn)
reverses the order in which binding scripts will be evaluated for a button myBtn so that all bindings are invoked first, following by bindings for buttons (App), followed by class bindings, followed by bindings for myBtn. If tagList is an empty list then the binding tags for window are returned to the default state described above.
The bindtags command may be used to introduce arbitrary additional binding tags for a window, or to remove standard tags. For example, the command
Bindtags(myBtn, myBtn, "TrickyButton", App, "all")
replaces the Button tag for myBtn with TrickyButton. This means that the default widget bindings for buttons, which are associated with the Button tag, will no longer apply to myBtn, but any bindings associated with TrickyButton (perhaps some new button behavior) will apply.
Additional information might be available at the Tcl/Tk bindtags page.
func ChooseColor ¶ added in v0.5.18
ChooseColor — pops up a dialog box for the user to select a color.
Description ¶
ChooseColor pops up a dialog box for the user to select a color. The following option-value pairs are possible as command line arguments:
- Initialcolor color
Specifies the color to display in the color dialog when it pops up. color must be in a form acceptable to the Tk_GetColor function.
- Parent window
Makes window the logical parent of the color dialog. The color dialog is displayed on top of its parent window.
- Title titleString
Specifies a string to display as the title of the dialog box. If this option is not specified, then a default title will be displayed.
If the user selects a color, ChooseColor will return the name of the color in a form acceptable to Tk_GetColor. If the user cancels the operation, both commands will return the empty string.
More information might be available at the Tcl/Tk choosecolor page.
func ChooseDirectory ¶ added in v0.5.18
ChooseDirectory — pops up a dialog box for the user to select a directory.
Description ¶
The procedure tk_chooseDirectory pops up a dialog box for the user to select a directory. The following option-value pairs are possible as command line arguments:
- Initialdir dirname
Specifies that the directories in directory should be displayed when the dialog pops up. If this parameter is not specified, the initial directory defaults to the current working directory on non-Windows systems and on Windows systems prior to Vista. On Vista and later systems, the initial directory defaults to the last user-selected directory for the application. If the parameter specifies a relative path, the return value will convert the relative path to an absolute path.
- Message string
Specifies a message to include in the client area of the dialog. This is only available on Mac OS X.
- Mustexist boolean
Specifies whether the user may specify non-existent directories. If this parameter is true, then the user may only select directories that already exist. The default value is false.
- Parent window
Makes window the logical parent of the dialog. The dialog is displayed on top of its parent window. On Mac OS X, this turns the file dialog into a sheet attached to the parent window.
- Title titleString
Specifies a string to display as the title of the dialog box. If this option is not specified, then a default title will be displayed.
More information might be available at the Tcl/Tk chooseDirectory page.
func ClipboardAppend ¶ added in v0.5.18
ClipboardAppend — Manipulate Tk clipboard
Description ¶
This command provides a Tcl interface to the Tk clipboard, which stores data for later retrieval using the selection mechanism (via the -selection CLIPBOARD option). In order to copy data into the clipboard, clipboard clear must be called, followed by a sequence of one or more calls to clipboard append. To ensure that the clipboard is updated atomically, all appends should be completed before returning to the event loop.
ClipboardAppend appends 'data' to the clipboard on window's display in the form given by type with the representation given by format and claims ownership of the clipboard on window's display.
The format argument specifies the representation that should be used to transmit the selection to the requester (the second column of Table 2 of the ICCCM), and defaults to STRING. If format is STRING, the selection is transmitted as 8-bit ASCII characters. If format is ATOM, then the data is divided into fields separated by white space; each field is converted to its atom value, and the 32-bit atom value is transmitted instead of the atom name. For any other format, data is divided into fields separated by white space and each field is converted to a 32-bit integer; an array of integers is transmitted to the selection requester. Note that strings passed to clipboard append are concatenated before conversion, so the caller must take care to ensure appropriate spacing across string boundaries. All items appended to the clipboard with the same type must have the same format.
The format argument is needed only for compatibility with clipboard requesters that do not use Tk. If the Tk toolkit is being used to retrieve the CLIPBOARD selection then the value is converted back to a string at the requesting end, so format is irrelevant.
- Type type
Type specifies the form in which the selection is to be returned (the desired “target” for conversion, in ICCCM terminology), and should be an atom name such as STRING or FILE_NAME; see the Inter-Client Communication Conventions Manual for complete details. Type defaults to STRING.
More information might be available at the Tcl/Tk clipboard page.
func ClipboardClear ¶ added in v0.5.18
func ClipboardClear(options ...Opt)
ClipboardClear — Manipulate Tk clipboard
Description ¶
Claims ownership of the clipboard on window's display and removes any previous contents. Window defaults to App. Returns an empty string.
More information might be available at the Tcl/Tk clipboard page.
func ClipboardGet ¶ added in v0.5.18
ClipboardGet — Manipulate Tk clipboard
Description ¶
Retrieve data from the clipboard on window's display. Window defaults to App.
Type specifies the form in which the data is to be returned and should be an atom name such as STRING or FILE_NAME. Type defaults to STRING. This command is equivalent to [SelectionGet](Selection("CLIPBOARD").
Note that on modern X11 systems, the most useful type to retrieve for transferred strings is not STRING, but rather UTF8_STRING.
More information might be available at the Tcl/Tk clipboard page.
func CourierFont ¶ added in v0.19.1
func CourierFont() string
CourierFont returns "{courier new}" on Windows and "courier" elsewhere.
func CurrentThemeName ¶ added in v0.53.0
func CurrentThemeName() (r string)
CurrentThemeName returns the name of the currently activated theme, if any.
func Destroy ¶ added in v0.4.8
func Destroy(options ...Opt)
Destroy — Destroy one or more windows
Description ¶
This command deletes the windows given by the window arguments, plus all of their descendants. If a window “.” (App) is deleted then all windows will be destroyed and the application will (normally) exit. The windows are destroyed in order, and if an error occurs in destroying a window the command aborts without destroying the remaining windows. No error is returned if window does not exist.
func Finalize ¶ added in v0.1.2
func Finalize() (err error)
Finalize releases all resources held, if any. This may include temporary files. Finalize is intended to be called on process shutdown only.
func Focus ¶ added in v0.4.10
Focus — Manage the input focus
Description ¶
The focus command is used to manage the Tk input focus. At any given time, one window on each display is designated as the focus window; any key press or key release events for the display are sent to that window. It is normally up to the window manager to redirect the focus among the top-level windows of a display. For example, some window managers automatically set the input focus to a top-level window whenever the mouse enters it; others redirect the input focus only when the user clicks on a window. Usually the window manager will set the focus only to top-level windows, leaving it up to the application to redirect the focus among the children of the top-level.
Tk remembers one focus window for each top-level (the most recent descendant of that top-level to receive the focus); when the window manager gives the focus to a top-level, Tk automatically redirects it to the remembered window. Within a top-level Tk uses an explicit focus model by default. Moving the mouse within a top-level does not normally change the focus; the focus changes only when a widget decides explicitly to claim the focus (e.g., because of a button click), or when the user types a key such as Tab that moves the focus.
The Tcl procedure tk_focusFollowsMouse may be invoked to create an implicit focus model: it reconfigures Tk so that the focus is set to a window whenever the mouse enters it. The Tcl procedures tk_focusNext and tk_focusPrev implement a focus order among the windows of a top-level; they are used in the default bindings for Tab and Shift-Tab, among other things.
The focus command can take any of the following forms:
Focus()
Returns the path name of the focus window on the display containing the application's main window, or an empty string if no window in this application has the focus on that display. Note: it is better to specify the display explicitly using -displayof (see below) so that the code will work in applications using multiple displays.
Focus(window)
If the application currently has the input focus on window's display, this command resets the input focus for window's display to window and returns an empty string. If the application does not currently have the input focus on window's display, window will be remembered as the focus for its top-level; the next time the focus arrives at the top-level, Tk will redirect it to window. If window is an empty string then the command does nothing.
Focus(Displayof(window))
Returns the name of the focus window on the display containing window. If the focus window for window's display is not in this application, the return value is an empty string.
Focus(Force(window))
Sets the focus of window's display to window, even if the application does not currently have the input focus for the display. This command should be used sparingly, if at all. In normal usage, an application should not claim the focus for itself; instead, it should wait for the window manager to give it the focus. If window is an empty string then the command does nothing.
Focus(Lastfor(window))
Returns the name of the most recent window to have the input focus among all the windows in the same top-level as window. If no window in that top-level has ever had the input focus, or if the most recent focus window has been deleted, then the name of the top-level is returned. The return value is the window that will receive the input focus the next time the window manager gives the focus to the top-level.
Quirks ¶
When an internal window receives the input focus, Tk does not actually set the X focus to that window; as far as X is concerned, the focus will stay on the top-level window containing the window with the focus. However, Tk generates FocusIn and FocusOut events just as if the X focus were on the internal window. This approach gets around a number of problems that would occur if the X focus were actually moved; the fact that the X focus is on the top-level is invisible unless you use C code to query the X server directly.
More information might be available at the Tcl/Tk focus page.
func FontConfigure ¶ added in v0.34.0
font — Create and inspect fonts.
Description ¶
Query or modify the desired attributes for the named font called fontname. If no option is specified, returns a list describing all the options and their values for fontname. If a single option is specified with no value, then returns the current value of that attribute. If one or more option-value pairs are specified, then the command modifies the given named font to have the given values; in this case, all widgets using that font will redisplay themselves using the new attributes for the font. See FONT OPTIONS below for a list of the possible attributes.
Note that on Aqua/macOS, the system fonts (see PLATFORM SPECIFIC FONTS below) may not be actually altered because they are implemented by the system theme. To achieve the effect of modification, use font actual to get their configuration and font create to synthesize a copy of the font which can be modified.
More information might be available at the Tcl/Tk font page.
func FontFamilies ¶ added in v0.5.18
FontFamilies — Create and inspect fonts.
Description ¶
The return value is a list of the case-insensitive names of all font families that exist on window's display. If the Displayof argument is omitted, it defaults to the main window.
- Displayof window
Additional information might be available at the Tcl/Tk font page.
func Fontchooser ¶ added in v0.5.18
func Fontchooser(options ...Opt)
Fontchooser — control font selection dialog
Description ¶
The tk fontchooser command controls the Tk font selection dialog. It uses the native platform font selection dialog where available, or a dialog implemented in Tcl otherwise.
Unlike most of the other Tk dialog commands, tk fontchooser does not return an immediate result, as on some platforms (Mac OS X) the standard font dialog is modeless while on others (Windows) it is modal. To get the user-selected font use FontchooserFont() from a handler assigned via Command.
Set one or more of the configurations options below (analogous to Tk widget configuration).
Specifies/returns the logical parent window of the font selection dialog (similar to the -parent option to other dialogs). The font selection dialog is hidden if it is visible when the parent window is destroyed.
Specifies/returns the title of the dialog. Has no effect on platforms where the font selection dialog does not support titles.
Specifies/returns the font that is currently selected in the dialog if it is visible, or that will be initially selected when the dialog is shown (if supported by the platform). Can be set to the empty string to indicate that no font should be selected. Fonts can be specified in any form given by the "FONT DESCRIPTION" section in the font manual page.
Specifies the command called when a font selection has been made by the user. To obtain the font description, call FontchooserFont from the handler.
Additional information might be available at the Tcl/Tk fontchooser page.
func FontchooserFont ¶ added in v0.5.18
func FontchooserFont() []string
FontchooserFont — control font selection dialog
Description ¶
Returns the selected font description in the form
family size style...
Additional information might be available at the Tcl/Tk fontchooser page.
func FontchooserHide ¶ added in v0.5.18
func FontchooserHide()
FontchooserHide — control font selection dialog
Description ¶
Hide the font selection dialog if it is visible and cause any pending tk fontchooser show command to return.
Additional information might be available at the Tcl/Tk fontchooser page.
func FontchooserShow ¶ added in v0.5.18
func FontchooserShow()
FontchooserShow — control font selection dialog
Description ¶
Show the font selection dialog. Depending on the platform, may return immediately or only once the dialog has been withdrawn.
Additional information might be available at the Tcl/Tk fontchooser page.
func GetOpenFile ¶ added in v0.5.18
GetOpenFile — pop up a dialog box for the user to select a file to open.
Description ¶
GetOpenFile pops up a dialog box for the user to select a file to open. The function is usually associated with the Open command in the File menu. Its purpose is for the user to select an existing file only. If the user enters a non-existent file, the dialog box gives the user an error prompt and requires the user to give an alternative selection. If an application allows the user to create new files, it should do so by providing a separate New menu command.
- Defaultextension extension
Specifies a string that will be appended to the filename if the user enters a filename without an extension. The default value is the empty string, which means no extension will be appended to the filename in any case. This option is ignored on Mac OS X, which does not require extensions to filenames, and the UNIX implementation guesses reasonable values for this from the -filetypes option when this is not supplied.
If a File types listbox exists in the file dialog on the particular platform, this option gives the filetypes in this listbox. When the user choose a filetype in the listbox, only the files of that type are listed. If this option is unspecified, or if it is set to the empty list, or if the File types listbox is not supported by the particular platform then all files are listed regardless of their types. See the section SPECIFYING FILE PATTERNS below for a discussion on the contents of filePatternList.
- Initialdir directory
Specifies that the files in directory should be displayed when the dialog pops up. If this parameter is not specified, the initial directory defaults to the current working directory on non-Windows systems and on Windows systems prior to Vista. On Vista and later systems, the initial directory defaults to the last user-selected directory for the application. If the parameter specifies a relative path, the return value will convert the relative path to an absolute path.
- Initialfile filename
Specifies a filename to be displayed in the dialog when it pops up.
- Multiple boolean
Allows the user to choose multiple files from the Open dialog.
- Parent window
Makes window the logical parent of the file dialog. The file dialog is displayed on top of its parent window. On Mac OS X, this turns the file dialog into a sheet attached to the parent window.
- Title titleString
Specifies a string to display as the title of the dialog box. If this option is not specified, then a default title is displayed.
Additional information might be available at the Tcl/Tk getopenfile page.
func GetSaveFile ¶ added in v0.5.18
GetSaveFile — pop up a dialog box for the user to select a file to save.
Description ¶
GetSaveFile pops up a dialog box for the user to select a file to save.
The functio is usually associated with the Save as command in the File menu. If the user enters a file that already exists, the dialog box prompts the user for confirmation whether the existing file should be overwritten or not.
- Confirmoverwrite boolean
Configures how the Save dialog reacts when the selected file already exists, and saving would overwrite it. A true value requests a confirmation dialog be presented to the user. A false value requests that the overwrite take place without confirmation. Default value is true.
- Defaultextension extension
Specifies a string that will be appended to the filename if the user enters a filename without an extension. The default value is the empty string, which means no extension will be appended to the filename in any case. This option is ignored on Mac OS X, which does not require extensions to filenames, and the UNIX implementation guesses reasonable values for this from the -filetypes option when this is not supplied.
If a File types listbox exists in the file dialog on the particular platform, this option gives the filetypes in this listbox. When the user choose a filetype in the listbox, only the files of that type are listed. If this option is unspecified, or if it is set to the empty list, or if the File types listbox is not supported by the particular platform then all files are listed regardless of their types. See the section SPECIFYING FILE PATTERNS below for a discussion on the contents of filePatternList.
- Initialdir directory
Specifies that the files in directory should be displayed when the dialog pops up. If this parameter is not specified, the initial directory defaults to the current working directory on non-Windows systems and on Windows systems prior to Vista. On Vista and later systems, the initial directory defaults to the last user-selected directory for the application. If the parameter specifies a relative path, the return value will convert the relative path to an absolute path.
- Initialfile filename
Specifies a filename to be displayed in the dialog when it pops up.
- Parent window
Makes window the logical parent of the file dialog. The file dialog is displayed on top of its parent window. On Mac OS X, this turns the file dialog into a sheet attached to the parent window.
- Title titleString
Specifies a string to display as the title of the dialog box. If this option is not specified, then a default title is displayed.
Additional information might be available at the Tcl/Tk getopenfile page.
func Grab ¶ added in v0.56.1
func Grab(options ...Opt)
grab — Confine pointer and keyboard events to a window sub-tree
Description ¶
Same as GrabSet().
More information might be available at the Tcl/Tk grab page.
func GrabCurrent ¶ added in v0.56.1
grab — Confine pointer and keyboard events to a window sub-tree
Description ¶
If window is specified, returns the name of the current grab window in this application for window's display, or an empty string if there is no such window. If window is omitted, the command returns a list whose elements are all of the windows grabbed by this application for all displays, or an empty string if the application has no grabs.
More information might be available at the Tcl/Tk grab page.
func GrabRelease ¶ added in v0.56.1
func GrabRelease(w Opt)
grab — Confine pointer and keyboard events to a window sub-tree
Description ¶
Releases the grab on window if there is one, otherwise does nothing.
More information might be available at the Tcl/Tk grab page.
func GrabSet ¶ added in v0.56.1
func GrabSet(options ...Opt)
grab — Confine pointer and keyboard events to a window sub-tree
Description ¶
Sets a grab on window. If -global is specified then the grab is global, otherwise it is local. If a grab was already in effect for this application on window's display then it is automatically released. If there is already a grab on window and it has the same global/local form as the requested grab, then the command does nothing.
More information might be available at the Tcl/Tk grab page.
func GrabStatus ¶ added in v0.56.1
grab — Confine pointer and keyboard events to a window sub-tree
Description ¶
Returns none if no grab is currently set on window, local if a local grab is set on window, and global if a global grab is set.
More information might be available at the Tcl/Tk grab page.
func Grid ¶ added in v0.5.18
Grid — Geometry manager that arranges widgets in a grid
Description ¶
The arguments consist of the names of one or more content windows followed by pairs of arguments that specify how to manage the content. The characters -, x and ^, can be specified instead of a window name to alter the default location of a window, as described in the RELATIVE PLACEMENT section, below.
The following options are supported:
- Column n
Insert the window so that it occupies the nth column in the grid. Column numbers start with 0. If this option is not supplied, then the window is arranged just to the right of previous window specified on this call to grid, or column “0” if it is the first window. For each x that immediately precedes the window, the column position is incremented by one. Thus the x represents a blank column for this row in the grid.
Insert the window so that it occupies n columns in the grid. The default is one column, unless the window name is followed by a -, in which case the columnspan is incremented once for each immediately following -.
- In container
Insert the window(s) in the container window given by container. The default is the first window's parent window.
- Ipadx amount
The amount specifies how much horizontal internal padding to leave on each side of the content. This is space is added inside the content border. The amount must be a valid screen distance, such as 2 or .5c. It defaults to 0.
- Ipady amount
The amount specifies how much vertical internal padding to leave on the top and bottom of the content. This space is added inside the content border. The amount defaults to 0.
- Padx amount
The amount specifies how much horizontal external padding to leave on each side of the content, in screen units. Amount may be a list of two values to specify padding for left and right separately. The amount defaults to 0. This space is added outside the content border.
- Pady amount
The amount specifies how much vertical external padding to leave on the top and bottom of the content, in screen units. Amount may be a list of two values to specify padding for top and bottom separately. The amount defaults to 0. This space is added outside the content border.
- Row n
Insert the content so that it occupies the nth row in the grid. Row numbers start with 0. If this option is not supplied, then the content is arranged on the same row as the previous content specified on this call to grid, or the next row after the highest occupied row if this is the first content.
- Rowspan n
Insert the content so that it occupies n rows in the grid. The default is one row. If the next grid command contains ^ characters instead of content that line up with the columns of this content, then the rowspan of this content is extended by one.
- Sticky style
If a content's cell is larger than its requested dimensions, this option may be used to position (or stretch) the content within its cell. Style is a string that contains zero or more of the characters n, s, e or w. The string can optionally contain spaces or commas, but they are ignored. Each letter refers to a side (north, south, east, or west) that the content will “stick” to. If both n and s (or e and w) are specified, the content will be stretched to fill the entire height (or width) of its cavity. The -sticky option subsumes the combination of -anchor and -fill that is used by pack. The default is “”, which causes the content to be centered in its cavity, at its requested size.
If any of the content is already managed by the geometry manager then any unspecified options for them retain their previous values rather than receiving default values.
More information might be available at the Tcl/Tk grid page.
func GridAnchor ¶ added in v0.33.0
Grid — Geometry manager that arranges widgets in a grid
Description ¶
The anchor value controls how to place the grid within the container window when no row/column has any weight. See THE GRID ALGORITHM below for further details. The default anchor is nw.
More information might be available at the Tcl/Tk grid page.
func GridColumnConfigure ¶ added in v0.16.2
Grid — Geometry manager that arranges widgets in a grid
Description ¶
Query or set the column properties of the index column of the geometry container, window. The valid options are -minsize, -weight, -uniform and -pad. If one or more options are provided, then index may be given as a list of column indices to which the configuration options will operate on. Indices may be integers, window names or the keyword all. For all the options apply to all columns currently occupied be content windows. For a window name, that window must be a content of this container and the options apply to all columns currently occupied be the content. The -minsize option sets the minimum size, in screen units, that will be permitted for this column. The -weight option (an integer value) sets the relative weight for apportioning any extra spaces among columns. A weight of zero (0) indicates the column will not deviate from its requested size. A column whose weight is two will grow at twice the rate as a column of weight one when extra space is allocated to the layout. The -uniform option, when a non-empty value is supplied, places the column in a uniform group with other columns that have the same value for -uniform. The space for columns belonging to a uniform group is allocated so that their sizes are always in strict proportion to their -weight values. See THE GRID ALGORITHM below for further details. The -pad option specifies the number of screen units that will be added to the largest window contained completely in that column when the grid geometry manager requests a size from the containing window. If only an option is specified, with no value, the current value of that option is returned. If only the container window and index is specified, all the current settings are returned in a list of “-option value” pairs.
More information might be available at the Tcl/Tk grid page.
func GridForget ¶ added in v0.58.0
func GridForget(w ...*Window)
Grid — Geometry manager that arranges widgets in a grid
Description ¶
Removes each of the windows from grid for its container and unmaps their windows. The content will no longer be managed by the grid geometry manager. The configuration options for that window are forgotten, so that if the window is managed once more by the grid geometry manager, the initial default settings are used.
If the last content window of the container becomes unmanaged, this will also send the virtual event <<NoManagedChild>> to the container; the container may choose to resize itself (or otherwise respond) to such a change.
More information might be available at the Tcl/Tk grid page.
func GridRemove ¶ added in v0.58.0
func GridRemove(w ...*Window)
Grid — Geometry manager that arranges widgets in a grid
Description ¶
Removes each of the windows from grid for its container and unmaps their windows. The content will no longer be managed by the grid geometry manager. However, the configuration options for that window are remembered, so that if the content window is managed once more by the grid geometry manager, the previous values are retained.
If the last content window of the container becomes unmanaged, this will also send the virtual event <<NoManagedChild>> to the container; the container may choose to resize itself (or otherwise respond) to such a change.
More information might be available at the Tcl/Tk grid page.
func GridRowConfigure ¶ added in v0.16.2
Grid — Geometry manager that arranges widgets in a grid
Description ¶
Query or set the row properties of the index row of the geometry container, window. The valid options are -minsize, -weight, -uniform and -pad. If one or more options are provided, then index may be given as a list of row indices to which the configuration options will operate on. Indices may be integers, window names or the keyword all. For all the options apply to all rows currently occupied by content windows. For a window name, that window must be a content window of this container and the options apply to all rows currently occupied by the container window. The -minsize option sets the minimum size, in screen units, that will be permitted for this row. The -weight option (an integer value) sets the relative weight for apportioning any extra spaces among rows. A weight of zero (0) indicates the row will not deviate from its requested size. A row whose weight is two will grow at twice the rate as a row of weight one when extra space is allocated to the layout. The -uniform option, when a non-empty value is supplied, places the row in a uniform group with other rows that have the same value for -uniform. The space for rows belonging to a uniform group is allocated so that their sizes are always in strict proportion to their -weight values. See THE GRID ALGORITHM below for further details. The -pad option specifies the number of screen units that will be added to the largest window contained completely in that row when the grid geometry manager requests a size from the containing window. If only an option is specified, with no value, the current value of that option is returned. If only the container window and index is specified, all the current settings are returned in a list of “-option value” pairs.
More information might be available at the Tcl/Tk grid page.
func Initialize ¶ added in v0.1.2
func Initialize()
Initalize enforces the parts of package initialization that are otherwise done lazily. The function may panic if ErrorMode is PanicOnError.
func InitializeExtension ¶ added in v0.58.0
InitializeExtension searches Extensions to find first extension named 'name' and call its Initialize method. The search is case sensitive, white space is normalized. If there's no match, InitializeExtension returns NotFound.
Any package can register extensions but only the main package can initialize an extension.
func MessageBox ¶ added in v0.5.18
tk_messageBox — pops up a message window and waits for user response.
Description ¶
This procedure creates and displays a message window with an application-specified message, an icon and a set of buttons. Each of the buttons in the message window is identified by a unique symbolic name (see the -type options). After the message window is popped up, tk_messageBox waits for the user to select one of the buttons. Then it returns the symbolic name of the selected button. The following optins are supported:
- Command handler
Specifies the handler to invoke when the user closes the dialog. The actual command consists of string followed by a space and the name of the button clicked by the user to close the dialog. This is only available on Mac OS X.
- Default name
Name gives the symbolic name of the default button for this message window ( “ok”, “cancel”, and so on). See -type for a list of the symbolic names. If this option is not specified, the first button in the dialog will be made the default.
- Detail string
Specifies an auxiliary message to the main message given by the -message option. The message detail will be presented beneath the main message and, where supported by the OS, in a less emphasized font than the main message.
- Icon iconImage
Specifies an icon to display. IconImage must be one of the following: error, info, question or warning. If this option is not specified, then the info icon will be displayed.
- Message string
Specifies the message to display in this message box. The default value is an empty string.
- Parent window
Makes window the logical parent of the message box. The message box is displayed on top of its parent window.
- Title titleString
Specifies a string to display as the title of the message box. The default value is an empty string.
- Type predefinedType
Arranges for a predefined set of buttons to be displayed. The following values are possible for predefinedType:
- abortretryignore - Displays three buttons whose symbolic names are abort, retry and ignore.
- ok - Displays one button whose symbolic name is ok.
- okcancel - Displays two buttons whose symbolic names are ok and cancel.
- retrycancel - Displays two buttons whose symbolic names are retry and cancel.
- yesno - Displays two buttons whose symbolic names are yes and no.
- yesnocancel - Displays three buttons whose symbolic names are yes, no and cancel.
More information might be available at the Tcl/Tk messageBox page.
func Pack ¶ added in v0.4.10
func Pack(options ...Opt)
Pack — Geometry manager that packs around edges of cavity
Description ¶
The options consist of one or more content windows followed by options that specify how to manage the content. See THE PACKER ALGORITHM for details on how the options are used by the packer.
The first argument must be a *Window.
The following options are supported:
- After other
Other must the name of another window. Use its container as the container for the content, and insert the content just after other in the packing order.
- Anchor anchor
Anchor must be a valid anchor position such as n or sw; it specifies where to position each content in its parcel. Defaults to center.
- Before other
Other must the name of another window. Use its container as the container for the content, and insert the content just before other in the packing order.
- Expand boolean
Specifies whether the content should be expanded to consume extra space in their container. Boolean may have any proper boolean value, such as 1 or no. Defaults to 0.
- Fill style
If a content's parcel is larger than its requested dimensions, this option may be used to stretch the content. Style must have one of the following values:
- "none" - Give the content its requested dimensions plus any internal padding requested with -ipadx or -ipady. This is the default.
- "x" - Stretch the content horizontally to fill the entire width of its parcel (except leave external padding as specified by -padx).
- "y" - Stretch the content vertically to fill the entire height of its parcel (except leave external padding as specified by -pady).
- "both": Stretch the content both horizontally and vertically.
.
- In container
Insert the window at the end of the packing order for the container window given by container.
- Ipadx amount
Amount specifies how much horizontal internal padding to leave on each side of the content. Amount must be a valid screen distance, such as 2 or .5c. It defaults to 0.
- Ipady amount
Amount specifies how much vertical internal padding to leave on each side of the content. Amount defaults to 0.
- Padx amount
Amount specifies how much horizontal external padding to leave on each side of the content. Amount may be a list of two values to specify padding for left and right separately. Amount defaults to 0.
- Pady amount
Amount specifies how much vertical external padding to leave on each side of the content. Amount may be a list of two values to specify padding for top and bottom separately. Amount defaults to 0.
- Side side
Specifies which side of the container the content will be packed against. Must be "left", "right", "top", or "bottom". Defaults to top.
If no -in, -after or -before option is specified then each of the content will be inserted at the end of the packing list for its parent unless it is already managed by the packer (in which case it will be left where it is). If one of these options is specified then all the content will be inserted at the specified point. If any of the content are already managed by the geometry manager then any unspecified options for them retain their previous values rather than receiving default values.
Additional information might be available at the Tcl/Tk pack page.
func Place ¶ added in v0.4.10
func Place(options ...Opt)
Place — Geometry manager for fixed or rubber-sheet placement
Description ¶
The placer is a geometry manager for Tk. It provides simple fixed placement of windows, where you specify the exact size and location of one window, called the content, within another window, called the container. The placer also provides rubber-sheet placement, where you specify the size and location of the content in terms of the dimensions of the container, so that the content changes size and location in response to changes in the size of the container. Lastly, the placer allows you to mix these styles of placement so that, for example, the content has a fixed width and height but is centered inside the container.
The first argument must be a *Window.
The following options are supported:
- Anchor where
Where specifies which point of window is to be positioned at the (x,y) location selected by the -x, -y, -relx, and -rely options. The anchor point is in terms of the outer area of window including its border, if any. Thus if where is se then the lower-right corner of window's border will appear at the given (x,y) location in the container. The anchor position defaults to nw.
- Bordermode mode
Mode determines the degree to which borders within the container are used in determining the placement of the content. The default and most common value is inside. In this case the placer considers the area of the container to be the innermost area of the container, inside any border: an option of -x 0 corresponds to an x-coordinate just inside the border and an option of -relwidth 1.0 means window will fill the area inside the container's border.
If mode is outside then the placer considers the area of the container to include its border; this mode is typically used when placing window outside its container, as with the options -x 0 -y 0 -anchor ne. Lastly, mode may be specified as ignore, in which case borders are ignored: the area of the container is considered to be its official X area, which includes any internal border but no external border. A bordermode of ignore is probably not very useful.
- Height size
Size specifies the height for window in screen units (i.e. any of the forms accepted by Tk_GetPixels). The height will be the outer dimension of window including its border, if any. If size is an empty string, or if no -height or -relheight option is specified, then the height requested internally by the window will be used.
- In container
Container specifies the path name of the window relative to which window is to be placed. Container must either be window's parent or a descendant of window's parent. In addition, container and window must both be descendants of the same top-level window. These restrictions are necessary to guarantee that window is visible whenever container is visible. If this option is not specified then the other window defaults to window's parent.
- Relheight size
Size specifies the height for window. In this case the height is specified as a floating-point number relative to the height of the container: 0.5 means window will be half as high as the container, 1.0 means window will have the same height as the container, and so on. If both -height and -relheight are specified for a content, their values are summed. For example, -relheight 1.0 -height -2 makes the content 2 pixels shorter than the container.
- Relwidth size
Size specifies the width for window. In this case the width is specified as a floating-point number relative to the width of the container: 0.5 means window will be half as wide as the container, 1.0 means window will have the same width as the container, and so on. If both -width and -relwidth are specified for a content, their values are summed. For example, -relwidth 1.0 -width 5 makes the content 5 pixels wider than the container.
- Relx location
Location specifies the x-coordinate within the container window of the anchor point for window. In this case the location is specified in a relative fashion as a floating-point number: 0.0 corresponds to the left edge of the container and 1.0 corresponds to the right edge of the container. Location need not be in the range 0.0-1.0. If both -x and -relx are specified for a content then their values are summed. For example, -relx 0.5 -x -2 positions the left edge of the content 2 pixels to the left of the center of its container.
- Rely location
Location specifies the y-coordinate within the container window of the anchor point for window. In this case the value is specified in a relative fashion as a floating-point number: 0.0 corresponds to the top edge of the container and 1.0 corresponds to the bottom edge of the container. Location need not be in the range 0.0-1.0. If both -y and -rely are specified for a content then their values are summed. For example, -rely 0.5 -x 3 positions the top edge of the content 3 pixels below the center of its container.
- Width size
Size specifies the width for window in screen units (i.e. any of the forms accepted by Tk_GetPixels). The width will be the outer width of window including its border, if any. If size is an empty string, or if no -width or -relwidth option is specified, then the width requested internally by the window will be used.
- X location
Location specifies the x-coordinate within the container window of the anchor point for window. The location is specified in screen units (i.e. any of the forms accepted by Tk_GetPixels) and need not lie within the bounds of the container window.
- Y location
Location specifies the y-coordinate within the container window of the anchor point for window. The location is specified in screen units (i.e. any of the forms accepted by Tk_GetPixels) and need not lie within the bounds of the container window.
If the same value is specified separately with two different options, such as -x and -relx, then the most recent option is used and the older one is ignored.
Additional information might be available at the Tcl/Tk place page.
func Popup ¶ added in v0.57.0
tk_popup — Post a popup menu
Description ¶
This procedure posts a menu at a given position on the screen and configures Tk so that the menu and its cascaded children can be traversed with the mouse or the keyboard. Menu is the name of a menu widget and x and y are the root coordinates at which to display the menu. If entry is omitted or an empty string, the menu's upper left corner is positioned at the given point. Otherwise entry gives the index of an entry in menu and the menu will be positioned so that the entry is positioned over the given point.
Additional information might be available at the Tcl/Tk popup page.
func StyleConfigure ¶ added in v0.19.3
ttk::style — Manipulate style database
Description ¶
Sets the default value of the specified option(s) in style. If style does not exist, it is created. Example:
StyleConfigure(".", Font("times"), Background(LightBlue))
If only style and -option are specified, get the default value for option -option of style style. Example:
StyleConfigure(".", Font)
If only style is specified, get the default value for all options of style style. Example:
StyleConfigure(".")
Additional information might be available at the Tcl/Tk style page. There's also a Styles and Themes tutorial at tkdoc.com.
func StyleElementCreate ¶ added in v0.19.5
ttk::style — Manipulate style database
Description ¶
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)). Examples:
StyleElementCreate("TSpinbox.uparrow", "from", "default") // Inherit the existing element from theme 'default'. StyleElementCreate("Red.Corner.TButton.indicator", "image", NewPhoto(File("red_corner.png")), Width(10)) imageN := NewPhoto(...) StyleElementCreate("TCheckbutton.indicator", "image", image5, "disabled selected", image6, "disabled alternate", image8, "disabled", image9, "alternate", image7, "!selected", image4, Width(20), Border(4), Sticky("w"))
After the type "image" comes a list of one or more images. Every image is optionally followed by a space separated list of states the image applies to. An exclamation mark before the state is a negation.
Additional information might be available at the Tcl/Tk modifying a button and Tcl/Tk style pages. There's also a Styles and Themes tutorial at tkdoc.com.
func StyleElementNames ¶ added in v0.19.5
func StyleElementNames() []string
ttk::style — Manipulate style database
Description ¶
Returns the list of elements defined in the current theme.
Additional information might be available at the Tcl/Tk style page. There's also a Styles and Themes tutorial at tkdoc.com.
func StyleElementOptions ¶ added in v0.19.5
ttk::style — Manipulate style database
Description ¶
Returns the list of element's options.
Additional information might be available at the Tcl/Tk style page. There's also a Styles and Themes tutorial at tkdoc.com.
func StyleLayout ¶ added in v0.19.5
ttk::style — Manipulate style database
Description ¶
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. Example:
StyleLayout("Red.Corner.Button", "Button.border", Sticky("nswe"), Border(1), Children( "Button.focus", Sticky("nswe"), Children( "Button.padding", Sticky("nswe"), Children( "Button.label", Sticky("nswe"), "Red.Corner.TButton.indicator", Side("right"), Sticky("ne")))))
Additional information might be available at the Tcl/Tk modifying a button and Tcl/Tk style pages. There's also a Styles and Themes tutorial at tkdoc.com.
func StyleLookup ¶ added in v0.26.1
ttk::style — Manipulate style database
Description ¶
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. If style does not exist, it is created. For example,
StyleLookup("TButton", Font)
may return "TkDefaultFont", depending on the operating system, theme in use and the configured style options.
Additional information might be available at the Tcl/Tk style page. There's also a Styles and Themes tutorial at tkdoc.com.
func StyleMap ¶ added in v0.26.1
ttk::style — Manipulate style database
Description ¶
Sets dynamic (state dependent) 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. If style does not exist, it is created. If only style and -option are specified, get the dynamic values for option -option of style style. If only style is specified, get the dynamic values for all options of style 'style'.
With no options the function returns the currently configured style map for 'style'. For example,
StyleMap("TButton")
may return "-relief {{!disabled pressed} sunken}", depending on the operating system, theme in use and the configured style options.
Setting a style map is done by providing a list of options, each option is followed by a list of states and a value. For example:
StyleMap("TButton", Background, "disabled", "#112233", "active", "#445566", Foreground, "disabled", "#778899", Relief, "pressed", "!disabled", "sunken")
Widget states ¶
The widget state is a bitmap of independent state flags.
- active - The mouse cursor is over the widget and pressing a mouse button will cause some action to occur
- alternate - A widget-specific alternate display format
- background - Windows and Mac have a notion of an “active” or foreground window. The background state is set for widgets in a background window, and cleared for those in the foreground window
- disabled - Widget is disabled under program control
- focus - Widget has keyboard focus
- invalid - The widget’s value is invalid
- pressed - Widget is being pressed
- readonly - Widget should not allow user modification
- selected - “On”, “true”, or “current” for things like Checkbuttons and radiobuttons
- hover - The mouse cursor is within the widget. This is similar to the active state; it is used in some themes for widgets that provide distinct visual feedback for the active widget in addition to the active element within the widget.
- user1-user6 - Freely usable for other purposes
A state specification is a sequence of state names, optionally prefixed with an exclamation point indicating that the bit is off.
Additional information might be available at the Tcl/Tk style page. There's also a Styles and Themes tutorial at tkdoc.com.
func StyleThemeNames ¶ added in v0.17.1
func StyleThemeNames() []string
ttk::style — Manipulate style database
Description ¶
Returns a list of all known themes.
Additional information might be available at the Tcl/Tk style page.
func StyleThemeStyles ¶ added in v0.17.1
ttk::style — Manipulate style database
Description ¶
Returns a list of all styles in themeName. If themeName is omitted, the current theme is used.
Additional information might be available at the Tcl/Tk style page.
func StyleThemeUse ¶ added in v0.17.1
ttk::style — Manipulate style database
Description ¶
Without a argument the result is the name of the current theme. Otherwise this command sets the current theme to themeName, and refreshes all widgets.
Additional information might be available at the Tcl/Tk style page. There's also a Styles and Themes tutorial at tkdoc.com.
This mechanism is separate from the RegisterTheme/ActivateTheme one. Use of this function is best suited for the built in themes like "clam" etc.
func TclAfter ¶ added in v0.58.0
after — Execute a command after a time delay
Description ¶
If script is not specified, the command sleeps for duration 'ms' and then returns. Negative duration 'ms' is treated as zero. While the command is sleeping the application does not respond to events.
If script is specified, the command returns immediately, but it arranges for a Tcl command to be executed ms milliseconds later as an event handler. The command will be executed exactly once, at the given time. The command will be executed at global level (outside the context of any Tcl procedure). If an error occurs while executing the delayed command then the background error will be reported by the command registered with interp bgerror. The after command returns an identifier that can be used to cancel the delayed command using after cancel. A ms value of 0 (or negative) queues the event immediately with priority over other event types (if not installed withn an event proc, which will wait for next round of events).
More information might be available at the [Tcl/Tk after] page.
func TclAfterCancel ¶ added in v0.58.0
func TclAfterCancel(id string)
after — Execute a command after a time delay
Description ¶
Cancels the execution of a delayed command that was previously scheduled. Id indicates which command should be canceled; it must have been the return value from a previous after command. If the command given by id has already been executed then the after cancel command has no effect.
More information might be available at the [Tcl/Tk after] page.
func TclAfterIdle ¶ added in v0.58.0
after — Execute a command after a time delay
Description ¶
Concatenates the script arguments together with space separators (just as in the concat command), and arranges for the resulting script to be evaluated later as an idle callback. The script will be run exactly once, the next time the event loop is entered and there are no events to process. The command returns an identifier that can be used to cancel the delayed command using after cancel. If an error occurs while executing the script then the background error will be reported by the command registered with interp bgerror.
More information might be available at the [Tcl/Tk after] page.
func TeX2 ¶ added in v0.31.0
TeX2 renders TeX 'src' as a png file that shows the TeX "snippet" in a fixed 600 dpi resolution. The result is afterwards resized using the 'scale' factor. Scale factor 1.0 means no resize.
Only plain Tex and a subset of some of the default Computer Modern fonts are supported. Many small fonts are not available.
func TeXImg ¶ added in v0.30.0
TeXImg renders is line TeX but returns an image.Image.
func TeXImg2 ¶ added in v0.31.0
TeXImg2 renders is line TeX2 but returns an image.Image.
func TkScaling ¶ added in v0.18.0
tk — Manipulate Tk internal state
Description ¶
Sets and queries the current scaling factor used by Tk to convert between physical units (for example, points, inches, or millimeters) and pixels. The number argument is a floating point number that specifies the number of pixels per point on window's display. If the window argument is omitted, it defaults to the main window. If the number argument is omitted, the current value of the scaling factor is returned.
A “point” is a unit of measurement equal to 1/72 inch. A scaling factor of 1.0 corresponds to 1 pixel per point, which is equivalent to a standard 72 dpi monitor. A scaling factor of 1.25 would mean 1.25 pixels per point, which is the setting for a 90 dpi monitor; setting the scaling factor to 1.25 on a 72 dpi monitor would cause everything in the application to be displayed 1.25 times as large as normal. The initial value for the scaling factor is set when the application starts, based on properties of the installed monitor, but it can be changed at any time. Measurements made after the scaling factor is changed will use the new scaling factor, but it is undefined whether existing widgets will resize themselves dynamically to accommodate the new scaling factor.
- Displayof window
- Number
Additional information might be available at the Tcl/Tk tk page.
func TooltipClear ¶ added in v0.49.0
func TooltipClear(pattern string)
tooltip — Tooltip management
Description ¶
Prevents the specified widgets from showing tooltips. pattern is a glob pattern and defaults to matching all widgets.
More information might be available at the Tklib tooltip page.
func TooltipConfigure ¶ added in v0.49.0
tooltip — Tooltip management
Description ¶
Queries or modifies the configuration options of the tooltip. The supported options are -backgroud, -foreground and -font. If one option is specified with no value, returns the value of that option. Otherwise, sets the given options to the corresponding values.
More information might be available at the Tklib tooltip page.
func TooltipDelay ¶ added in v0.49.0
tooltip — Tooltip management
Description ¶
Query or set the hover delay. This is the interval that the pointer must remain over the widget before the tooltip is displayed. The delay is specified in milliseconds and must be greater than or equal to 50 ms. With a negative argument the current delay is returned.
More information might be available at the Tklib tooltip page.
func TooltipFade ¶ added in v0.49.0
tooltip — Tooltip management
Description ¶
Enable or disable fading of the tooltip. The fading is enabled by default on Win32 and Aqua. The tooltip will fade away on Leave events instead disappearing.
More information might be available at the Tklib tooltip page.
func TooltipOff ¶ added in v0.49.0
tooltip — Tooltip management
Description ¶
Disable all tooltips ¶
More information might be available at the Tklib tooltip page.
func TooltipOn ¶ added in v0.49.0
tooltip — Tooltip management
Description ¶
Enables tooltips for defined widgets.
More information might be available at the Tklib tooltip page.
func Update ¶ added in v0.5.18
func Update()
Update — Process pending events and idle callbacks
More information might be available at the Tcl/Tk update page.
func WinfoHeight ¶ added in v0.43.0
winfo — Return window-related information
Description ¶
Returns a decimal string giving window's height in pixels. When a window is first created its height will be 1 pixel; the height will eventually be changed by a geometry manager to fulfil the window's needs. If you need the true height immediately after creating a widget, invoke update to force the geometry manager to arrange it, or use winfo reqheight to get the window's requested height instead of its actual height.
More information might be available at the Tcl/Tk winfo page.
func WinfoScreenHeight ¶ added in v0.53.0
winfo — Return window-related information
Description ¶
Returns a decimal string giving the height of window's screen, in pixels.
More information might be available at the Tcl/Tk winfo page.
func WinfoScreenWidth ¶ added in v0.53.0
winfo — Return window-related information
Description ¶
Returns a decimal string giving the width of window's screen, in pixels.
More information might be available at the Tcl/Tk winfo page.
func WinfoWidth ¶ added in v0.43.0
winfo — Return window-related information
Description ¶
Returns a decimal string giving window's width in pixels. When a window is first created its width will be 1 pixel; the width will eventually be changed by a geometry manager to fulfil the window's needs. If you need the true width immediately after creating a widget, invoke update to force the geometry manager to arrange it, or use winfo reqwidth to get the window's requested width instead of its actual width.
More information might be available at the Tcl/Tk winfo page.
func WmAttributes ¶ added in v0.58.0
wm — Communicate with window manager
Description ¶
- wm attributes window
- wm attributes window ?option?
- wm attributes window ?option value option value...?
This subcommand returns or sets platform specific attributes associated with a window. The first form returns a list of the platform specific flags and their values. The second form returns the value for the specific option. The third form sets one or more of the values. The values are as follows:
Topmost: Specifies whether this is a topmost window (displays above all other windows).
Type: Requests that the window should be interpreted by the window manager as being of the specified type(s). This may cause the window to be decorated in a different way or otherwise managed differently, though exactly what happens is entirely up to the window manager. A list of types may be used, in order of preference. The following values are mapped to constants defined in the EWMH specification (using others is possible, but not advised):
- "desktop" Indicates a desktop feature.
- "dock" Indicates a dock/panel feature.
- "toolbar" Indicates a toolbar window that should be acting on behalf of another window, as indicated with wm transient.
- "menu" Indicates a torn-off menu that should be acting on behalf of another window, as indicated with wm transient.
- "utility" Indicates a utility window (e.g., palette or toolbox) that should be acting on behalf of another window, as indicated with wm transient.
- "splash" Indicates a splash screen, displayed during application start up.
- "dialog" Indicates a general dialog window, that should be acting on behalf of another window, as indicated with wm transient.
- "dropdownMenu" Indicates a menu summoned from a menu bar, which should usually also be set to be override-redirected (with wm overrideredirect).
- "popupMenu" Indicates a popup menu, which should usually also be set to be override-redirected (with wm overrideredirect).
- "tooltip" Indicates a tooltip window, which should usually also be set to be override-redirected (with wm overrideredirect).
- "notification" Indicates a window that provides a background notification of some event, which should usually also be set to be override-redirected (with wm overrideredirect).
- "combo" Indicates the drop-down list of a combobox widget, which should usually also be set to be override-redirected (with wm overrideredirect).
- "dnd" Indicates a window that represents something being dragged, which should usually also be set to be override-redirected (with wm overrideredirect).
- "normal" Indicates a window that has no special interpretation.
More information might be available at the Tcl/Tk wm page.
func WmDeiconify ¶ added in v0.54.0
func WmDeiconify(w *Window)
wm — Communicate with window manager
Description ¶
Arrange for window to be displayed in normal (non-iconified) form. This is done by mapping the window. If the window has never been mapped then this command will not map the window, but it will ensure that when the window is first mapped it will be displayed in de-iconified form. On Windows, a deiconified window will also be raised and be given the focus (made the active window). Returns an empty string.
More information might be available at the Tcl/Tk wm page.
func WmGeometry ¶ added in v0.53.0
wm — Communicate with window manager
Description ¶
If newGeometry is specified, then the geometry of window is changed and an empty string is returned. Otherwise the current geometry for window is returned (this is the most recent geometry specified either by manual resizing or in a wm geometry command). NewGeometry has the form =widthxheight±x±y, where any of =, widthxheight, or ±x±y may be omitted. Width and height are positive integers specifying the desired dimensions of window. If window is gridded (see GRIDDED GEOMETRY MANAGEMENT below) then the dimensions are specified in grid units; otherwise they are specified in pixel units.
X and y specify the desired location of window on the screen, in pixels. If x is preceded by +, it specifies the number of pixels between the left edge of the screen and the left edge of window's border; if preceded by - then x specifies the number of pixels between the right edge of the screen and the right edge of window's border. If y is preceded by + then it specifies the number of pixels between the top of the screen and the top of window's border; if y is preceded by - then it specifies the number of pixels between the bottom of window's border and the bottom of the screen.
If newGeometry is specified as an empty string then any existing user-specified geometry for window is cancelled, and the window will revert to the size requested internally by its widgets.
Note that this is related to winfo geometry, but not the same. That can only query the geometry, and always reflects Tk's current understanding of the actual size and location of window, whereas wm geometry allows both setting and querying of the window manager's understanding of the size and location of the window. This can vary significantly, for example to reflect the addition of decorative elements to window such as title bars, and window managers are not required to precisely follow the requests made through this command.
More information might be available at the Tcl/Tk wm page.
func WmIconify ¶ added in v0.54.0
func WmIconify(w *Window)
wm — Communicate with window manager
Description ¶
Arrange for window to be iconified. It window has not yet been mapped for the first time, this command will arrange for it to appear in the iconified state when it is eventually mapped.
More information might be available at the Tcl/Tk wm page.
func WmMaxSize ¶ added in v0.26.3
wm — Communicate with window manager
Description ¶
Returns the maximum width and height currently in effect. The maximum size defaults to the size of the screen. See the sections on geometry management below for more information.
More information might be available at the Tcl/Tk wm page.
func WmMinSize ¶ added in v0.53.0
wm — Communicate with window manager
Description ¶
If width and height are specified, they give the minimum permissible dimensions for window. For gridded windows the dimensions are specified in grid units; otherwise they are specified in pixel units. The window manager will restrict the window's dimensions to be greater than or equal to width and height. If width and height are specified, then the command returns an empty string. Otherwise it returns a Tcl list with two elements, which are the minimum width and height currently in effect. The minimum size defaults to one pixel in each dimension. See the sections on geometry management below for more information.
More information might be available at the Tcl/Tk wm page.
func WmProtocol ¶ added in v0.42.0
wm — Communicate with window manager
Description ¶
This command is used to manage window manager protocols. The name argument in the wm protocol command is the name of an atom corresponding to a window manager protocol. Examples include WM_DELETE_WINDOW or WM_SAVE_YOURSELF or WM_TAKE_FOCUS. A window manager protocol is a class of messages sent from a window manager to a Tk application outside of the normal event processing system. The main example is the WM_DELETE_WINDOW protocol; these messages are sent when the user clicks the close widget in the title bar of a window. Handlers for window manager protocols are installed with the wm protocol command. As a rule, if no handler has been installed for a protocol by the wm protocol command then all messages of that protocol are ignored. The WM_DELETE_WINDOW protocol is an exception to this rule. At start-up Tk installs a handler for this protocol, which responds by destroying the window. The wm protocol command can be used to replace this default handler by one which responds differently.
A common requirement is to make sure that even if the user clicks the application's close button (X) a close handling function will be called (e.g., to prompt to save unsaved changes). For example, to ensure a custom func onQuit() function is called use:
WmProtocol(App, "WM_DELETE_WINDOW", onQuit)
The list of available window manager protocols depends on the window manager, but all window managers supported by Tk provide WM_DELETE_WINDOW. On the Windows platform, a WM_SAVE_YOURSELF message is sent on user logout or system restart.
If both name and command are specified, then command becomes the handler for the protocol specified by name. The atom for name will be added to window's WM_PROTOCOLS property to tell the window manager that the application has a handler for the protocol specified by name, and command will be invoked in the future whenever the window manager sends a message of that protocol to the Tk application. In this case the wm protocol command returns an empty string. If name is specified but command is not (is nil), then the current handler for name is returned, or an empty string if there is no handler defined for name (as a special case, the default handler for WM_DELETE_WINDOW is not returned). If command is specified as an empty string then the atom for name is removed from the WM_PROTOCOLS property of window and the handler is destroyed; an empty string is returned. Lastly, if neither name nor command is specified, the wm protocol command returns a list of all of the protocols for which handlers are currently defined for window.
More information might be available at the Tcl/Tk wm page.
func WmSetMaxSize ¶ added in v0.26.3
wm — Communicate with window manager
Description ¶
Width and height give the maximum permissible dimensions for window. For gridded windows the dimensions are specified in grid units; otherwise they are specified in pixel units. The window manager will restrict the window's dimensions to be less than or equal to width and height. If width and height are specified, then the command returns an empty string. Otherwise it returns a Tcl list with two elements, which are the maximum width and height currently in effect. The maximum size defaults to the size of the screen. See the sections on geometry management below for more information.
More information might be available at the Tcl/Tk wm page.
func WmTransient ¶ added in v0.56.1
wm — Communicate with window manager
Description ¶
If container is specified, then the window manager is informed that window is a transient window (e.g. pull-down menu) working on behalf of container (where container is the path name for a top-level window). If container is specified as an empty string then window is marked as not being a transient window any more. Otherwise the command returns the path name of window's current container, or an empty string if window is not currently a transient window. A transient window will mirror state changes in the container and inherit the state of the container when initially mapped. The directed graph with an edge from each transient to its container must be acyclic. In particular, it is an error to attempt to make a window a transient of itself. The window manager may also decorate a transient window differently, removing some features normally present (e.g., minimize and maximize buttons) though this is entirely at the discretion of the window manager.
More information might be available at the Tcl/Tk wm page.
func WmWithdraw ¶ added in v0.54.0
func WmWithdraw(w *Window)
wm — Communicate with window manager
Description ¶
Arranges for window to be withdrawn from the screen. This causes the window to be unmapped and forgotten about by the window manager. If the window has never been mapped, then this command causes the window to be mapped in the withdrawn state. Not all window managers appear to know how to handle windows that are mapped in the withdrawn state. Note that it sometimes seems to be necessary to withdraw a window and then re-map it (e.g. with wm deiconify) to get some window managers to pay attention to changes in window attributes such as group.
More information might be available at the Tcl/Tk wm page.
Types ¶
type ButtonWidget ¶ added in v0.11.0
type ButtonWidget struct {
*Window
}
ButtonWidget represents the Tcl/Tk button widget/window
func Button ¶ added in v0.2.0
func Button(options ...Opt) *ButtonWidget
Button — Create and manipulate 'button' action widgets
Description ¶
The button command creates a new window (given by the pathName argument) and makes it into a button widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the button such as its colors, font, text, and initial relief. The button command returns its pathName argument. At the time this command is invoked, there must not exist a window named pathName, but pathName's parent must exist.
A button is a widget that displays a textual string, bitmap or image. If text is displayed, it must all be in a single font, but it can occupy multiple lines on the screen (if it contains newlines or if wrapping occurs because of the -wraplength option) and one of the characters may optionally be underlined using the It can display itself in either of three different ways, according to the -state option; it can be made to appear raised, sunken, or flat; and it can be made to flash. When a user invokes the button (by pressing mouse button 1 with the cursor over the button), then the Tcl command specified in the -command option is invoked.
Use Window.Button to create a Button with a particular parent.
More information might be available at the Tcl/Tk button page.
Standard options ¶
- Activebackground
- Activeforeground
- Anchor
- Background
- Bitmap
- Borderwidth
- Compound
- Cursor
- Disabledforeground
- Foreground
- Highlightbackground
- Highlightcolor
- Highlightthickness
- Image
- Justify
- Padx
- Pady
- Relief
- Repeatdelay
- Repeatinterval
- Takefocus
- Textvariable
- Txt
- Underline
- Wraplength
Widget specific options ¶
Specifies a Tcl command to associate with the button. This command is typically invoked when mouse button 1 is released over the button window.
Specifies one of three states for the default ring: normal, active, or disabled. In active state, the button is drawn with the platform specific appearance for a default button. In normal state, the button is drawn with the platform specific appearance for a non-default button, leaving enough space to draw the default button appearance. The normal and active states will result in buttons of the same size. In disabled state, the button is drawn with the non-default button appearance without leaving space for the default appearance. The disabled state may result in a smaller button than the active state.
Specifies a desired height for the button. If an image or bitmap is being displayed in the button then the value is in screen units (i.e. any of the forms acceptable to Tk_GetPixels); for text it is in lines of text. If this option is not specified, the button's desired height is computed from the size of the image or bitmap or text being displayed in it.
Specifies an alternative relief for the button, to be used when the mouse cursor is over the widget. This option can be used to make toolbar buttons, by configuring -relief flat -overrelief raised. If the value of this option is the empty string, then no alternative relief is used when the mouse cursor is over the button. The empty string is the default value.
Specifies one of three states for the button: normal, active, or disabled. In normal state the button is displayed using the -foreground and -background options. The active state is typically used when the pointer is over the button. In active state the button is displayed using the -activeforeground and -activebackground options. Disabled state means that the button should be insensitive: the default bindings will refuse to activate the widget and will ignore mouse button presses. In this state the -disabledforeground and -background options determine how the button is displayed.
Specifies a desired width for the button. If an image or bitmap is being displayed in the button then the value is in screen units (i.e. any of the forms acceptable to Tk_GetPixels). For a text button (no image or with -compound none) then the width specifies how much space in characters to allocate for the text label. If the width is negative then this specifies a minimum width. If this option is not specified, the button's desired width is computed from the size of the image or bitmap or text being displayed in it.
func Exit ¶ added in v0.5.18
func Exit(options ...Opt) *ButtonWidget
Exit provides a canned Button with default Txt "Exit", bound to the ExitHandler.
Use Window.Exit to create a Exit with a particular parent.
func (*ButtonWidget) Invoke ¶ added in v0.44.0
func (w *ButtonWidget) Invoke() string
button — Create and manipulate 'button' action widgets
Description ¶
Invoke the Tcl command associated with the button, if there is one. The return value is the return value from the Tcl command, or an empty string if there is no command associated with the button. This command is ignored if the button's state is disabled.
Additional information might be available at the Tcl/Tk button page.
type CanvasWidget ¶ added in v0.11.0
type CanvasWidget struct {
*Window
}
CanvasWidget represents the Tcl/Tk canvas widget/window
func Canvas ¶ added in v0.2.0
func Canvas(options ...Opt) *CanvasWidget
Canvas — Create and manipulate 'canvas' hypergraphics drawing surface widgets
Use Window.Canvas to create a Canvas with a particular parent.
More information might be available at the Tcl/Tk canvas page.
Standard options ¶
- Background
- Borderwidth
- Cursor
- Highlightbackground
- Highlightcolor
- Highlightthickness
- Insertbackground
- Insertborderwidth
- Insertofftime
- Insertontime
- Insertwidth
- Relief
- Selectbackground
- Selectborderwidth
- Selectforeground
- Takefocus
- Xscrollcommand
- Yscrollcommand
Widget specific options ¶
Specifies a floating-point value indicating how close the mouse cursor must be to an item before it is considered to be the item. Defaults to 1.0.
Specifies a boolean value that indicates whether or not it should be allowable to set the canvas's view outside the region defined by the scrollRegion argument. Defaults to true, which means that the view will be constrained within the scroll region.
Specifies a desired window height that the canvas widget should request from its geometry manager. The value may be specified in any of the forms described in the COORDINATES section below.
Specifies a list with four coordinates describing the left, top, right, and bottom coordinates of a rectangular region. This region is used for scrolling purposes and is considered to be the boundary of the information in the canvas. Each of the coordinates may be specified in any of the forms given in the COORDINATES section below.
Modifies the default state of the canvas where state may be set to one of: normal, disabled, or hidden. Individual canvas objects all have their own state option which may override the default state. Many options can take separate specifications such that the appearance of the item can be different in different situations. The options that start with active control the appearance when the mouse pointer is over it, while the option starting with disabled controls the appearance when the state is disabled. Canvas items which are disabled will not react to canvas bindings.
Specifies a desired window width that the canvas widget should request from its geometry manager. The value may be specified in any of the forms described in the COORDINATES section below.
Specifies an increment for horizontal scrolling, in any of the usual forms permitted for screen distances. If the value of this option is greater than zero, the horizontal view in the window will be constrained so that the canvas x coordinate at the left edge of the window is always an even multiple of xScrollIncrement; furthermore, the units for scrolling (e.g., the change in view when the left and right arrows of a scrollbar are selected) will also be xScrollIncrement. If the value of this option is negative or zero, then horizontal scrolling is unconstrained.
Specifies an increment for vertical scrolling, in any of the usual forms permitted for screen distances. If the value of this option is greater than zero, the vertical view in the window will be constrained so that the canvas y coordinate at the top edge of the window is always an even multiple of yScrollIncrement; furthermore, the units for scrolling (e.g., the change in view when the top and bottom arrows of a scrollbar are selected) will also be yScrollIncrement. If the value of this option is negative or zero, then vertical scrolling is unconstrained.
func (*CanvasWidget) Bbox ¶ added in v0.62.1
func (w *CanvasWidget) Bbox(tagIds ...string) []string
Canvas — Create and manipulate 'canvas' hypergraphics drawing surface widgets
Description ¶
Returns a list with four elements giving an approximate bounding box for all the items named by the tagOrId arguments. The list has the form “x1 y1 x2 y2” such that the drawn areas of all the named elements are within the region bounded by x1 on the left, x2 on the right, y1 on the top, and y2 on the bottom. The return value may overestimate the actual bounding box by a few pixels. If no items match any of the tagOrId arguments or if the matching items have empty bounding boxes (i.e. they have nothing to display) then an empty string is returned.
More information might be available at the Tcl/Tk canvas page.
func (*CanvasWidget) CreateArc ¶ added in v0.62.0
func (w *CanvasWidget) CreateArc(x1, y1, x2, y2 any, options ...any) (r string)
Canvas — Create and manipulate 'canvas' hypergraphics drawing surface widgets
Description ¶
Create a new arc in pathName of type type. The exact format of the arguments after type depends on type, but usually they consist of the coordinates for one or more points, followed by specifications for zero or more item options. See the subsections on individual item types below for more on the syntax of this command. This command returns the id for the new item.
Items of type arc appear on the display as arc-shaped regions. An arc is a section of an oval delimited by two angles (specified by either the -start and -extent options or the -height option) and displayed in one of several ways (specified by the -style option). Arcs are created with widget commands of the following form:
pathName create arc x1 y1 x2 y2 ?option value ...?
The arguments x1, y1, x2, and y2 or coordList give the coordinates of two diagonally opposite corners of a rectangular region enclosing the oval that defines the arc (except when -height is specified - see below). After the coordinates there may be any number of option-value pairs, each of which sets one of the configuration options for the item. These same option-value pairs may be used in itemconfigure widget commands to change the item's configuration. An arc item becomes the current item when the mouse pointer is over any part that is painted or (when fully transparent) that would be painted if both the -fill and -outline options were non-empty.
The following standard options are supported by arcs:
- Dash
- Activedash
- Disableddash
- Dashoffset
- Fill
- Activefill
- Disabledfill
- Offset
- Outline
- Activeoutline
- Disabledoutline
- Outlineoffset
- Outlinestipple
- Activeoutlinestipple
- Disabledoutlinestipple
- Stipple
- Activestipple
- Disabledstipple
- State
- Tags
- Width
- Activewidth
- Disabledwidth
The following extra options are supported for arcs:
Provides a shortcut for creating a circular arc segment by defining the distance of the mid-point of the arc from its chord. When this option is used the coordinates are interpreted as the start and end coordinates of the chord, and the options -start and -extent are ignored. The value of distance has the following meaning:
distance > 0 creates a clockwise arc, distance < 0 creates an counter-clockwise arc, distance = 0 creates an arc as if this option had not been specified.
If you want the arc to have a specific radius, r, use the formula:
distance = r ± sqrt(r**2 - (chordLength / 2)**2)
choosing the minus sign for the minor arc and the plus sign for the major arc.
Note that itemcget -height always returns 0 so that introspection code can be kept simple.
- Style type
Specifies how to draw the arc. If type is pieslice (the default) then the arc's region is defined by a section of the oval's perimeter plus two line segments, one between the center of the oval and each end of the perimeter section. If type is chord then the arc's region is defined by a section of the oval's perimeter plus a single line segment connecting the two end points of the perimeter section. If type is arc then the arc's region consists of a section of the perimeter alone. In this last case the -fill option is ignored.
More information might be available at the Tcl/Tk canvas page.
func (*CanvasWidget) CreateBitmap ¶ added in v0.62.0
func (w *CanvasWidget) CreateBitmap(x, y any, options ...any) (r string)
Canvas — Create and manipulate 'canvas' hypergraphics drawing surface widgets
Description ¶
Items of type bitmap appear on the display as images with two colors, foreground and background. Bitmaps are created with widget commands of the following form:
pathName create bitmap x y ?option value ...?
The arguments x and y or coordList (which must have two elements) specify the coordinates of a point used to position the bitmap on the display, as controlled by the -anchor option. After the coordinates there may be any number of option-value pairs, each of which sets one of the configuration options for the item. These same option-value pairs may be used in itemconfigure widget commands to change the item's configuration. A bitmap item becomes the current item when the mouse pointer is over any part of its bounding box.
The following standard options are supported by bitmaps:
The following extra options are supported for bitmaps:
Background color
Activebackground color
Disabledbackground color
Specifies the color to use for each of the bitmap's “0” valued pixels in its normal, active and disabled states. Color may have any of the forms accepted by Tk_GetColor. If this option is not specified, or if it is specified as an empty string, then nothing is displayed where the bitmap pixels are 0; this produces a transparent effect.
Bitmap bitmap
Activebitmap bitmap
Disabledbitmap bitmap:
These options specify the bitmaps to display in the item in its normal, active and disabled states. Bitmap may have any of the forms accepted by Tk_GetBitmap.
Foreground color
Activeforeground color
Disabledforeground color:
These options specify the color to use for each of the bitmap's “1” valued pixels in its normal, active and disabled states. Color may have any of the forms accepted by Tk_GetColor.
More information might be available at the Tcl/Tk canvas page.
func (*CanvasWidget) CreateImage ¶ added in v0.62.0
func (w *CanvasWidget) CreateImage(x, y any, options ...any) (r string)
Canvas — Create and manipulate 'canvas' hypergraphics drawing surface widgets
Description ¶
Items of type image are used to display images on a canvas. Images are created with widget commands of the following form:
pathName create image x y ?option value ...?
The arguments x and y or coordList specify the coordinates of a point used to position the image on the display, as controlled by the -anchor option. After the coordinates there may be any number of option-value pairs, each of which sets one of the configuration options for the item. These same option-value pairs may be used in itemconfigure widget commands to change the item's configuration. An image item becomes the current item when the mouse pointer is over any part of its bounding box.
The following standard options are supported by images:
The following extra options are supported for images:
Image name
Activeimage name
Disabledimage name
Specifies the name of the images to display in the item in is normal, active and disabled states. This image must have been created previously with the image create command.
More information might be available at the Tcl/Tk canvas page.
func (*CanvasWidget) CreateLine ¶ added in v0.62.0
func (w *CanvasWidget) CreateLine(x1, y1 any, options ...any) (r string)
Canvas — Create and manipulate 'canvas' hypergraphics drawing surface widgets
Description ¶
Items of type line appear on the display as one or more connected line segments or curves. Line items support coordinate indexing operations using the dchars, index and insert widget commands. Lines are created with widget commands of the following form:
pathName create line x1 y1... xn yn ?option value ...?
The following standard options are supported by lines:
- Dash
- Activedash
- Disableddash
- Dashoffset
- Fill
- Activefill
- Disabledfill
- Stipple
- Activestipple
- Disabledstipple
- State
- Tags
- Width
- Activewidth
- Disabledwidth
The following extra options are supported for lines:
- Linearrow where
- Arrowshape shape
- Capstyle style
- Joinstyle style
- Smooth smoothMethod
- Splinesteps number
More information might be available at the Tcl/Tk canvas page.
func (*CanvasWidget) CreateOval ¶ added in v0.62.0
func (w *CanvasWidget) CreateOval(x1, y1, x2, y2 any, options ...any) (r string)
Canvas — Create and manipulate 'canvas' hypergraphics drawing surface widgets
Description ¶
Items of type oval appear as circular or oval regions on the display. Each oval may have an outline, a fill, or both. Ovals are created with widget commands of the following form:
pathName create oval x1 y1 x2 y2 ?option value ...?
The following standard options are supported by ovals:
- Dash
- Activedash
- Disableddash
- Dashoffset
- Fill
- Activefill
- Disabledfill
- Offset
- Outline
- Activeoutline
- Disabledoutline
- Outlineoffset
- Outlinestipple
- Activeoutlinestipple
- Disabledoutlinestipple
- Stipple
- Activestipple
- Disabledstipple
- State
- Tags
- Width
- Activewidth
- Disabledwidth
There are no oval-specific options.
More information might be available at the Tcl/Tk canvas page.
func (*CanvasWidget) CreatePolygon ¶ added in v0.62.0
func (w *CanvasWidget) CreatePolygon(x1, y1 any, options ...any) (r string)
Canvas — Create and manipulate 'canvas' hypergraphics drawing surface widgets
Description ¶
Items of type polygon appear as polygonal or curved filled regions on the display. Polygon items support coordinate indexing operations using the dchars, index and insert widget commands. Polygons are created with widget commands of the following form:
pathName create polygon x1 y1 ... xn yn ?option value ...?
The arguments x1 through yn or coordList specify the coordinates for three or more points that define a polygon. The first point should not be repeated as the last to close the shape; Tk will automatically close the periphery between the first and last points. After the coordinates there may be any number of option-value pairs, each of which sets one of the configuration options for the item. These same option-value pairs may be used in itemconfigure widget commands to change the item's configuration. A polygon item is the current item whenever the mouse pointer is over any part of the polygon, whether drawn or not and whether or not the outline is smoothed.
The following standard options are supported by polygons:
- Dash
- Activedash
- Disableddash
- Dashoffset
- Fill
- Activefill
- Disabledfill
- Offset
- Outline
- Activeoutline
- Disabledoutline
- Outlineoffset
- Outlinestipple
- Activeoutlinestipple
- Disabledoutlinestipple
- Stipple
- Activestipple
- Disabledstipple
- State
- Tags
- Width
- Activewidth
- Disabledwidth
The following extra options are supported for polygons:
Joinstyle style
Specifies the ways in which joints are to be drawn at the vertices of the outline. Style may have any of the forms accepted by Tk_GetJoinStyle (bevel, miter, or round). If this option is not specified then it defaults to round.
Smooth boolean
Boolean must have one of the forms accepted by Tcl_GetBoolean or a line smoothing method. Only true and raw are supported in the core (with bezier being an alias for true), but more can be added at runtime. If a boolean false value or empty string is given, no smoothing is applied. A boolean truth value assumes true smoothing. If the smoothing method is true, this indicates that the polygon should be drawn as a curve, rendered as a set of quadratic splines: one spline is drawn for the first and second line segments, one for the second and third, and so on. Straight-line segments can be generated within a curve by duplicating the end-points of the desired line segment. If the smoothing method is raw, this indicates that the polygon should also be drawn as a curve but where the list of coordinates is such that the first coordinate pair (and every third coordinate pair thereafter) is a knot point on a cubic Bezier curve, and the other coordinates are control points on the cubic Bezier curve. Straight line segments can be generated within a curve by making control points equal to their neighbouring knot points. If the last point is not the second point of a pair of control points, the point is repeated (one or two times) so that it also becomes the second point of a pair of control points (the associated knot point will be the first control point).
Splinesteps number
Specifies the degree of smoothness desired for curves: each spline will be approximated with number line segments. This option is ignored unless the -smooth option is true or raw.
Polygon items are different from other items such as rectangles, ovals and arcs in that interior points are considered to be “inside” a polygon (e.g. for purposes of the find closest and find overlapping widget commands) even if it is not filled. For most other item types, an interior point is considered to be inside the item only if the item is filled or if it has neither a fill nor an outline. If you would like an unfilled polygon whose interior points are not considered to be inside the polygon, use a line item instead.
More information might be available at the Tcl/Tk canvas page.
func (*CanvasWidget) CreateRectangle ¶ added in v0.62.0
func (w *CanvasWidget) CreateRectangle(x1, y1, x2, y2 any, options ...any) (r string)
Canvas — Create and manipulate 'canvas' hypergraphics drawing surface widgets
Description ¶
Items of type rectangle appear as rectangular regions on the display. Each rectangle may have an outline, a fill, or both. Rectangles are created with widget commands of the following form:
pathName create rectangle x1 y1 x2 y2 ?option value ...?
The arguments x1, y1, x2, and y2 or coordList (which must have four elements) give the coordinates of two diagonally opposite corners of the rectangle (the rectangle will include its upper and left edges but not its lower or right edges). After the coordinates there may be any number of option-value pairs, each of which sets one of the configuration options for the item. These same option-value pairs may be used in itemconfigure widget commands to change the item's configuration. A rectangle item becomes the current item when the mouse pointer is over any part that is painted or (when fully transparent) that would be painted if both the -fill and -outline options were non-empty.
The following standard options are supported by rectangles:
- Dash
- Activedash
- Disableddash
- Dashoffset
- Fill
- Activefill
- Disabledfill
- Offset
- Outline
- Activeoutline
- Disabledoutline
- Outlineoffset
- Outlinestipple
- Activeoutlinestipple
- Disabledoutlinestipple
- Stipple
- Activestipple
- Disabledstipple
- State
- Tags
- Width
- Activewidth
- Disabledwidth
There are no rectangle-specific options.
More information might be available at the Tcl/Tk canvas page.
func (*CanvasWidget) CreateText ¶ added in v0.62.0
func (w *CanvasWidget) CreateText(x, y any, options ...any) (r string)
Canvas — Create and manipulate 'canvas' hypergraphics drawing surface widgets
Description ¶
A text item displays a string of characters on the screen in one or more lines. Text items support indexing, editing and selection through the dchars widget command, the focus widget command, the icursor widget command, the index widget command, the insert widget command, and the select widget command. Text items are created with widget commands of the following form:
pathName create text x y ?option value ...?
The arguments x and y or coordList (which must have two elements) specify the coordinates of a point used to position the text on the display (see the options below for more information on how text is displayed). After the coordinates there may be any number of option-value pairs, each of which sets one of the configuration options for the item. These same option-value pairs may be used in itemconfigure widget commands to change the item's configuration. A text item becomes the current item when the mouse pointer is over any part of its bounding box.
The following standard options are supported by text items:
The following extra options are supported for text items:
Angle rotationDegrees
RotationDegrees tells how many degrees to rotate the text anticlockwise about the positioning point for the text; it may have any floating-point value from 0.0 to 360.0. For example, if rotationDegrees is 90, then the text will be drawn vertically from bottom to top. This option defaults to 0.0.
Font fontName
Specifies the font to use for the text item. FontName may be any string acceptable to Tk_GetFont. If this option is not specified, it defaults to a system-dependent font.
Justify how
Specifies how to justify the text within its bounding region. How must be one of the values left, right, or center. This option will only matter if the text is displayed as multiple lines. If the option is omitted, it defaults to left.
Txt string
String specifies the characters to be displayed in the text item. Newline characters cause line breaks. The characters in the item may also be changed with the insert and delete widget commands. This option defaults to an empty string.
Underline number
Specifies the integer index of a character within the text to be underlined. 0 corresponds to the first character of the text displayed, 1 to the next character, and so on. -1 means that no underline should be drawn (if the whole text item is to be underlined, the appropriate font should be used instead).
Width lineLength
Specifies a maximum line length for the text, in any of the forms described in the COORDINATES section above. If this option is zero (the default) the text is broken into lines only at newline characters. However, if this option is non-zero then any line that would be longer than lineLength is broken just before a space character to make the line shorter than lineLength; the space character is treated as if it were a newline character.
More information might be available at the Tcl/Tk canvas page.
func (*CanvasWidget) CreateWindow ¶ added in v0.62.0
func (w *CanvasWidget) CreateWindow(x, y any, options ...any) (r string)
Canvas — Create and manipulate 'canvas' hypergraphics drawing surface widgets
Description ¶
Items of type window cause a particular window to be displayed at a given position on the canvas. Window items are created with widget commands of the following form:
pathName create window x y ?option value ...?
The arguments x and y or coordList (which must have two elements) specify the coordinates of a point used to position the window on the display, as controlled by the -anchor option. After the coordinates there may be any number of option-value pairs, each of which sets one of the configuration options for the item. These same option-value pairs may be used in itemconfigure widget commands to change the item's configuration. Theoretically, a window item becomes the current item when the mouse pointer is over any part of its bounding box, but in practice this typically does not happen because the mouse pointer ceases to be over the canvas at that point.
The following standard options are supported by window items:
The following extra options are supported for window items:
Height pixels
Specifies the height to assign to the item's window. Pixels may have any of the forms described in the COORDINATES section above. If this option is not specified, or if it is specified as zero, then the window is given whatever height it requests internally.
Width pixels Specifies the width to assign to the item's window. Pixels may have any of the forms described in the COORDINATES section above. If this option is not specified, or if it is specified as zero, then the window is given whatever width it requests internally.
ItemWindow pathName
Specifies the window to associate with this item. The window specified by pathName must either be a child of the canvas widget or a child of some ancestor of the canvas widget. PathName may not refer to a top-level window.
Note that, due to restrictions in the ways that windows are managed, it is not possible to draw other graphical items (such as lines and images) on top of window items. A window item always obscures any graphics that overlap it, regardless of their order in the display list. Also note that window items, unlike other canvas items, are not clipped for display by their containing canvas's border, and are instead clipped by the parent widget of the window specified by the -window option; when the parent widget is the canvas, this means that the window item can overlap the canvas's border.
More information might be available at the Tcl/Tk canvas page.
func (*CanvasWidget) Delete ¶ added in v0.62.0
func (w *CanvasWidget) Delete(tagOrId ...any) (r string)
Canvas — Create and manipulate 'canvas' hypergraphics drawing surface widgets
Description ¶
More information might be available at the Tcl/Tk canvas page.
func (*CanvasWidget) Graph ¶ added in v0.11.0
func (w *CanvasWidget) Graph(script string) *CanvasWidget
Graph — use gnuplot to draw on a canvas. Graph returns 'w'.
The 'script' argument is passed to a gnuplot executable, which must be installed on the machine. See the gnuplot site for documentation about producing graphs. The script must not use the 'set term <device>' command.
type CheckbuttonWidget ¶ added in v0.11.0
type CheckbuttonWidget struct {
}CheckbuttonWidget represents the Tcl/Tk checkbutton widget/window
func Checkbutton ¶ added in v0.2.0
func Checkbutton(options ...Opt) *CheckbuttonWidget
Checkbutton — Create and manipulate 'checkbutton' boolean selection widgets
Description ¶
The checkbutton command creates a new window (given by the pathName argument) and makes it into a checkbutton widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the checkbutton such as its colors, font, text, and initial relief. The checkbutton command returns its pathName argument. At the time this command is invoked, there must not exist a window named pathName, but pathName's parent must exist.
A checkbutton is a widget that displays a textual string, bitmap or image and a square called an indicator. If text is displayed, it must all be in a single font, but it can occupy multiple lines on the screen (if it contains newlines or if wrapping occurs because of the -wraplength option) and one of the characters may optionally be underlined using the A checkbutton has all of the behavior of a simple button, including the following: it can display itself in either of three different ways, according to the -state option; it can be made to appear raised, sunken, or flat; it can be made to flash; and it invokes a Tcl command whenever mouse button 1 is clicked over the checkbutton.
In addition, checkbuttons can be selected. If a checkbutton is selected then the indicator is normally drawn with a selected appearance, and a Tcl variable associated with the checkbutton is set to a particular value (normally 1). The indicator is drawn with a check mark inside. If the checkbutton is not selected, then the indicator is drawn with a deselected appearance, and the associated variable is set to a different value (typically 0). The indicator is drawn without a check mark inside. In the special case where the variable (if specified) has a value that matches the tristatevalue, the indicator is drawn with a tri-state appearance and is in the tri-state mode indicating mixed or multiple values. (This is used when the check box represents the state of multiple items.) The indicator is drawn in a platform dependent manner. Under Unix and Windows, the background interior of the box is grayed . Under Mac, the indicator is drawn with a dash mark inside. By default, the name of the variable associated with a checkbutton is the same as the name used to create the checkbutton. The variable name, and the on , off and tristate values stored in it, may be modified with options on the command line or in the option database. Configuration options may also be used to modify the way the indicator is displayed (or whether it is displayed at all). By default a checkbutton is configured to select and deselect itself on alternate button clicks. In addition, each checkbutton monitors its associated variable and automatically selects and deselects itself when the variables value changes to and from the button's on , off and tristate values.
Use Window.Checkbutton to create a Checkbutton with a particular parent.
More information might be available at the Tcl/Tk checkbutton page.
Standard options ¶
- Activebackground
- Activeforeground
- Anchor
- Background
- Bitmap
- Borderwidth
- Compound
- Cursor
- Disabledforeground
- Foreground
- Highlightbackground
- Highlightcolor
- Highlightthickness
- Image
- Justify
- Padx
- Pady
- Relief
- Takefocus
- Textvariable
- Txt
- Underline
- Wraplength
Widget specific options ¶
Specifies a Tcl command to associate with the button. This command is typically invoked when mouse button 1 is released over the button window. The button's global variable (-variable option) will be updated before the command is invoked.
Specifies a desired height for the button. If an image or bitmap is being displayed in the button then the value is in screen units (i.e. any of the forms acceptable to Tk_GetPixels); for text it is in lines of text. If this option is not specified, the button's desired height is computed from the size of the image or bitmap or text being displayed in it.
Specifies whether or not the indicator should be drawn. Must be a proper boolean value. If false, the -relief option is ignored and the widget's relief is always sunken if the widget is selected and raised otherwise.
Specifies the relief for the checkbutton when the indicator is not drawn and the checkbutton is off. The default value is By setting this option to and setting -indicatoron to false and -overrelief to the effect is achieved of having a flat button that raises on mouse-over and which is depressed when activated. This is the behavior typically exhibited by the Bold, Italic, and Underline checkbuttons on the toolbar of a word-processor, for example.
Specifies value to store in the button's associated variable whenever this button is deselected. Defaults to
Specifies value to store in the button's associated variable whenever this button is selected. Defaults to
Specifies an alternative relief for the checkbutton, to be used when the mouse cursor is over the widget. This option can be used to make toolbar buttons, by configuring -relief flat -overrelief raised. If the value of this option is the empty string, then no alternative relief is used when the mouse cursor is over the checkbutton. The empty string is the default value.
Specifies a background color to use when the button is selected. If indicatorOn is true then the color is used as the background for the indicator regardless of the select state. If indicatorOn is false, this color is used as the background for the entire widget, in place of background or activeBackground, whenever the widget is selected. If specified as an empty string then no special color is used for displaying when the widget is selected.
Specifies an image to display (in place of the -image option) when the checkbutton is selected. This option is ignored unless the -image option has been specified.
Specifies one of three states for the checkbutton: normal, active, or disabled. In normal state the checkbutton is displayed using the -foreground and -background options. The active state is typically used when the pointer is over the checkbutton. In active state the checkbutton is displayed using the -activeforeground and -activebackground options. Disabled state means that the checkbutton should be insensitive: the default bindings will refuse to activate the widget and will ignore mouse button presses. In this state the -disabledforeground and -background options determine how the checkbutton is displayed.
Specifies an image to display (in place of the -image option) when the checkbutton is in tri-state mode. This option is ignored unless the -image option has been specified.
Specifies the value that causes the checkbutton to display the multi-value selection, also known as the tri-state mode. Defaults to
Specifies the name of a global variable to set to indicate whether or not this button is selected. Defaults to the name of the button within its parent (i.e. the last element of the button window's path name).
Specifies a desired width for the button. If an image or bitmap is being displayed in the button then the value is in screen units (i.e. any of the forms acceptable to Tk_GetPixels); for text it is in characters. If this option is not specified, the button's desired width is computed from the size of the image or bitmap or text being displayed in it.
func (*CheckbuttonWidget) Deselect ¶ added in v0.32.0
func (w *CheckbuttonWidget) Deselect()
checkbutton — Create and manipulate 'checkbutton' boolean selection widgets
Description ¶
Deselects the checkbutton and sets the associated variable to its “off” value.
More information might be available at the Tcl/Tk checkbutton page.
func (*CheckbuttonWidget) Invoke ¶ added in v0.52.0
func (w *CheckbuttonWidget) Invoke() string
checkbutton — Create and manipulate 'checkbutton' boolean selection widgets
Description ¶
Does just what would have happened if the user invoked the checkbutton with the mouse: toggle the selection state of the button and invoke the Tcl command associated with the checkbutton, if there is one. The return value is the return value from the Tcl command, or an empty string if there is no command associated with the checkbutton. This command is ignored if the checkbutton's state is disabled.
More information might be available at the Tcl/Tk checkbutton page.
func (*CheckbuttonWidget) Select ¶ added in v0.32.0
func (w *CheckbuttonWidget) Select()
checkbutton — Create and manipulate 'checkbutton' boolean selection widgets
Description ¶
Selects the checkbutton and sets the associated variable to its “on” value.
More information might be available at the Tcl/Tk checkbutton page.
type EntryWidget ¶ added in v0.11.0
type EntryWidget struct {
*Window
}
EntryWidget represents the Tcl/Tk entry widget/window
func Entry ¶ added in v0.2.0
func Entry(options ...Opt) *EntryWidget
Entry — Create and manipulate 'entry' one-line text entry widgets
Description ¶
The entry command creates a new window (given by the pathName argument) and makes it into an entry widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the entry such as its colors, font, and relief. The entry command returns its pathName argument. At the time this command is invoked, there must not exist a window named pathName, but pathName's parent must exist.
An entry is a widget that displays a one-line text string and allows that string to be edited using widget commands described below, which are typically bound to keystrokes and mouse actions. When first created, an entry's string is empty. A portion of the entry may be selected as described below. If an entry is exporting its selection (see the -exportselection option), then it will observe the standard X11 protocols for handling the selection; entry selections are available as type STRING. Entries also observe the standard Tk rules for dealing with the input focus. When an entry has the input focus it displays an insertion cursor to indicate where new characters will be inserted.
Entries are capable of displaying strings that are too long to fit entirely within the widget's window. In this case, only a portion of the string will be displayed; commands described below may be used to change the view in the window. Entries use the standard -xscrollcommand mechanism for interacting with scrollbars (see the description of the -xscrollcommand option for details). They also support scanning, as described below.
Use Window.Entry to create a Entry with a particular parent.
More information might be available at the Tcl/Tk entry page.
Standard options ¶
- Background
- Borderwidth
- Cursor
- Exportselection
- Foreground
- Highlightbackground
- Highlightcolor
- Highlightthickness
- Insertbackground
- Insertborderwidth
- Insertofftime
- Insertontime
- Insertwidth
- Justify
- Placeholder
- Placeholderforeground
- Relief
- Selectbackground
- Selectborderwidth
- Selectforeground
- Takefocus
- Textvariable
- Xscrollcommand
Widget specific options ¶
Specifies the background color to use when the entry is disabled. If this option is the empty string, the normal background color is used.
Specifies the foreground color to use when the entry is disabled. If this option is the empty string, the normal foreground color is used.
Specifies a script to eval when -validatecommand returns 0. Setting it to {} disables this feature (the default). The best use of this option is to set it to bell. See VALIDATION below for more information.
Specifies the background color to use when the entry is readonly. If this option is the empty string, the normal background color is used.
If this option is specified, then the true contents of the entry are not displayed in the window. Instead, each character in the entry's value will be displayed as the first character in the value of this option, such as This is useful, for example, if the entry is to be used to enter a password. If characters in the entry are selected and copied elsewhere, the information copied will be what is displayed, not the true contents of the entry.
Specifies one of three states for the entry: normal, disabled, or readonly. If the entry is readonly, then the value may not be changed using widget commands and no insertion cursor will be displayed, even if the input focus is in the widget; the contents of the widget may still be selected. If the entry is disabled, the value may not be changed, no insertion cursor will be displayed, the contents will not be selectable, and the entry may be displayed in a different color, depending on the values of the -disabledforeground and -disabledbackground options.
Specifies the mode in which validation should operate: none, focus, focusin, focusout, key, or all. It defaults to none. When you want validation, you must explicitly state which mode you wish to use. See VALIDATION below for more.
Specifies a script to eval when you want to validate the input into the entry widget. Setting it to {} disables this feature (the default). This command must return a valid Tcl boolean value. If it returns 0 (or the valid Tcl boolean equivalent) then it means you reject the new edition and it will not occur and the -invalidcommand will be evaluated if it is set. If it returns 1, then the new edition occurs. See VALIDATION below for more information.
Specifies an integer value indicating the desired width of the entry window, in average-size characters of the widget's font. If the value is negative or zero, the widget picks a size just large enough to hold its current text.
func (*EntryWidget) Icursor ¶ added in v0.58.0
func (w *EntryWidget) Icursor(index any) (r string)
Entry — Create and manipulate 'entry' one-line text entry widgets
Description ¶
Arrange for the insertion cursor to be displayed just before the character given by index. Returns an empty string.
More information might be available at the Tcl/Tk entry page.
type Event ¶ added in v0.17.0
type Event struct { // Event handlers should set Err on failure. Err error // Result can be optionally set by the handler. The field is returned by // certain methods, for example [TCheckbuttonWidget.Invoke]. Result string // Event source, if any. This field is set when the event handler was // created. W *Window // The window to which the event was reported (the window field from // the event). Valid for all event types. This field is set when the // event is handled. EventWindow *Window // The keysym corresponding to the event, substituted as a textual string. // Valid only for Key and KeyRelease events. Keysym string // The number of the last client request processed by the server (the serial // field from the event). Valid for all event types. Serial int64 // The width field from the event. Indicates the new or requested width of the // window. Valid only for Configure, ConfigureRequest, Create, ResizeRequest, // and Expose events. Width string // The height field from the event. Valid for the Configure, ConfigureRequest, // Create, ResizeRequest, and Expose events. Indicates the new or requested // height of the window. Height string // The x and y fields from the event. For Button, ButtonRelease, Motion, Key, // KeyRelease, and MouseWheel events, X and Y indicate the position of the // mouse pointer relative to the receiving window. For key events on the // Macintosh these are the coordinates of the mouse at the moment when an X11 // KeyEvent is sent to Tk, which could be slightly later than the time of the // physical press or release. For Enter and Leave events, the position where // the mouse pointer crossed the window, relative to the receiving window. For // Configure and Create requests, the x and y coordinates of the window // relative to its parent window. X, Y int // The x_root and y_root fields from the event. If a virtual-root window // manager is being used then the substituted values are the corresponding // x-coordinate and y-coordinate in the virtual root. Valid only for Button, // ButtonRelease, Enter, Key, KeyRelease, Leave and Motion events. Same meaning // as X and Y, except relative to the (virtual) root window. XRoot, YRoot int // The delta value of a MouseWheel event. The delta value represents // the rotation units the mouse wheel has been moved. The sign of the // value represents the direction the mouse wheel was scrolled. Delta int // The state field from the event. For KeyPress, KeyRelease, ButtonPress, // ButtonRelease, Enter, Leave, and Motion events, it is a bit field. // Visibility events are not currently supported, and the value will be 0. State Modifier // contains filtered or unexported fields }
Event communicates information with an event handler. All handlers can use the Err field. Simple handlers, like in
Button(..., Command(func(e *Event) {...}))
can use the 'W' field, if applicable. All other fields are valid only in handlers bound using Bind.
func (*Event) ScrollSet ¶ added in v0.17.0
ScrollSet communicates events to scrollbars. Example:
var scroll *TScrollbarWidget // tcl: text .text -yscrollcommand ".scroll set" t := Text(..., Yscrollcommand(func(e *Event) { e.ScrollSet(scroll) }))
func (*Event) SetReturnCodeBreak ¶ added in v0.46.0
func (e *Event) SetReturnCodeBreak()
SetReturnCodeBreak sets return code of 'e' to TCL_BREAK.
func (*Event) SetReturnCodeContinue ¶ added in v0.46.0
func (e *Event) SetReturnCodeContinue()
SetReturnCodeContinue sets return code of 'e' to TCL_CONTINUE.
func (*Event) SetReturnCodeError ¶ added in v0.46.0
func (e *Event) SetReturnCodeError()
SetReturnCodeError sets return code of 'e' to TCL_ERROR.
func (*Event) SetReturnCodeOK ¶ added in v0.46.0
func (e *Event) SetReturnCodeOK()
SetReturnCodeOK sets return code of 'e' to TCL_OK.
func (*Event) SetReturnCodeReturn ¶ added in v0.46.0
func (e *Event) SetReturnCodeReturn()
SetReturnCodeReturn sets return code of 'e' to TCL_RETURN.
type EventHandler ¶ added in v0.3.0
type EventHandler func(*Event)
EventHandler is the type used by call backs.
type Extension ¶ added in v0.58.0
type Extension interface { // Initialize is called to perform any one-time initialization of an extension. // The Initialize method of an extension in Extensions can be called multiple // times but only the first successful call to Initialize will have any effect. Initialize(context ExtensionContext) error }
Extension handles Tk extensions. When calling Extension methods registered in Extension, the context argument is ignored and an instance is created automatically.
type ExtensionContext ¶ added in v0.58.0
type ExtensionContext interface { // Eval evaluates the tcl script. Eval(tcl string) (r string, err error) // EvalErr is like Eval, but handles errors according to the current value of // [ErrorMode]. EvalErr(tcl string) (r string) RegisterWindow(path string) *Window Collect(w *Window, options ...any) string // Returns a single Tcl string, no braces, except "{}" is returned for s == "". TclSafeString(string) string }
ExtensionContext provides context to Extension methods.
type ExtensionKey ¶ added in v0.58.0
ExtensionKey indexes Extensions
func RegisterExtension ¶ added in v0.58.0
func RegisterExtension(name string, e Extension) (r ExtensionKey, err error)
RegisterExtension registers e.
type FileType ¶ added in v0.4.10
type FileType struct { TypeName string // Eg. "Go files" Extensions []string // Eg. []string{".go"} MacType string // Eg. "TEXT" }
FileType specifies a single file type for the Filetypes option.
type FontFace ¶ added in v0.19.3
type FontFace struct {
// contains filtered or unexported fields
}
FontFace represents a Tk font.
func NewFont ¶ added in v0.5.18
NewFont — Create and inspect fonts.
Description ¶
Creates a new font.
The following options are supported on all platforms, and are used when creating/specifying a font:
- Family name
The case-insensitive font family name. Tk guarantees to support the font families named Courier (a monospaced “typewriter” font), Times (a serifed “newspaper” font), and Helvetica (a sans-serif “European” font). The most closely matching native font family will automatically be substituted when one of the above font families is used. The name may also be the name of a native, platform-specific font family; in that case it will work as desired on one platform but may not display correctly on other platforms. If the family is unspecified or unrecognized, a platform-specific default font will be chosen.
- Size size
The desired size of the font. If the size argument is a positive number, it is interpreted as a size in points. If size is a negative number, its absolute value is interpreted as a size in pixels. If a font cannot be displayed at the specified size, a nearby size will be chosen. If size is unspecified or zero, a platform-dependent default size will be chosen.
Sizes should normally be specified in points so the application will remain the same ruler size on the screen, even when changing screen resolutions or moving scripts across platforms. However, specifying pixels is useful in certain circumstances such as when a piece of text must line up with respect to a fixed-size bitmap. The mapping between points and pixels is set when the application starts, based on properties of the installed monitor, but it can be overridden by calling the tk scaling command.
- Weight weight
The nominal thickness of the characters in the font. The value normal specifies a normal weight font, while bold specifies a bold font. The closest available weight to the one specified will be chosen. The default weight is normal.
- Slant slant
The amount the characters in the font are slanted away from the vertical. Valid values for slant are roman and italic. A roman font is the normal, upright appearance of a font, while an italic font is one that is tilted some number of degrees from upright. The closest available slant to the one specified will be chosen. The default slant is roman.
- Underline boolean
The value is a boolean flag that specifies whether characters in this font should be underlined. The default value for underline is false.
- Overstrike boolean
The value is a boolean flag that specifies whether a horizontal line should be drawn through the middle of characters in this font. The default value for overstrike is false.
Additional information might be available at the Tcl/Tk font page.
func (*FontFace) Delete ¶ added in v0.19.3
func (f *FontFace) Delete()
Delete — Manipulate fonts.
Description ¶
Delete the font. If there are widgets using the named font, the named font will not actually be deleted until all the instances are released. Those widgets will continue to display using the last known values for the named font. If a deleted named font is subsequently recreated with another call to font create, the widgets will use the new named font and redisplay themselves using the new attributes of that font.
Additional information might be available at the Tcl/Tk font page.
func (*FontFace) MetricsAscent ¶ added in v0.62.2
NewFont — Create and inspect fonts.
Description ¶
Returns the amount in pixels that the tallest letter sticks up above the baseline of the font, plus any extra blank space added by the designer of the font.
Additional information might be available at the Tcl/Tk font page.
func (*FontFace) MetricsDescent ¶ added in v0.62.2
NewFont — Create and inspect fonts.
Description ¶
Returns the largest amount in pixels that any letter sticks down below the baseline of the font, plus any extra blank space added by the designer of the font.
Additional information might be available at the Tcl/Tk font page.
func (*FontFace) MetricsFixed ¶ added in v0.62.2
NewFont — Create and inspect fonts.
Description ¶
Returns a boolean flag that is true if this is a fixed-width font, where each normal character is the same width as all the other characters, or is false if this is a proportionally-spaced font, where individual characters have different widths. The widths of control characters, tab characters, and other non-printing characters are not included when calculating this value.
Additional information might be available at the Tcl/Tk font page.
func (*FontFace) MetricsLinespace ¶ added in v0.62.2
NewFont — Create and inspect fonts.
Description ¶
Returns how far apart vertically in pixels two lines of text using the same font should be placed so that none of the characters in one line overlap any of the characters in the other line. This is generally the sum of the ascent above the baseline line plus the descent below the baseline.
Additional information might be available at the Tcl/Tk font page.
type FrameWidget ¶ added in v0.11.0
type FrameWidget struct {
*Window
}
FrameWidget represents the Tcl/Tk frame widget/window
func Frame ¶ added in v0.2.0
func Frame(options ...Opt) *FrameWidget
Frame — Create and manipulate 'frame' simple container widgets
Description ¶
The frame command creates a new window (given by the pathName argument) and makes it into a frame widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the frame such as its background color and relief. The frame command returns the path name of the new window.
A frame is a simple widget. Its primary purpose is to act as a spacer or container for complex window layouts. The only features of a frame are its background and an optional 3-D border to make the frame appear raised or sunken.
Use Window.Frame to create a Frame with a particular parent.
More information might be available at the Tcl/Tk frame page.
Standard options ¶
Widget specific options ¶
This option is the same as the standard -background option except that its value may also be specified as an empty string. In this case, the widget will display no background or border, and no colors will be consumed from its colormap for its background and border. An empty background will disable drawing the background image.
This specifies an image to display on the frame's background within the border of the frame (i.e., the image will be clipped by the frame's highlight ring and border, if either are present); subwidgets of the frame will be drawn on top. The image must have been created with the image create command. If specified as the empty string, no image will be displayed.
Specifies a class for the window. This class will be used when querying the option database for the window's other options, and it will also be used later for other purposes such as bindings. The -class option may not be changed with the configure widget command.
Specifies a colormap to use for the window. The value may be either new, in which case a new colormap is created for the window and its children, or the name of another window (which must be on the same screen and have the same visual as pathName), in which case the new window will use the colormap from the specified window. If the -colormap option is not specified, the new window uses the same colormap as its parent. This option may not be changed with the configure widget command.
The value must be a boolean. If true, it means that this window will be used as a container in which some other application will be embedded (for example, a Tk toplevel can be embedded using the -use option). The window will support the appropriate window manager protocols for things like geometry requests. The window should not have any children of its own in this application. This option may not be changed with the configure widget command. Note that -borderwidth, -padx and -pady are ignored when configured as a container since a container has no border.
Specifies the desired height for the window in any of the forms acceptable to Tk_GetPixels. If this option is negative or zero then the window will not request any size at all. Note that this sets the total height of the frame, any -borderwidth or similar is not added. Normally -height should not be used if a propagating geometry manager, such as grid or pack, is used within the frame since the geometry manager will override the height of the frame.
This specifies how to draw the background image (see -backgroundimage) on the frame. If true (according to Tcl_GetBoolean), the image will be tiled to fill the whole frame, with the origin of the first copy of the image being the top left of the interior of the frame. If false (the default), the image will be centered within the frame.
Specifies visual information for the new window in any of the forms accepted by Tk_GetVisual. If this option is not specified, the new window will use the same visual as its parent. The -visual option may not be modified with the configure widget command.
Specifies the desired width for the window in any of the forms acceptable to Tk_GetPixels. If this option is negative or zero then the window will not request any size at all. Note that this sets the total width of the frame, any -borderwidth or similar is not added. Normally -width should not be used if a propagating geometry manager, such as grid or pack, is used within the frame since the geometry manager will override the width of the frame.
type Img ¶ added in v0.4.10
type Img struct {
// contains filtered or unexported fields
}
Img represents a Tk image.
func NewBitmap ¶ added in v0.5.18
Bitmap — Images that display two colors
Description ¶
A bitmap is an image whose pixels can display either of two colors or be transparent. A bitmap image is defined by four things: a background color, a foreground color, and two bitmaps, called the source and the mask. Each of the bitmaps specifies 0/1 values for a rectangular array of pixels, and the two bitmaps must have the same dimensions. For pixels where the mask is zero, the image displays nothing, producing a transparent effect. For other pixels, the image displays the foreground color if the source data is one and the background color if the source data is zero.
Additional information might be available at the Tcl/Tk bitmap page.
- Background color
Specifies a background color for the image in any of the standard ways accepted by Tk. If this option is set to an empty string then the background pixels will be transparent. This effect is achieved by using the source bitmap as the mask bitmap, ignoring any -maskdata or -maskfile options.
- Data string
Specifies the contents of the source bitmap as a string. The string must adhere to X11 bitmap format (e.g., as generated by the bitmap program). If both the -data and -file options are specified, the -data option takes precedence.
- File name
name gives the name of a file whose contents define the source bitmap. The file must adhere to X11 bitmap format (e.g., as generated by the bitmap program).
- Foreground color
Specifies a foreground color for the image in any of the standard ways accepted by Tk.
- Maskdata string
Specifies the contents of the mask as a string. The string must adhere to X11 bitmap format (e.g., as generated by the bitmap program). If both the -maskdata and -maskfile options are specified, the -maskdata option takes precedence.
- Maskfile name
name gives the name of a file whose contents define the mask. The file must adhere to X11 bitmap format (e.g., as generated by the bitmap program).
func NewPhoto ¶ added in v0.5.18
Photo — Full-color images
A photo is an image whose pixels can display any color with a varying degree of transparency (the alpha channel). A photo image is stored internally in full color (32 bits per pixel), and is displayed using dithering if necessary. Image data for a photo image can be obtained from a file or a string, or it can be supplied from C code through a procedural interface. At present, only PNG, GIF, PPM/PGM, and (read-only) SVG formats are supported, but an interface exists to allow additional image file formats to be added easily. A photo image is (semi)transparent if the image data it was obtained from had transparency information. In regions where no image data has been supplied, it is fully transparent. Transparency may also be modified with the transparency set subcommand.
- Data string
Specifies the contents of the image as a string. The string should contain binary data or, for some formats, base64-encoded data (this is currently guaranteed to be supported for PNG and GIF images). The format of the string must be one of those for which there is an image file format handler that will accept string data. If both the -data and -file options are specified, the -file option takes precedence.
- Format format-name
Specifies the name of the file format for the data specified with the -data or -file option.
- File name
name gives the name of a file that is to be read to supply data for the photo image. The file format must be one of those for which there is an image file format handler that can read data.
- Gamma value
Specifies that the colors allocated for displaying this image in a window should be corrected for a non-linear display with the specified gamma exponent value. (The intensity produced by most CRT displays is a power function of the input value, to a good approximation; gamma is the exponent and is typically around 2). The value specified must be greater than zero. The default value is one (no correction). In general, values greater than one will make the image lighter, and values less than one will make it darker.
- Height number
Specifies the height of the image, in pixels. This option is useful primarily in situations where the user wishes to build up the contents of the image piece by piece. A value of zero (the default) allows the image to expand or shrink vertically to fit the data stored in it.
- Palette palette-spec
Specifies the resolution of the color cube to be allocated for displaying this image, and thus the number of colors used from the colormaps of the windows where it is displayed. The palette-spec string may be either a single decimal number, specifying the number of shades of gray to use, or three decimal numbers separated by slashes (/), specifying the number of shades of red, green and blue to use, respectively. If the first form (a single number) is used, the image will be displayed in monochrome (i.e., grayscale).
- Width number
Specifies the width of the image, in pixels. This option is useful primarily in situations where the user wishes to build up the contents of the image piece by piece. A value of zero (the default) allows the image to expand or shrink horizontally to fit the data stored in it.
Additional information might be available at the Tcl/Tk photo page.
func (*Img) Copy ¶ added in v0.20.0
photo — Full-color images
Copies a region from the image called sourceImage (which must be a photo image) to the image called imageName, possibly with pixel zooming and/or subsampling. If no options are specified, this command copies the whole of sourceImage into imageName, starting at coordinates (0,0) in imageName.
The following options may be specified:
- From x1 y1 x2 y2
Specifies a rectangular sub-region of the source image to be copied. (x1,y1) and (x2,y2) specify diagonally opposite corners of the rectangle. If x2 and y2 are not specified, the default value is the bottom-right corner of the source image. The pixels copied will include the left and top edges of the specified rectangle but not the bottom or right edges. If the -from option is not given, the default is the whole source image.
- To x1 y1 x2 y2
Specifies a rectangular sub-region of the destination image to be affected. (x1,y1) and (x2,y2) specify diagonally opposite corners of the rectangle. If x2 and y2 are not specified, the default value is (x1,y1) plus the size of the source region (after subsampling and zooming, if specified). If x2 and y2 are specified, the source region will be replicated if necessary to fill the destination region in a tiled fashion.
The function returns 'm'.
Additional information might be available at the Tcl/Tk photo page.
func (*Img) Delete ¶ added in v0.31.0
func (m *Img) Delete()
image — Create and manipulate images
Description ¶
Deletes 'm!. If there are instances of the image displayed in widgets, the image will not actually be deleted until all of the instances are released. However, the association between the instances and the image manager will be dropped. Existing instances will retain their sizes but redisplay as empty areas. If a deleted image is recreated with another call to image create, the existing instances will use the new image.
func (*Img) Graph ¶ added in v0.9.1
Graph — use gnuplot to draw on a photo. Graph returns 'm'
The 'script' argument is passed to a gnuplot executable, which must be installed on the machine. See the gnuplot site for documentation about producing graphs. The script must not use the 'set term <device>' command.
The content of 'm' is replaced, including its internal name.
func (*Img) Height ¶ added in v0.9.0
Height — Get the configured option value.
Additional information might be available at the Tcl/Tk photo page.
func (*Img) Width ¶ added in v0.9.0
Width — Get the configured option value.
Additional information might be available at the Tcl/Tk photo page.
type LC ¶ added in v0.5.18
type LC struct { Line int // 1-based line number within the text content. Char int // 0-based char number within the line. }
LC encodes a text index consisting of a line and char number.
type LabelWidget ¶ added in v0.11.0
type LabelWidget struct {
*Window
}
LabelWidget represents the Tcl/Tk label widget/window
func Label ¶ added in v0.2.0
func Label(options ...Opt) *LabelWidget
Label — Create and manipulate 'label' non-interactive text or image widgets
Description ¶
The label command creates a new window (given by the pathName argument) and makes it into a label widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the label such as its colors, font, text, and initial relief. The label command returns its pathName argument. At the time this command is invoked, there must not exist a window named pathName, but pathName's parent must exist.
A label is a widget that displays a textual string, bitmap or image. If text is displayed, it must all be in a single font, but it can occupy multiple lines on the screen (if it contains newlines or if wrapping occurs because of the -wraplength option) and one of the characters may optionally be underlined using the The label can be manipulated in a few simple ways, such as changing its relief or text, using the commands described below.
Use Window.Label to create a Label with a particular parent.
More information might be available at the Tcl/Tk label page.
Standard options ¶
- Activebackground
- Activeforeground
- Anchor
- Background
- Bitmap
- Borderwidth
- Compound
- Cursor
- Disabledforeground
- Foreground
- Highlightbackground
- Highlightcolor
- Highlightthickness
- Image
- Justify
- Padx
- Pady
- Relief
- Takefocus
- Textvariable
- Txt
- Underline
- Wraplength
Widget specific options ¶
Specifies a desired height for the label. If an image or bitmap is being displayed in the label then the value is in screen units (i.e. any of the forms acceptable to Tk_GetPixels); for text it is in lines of text. If this option is not specified, the label's desired height is computed from the size of the image or bitmap or text being displayed in it.
Specifies one of three states for the label: normal, active, or disabled. In normal state the button is displayed using the -foreground and -background options. In active state the label is displayed using the -activeforeground and -activebackground options. In the disabled state the -disabledforeground and -background options determine how the button is displayed.
Specifies a desired width for the label. If an image or bitmap is being displayed in the label then the value is in screen units (i.e. any of the forms acceptable to Tk_GetPixels); for text it is in characters. If this option is not specified, the label's desired width is computed from the size of the image or bitmap or text being displayed in it.
type LabelframeWidget ¶ added in v0.11.0
type LabelframeWidget struct {
*Window
}
LabelframeWidget represents the Tcl/Tk labelframe widget/window
func Labelframe ¶ added in v0.2.0
func Labelframe(options ...Opt) *LabelframeWidget
Labelframe — Create and manipulate 'labelframe' labelled container widgets
Description ¶
The labelframe command creates a new window (given by the pathName argument) and makes it into a labelframe widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the labelframe such as its background color and relief. The labelframe command returns the path name of the new window.
A labelframe is a simple widget. Its primary purpose is to act as a spacer or container for complex window layouts. It has the features of a frame plus the ability to display a label.
Use Window.Labelframe to create a Labelframe with a particular parent.
More information might be available at the Tcl/Tk labelframe page.
Standard options ¶
- Borderwidth
- Cursor
- Foreground
- Highlightbackground
- Highlightcolor
- Highlightthickness
- Padx
- Pady
- Relief
- Takefocus
- Txt
Widget specific options ¶
This option is the same as the standard -background option except that its value may also be specified as an empty string. In this case, the widget will display no background or border, and no colors will be consumed from its colormap for its background and border.
Specifies a class for the window. This class will be used when querying the option database for the window's other options, and it will also be used later for other purposes such as bindings. The -class option may not be changed with the configure widget command.
Specifies a colormap to use for the window. The value may be either new, in which case a new colormap is created for the window and its children, or the name of another window (which must be on the same screen and have the same visual as pathName), in which case the new window will use the colormap from the specified window. If the -colormap option is not specified, the new window uses the same colormap as its parent. This option may not be changed with the configure widget command.
Specifies the desired height for the window in any of the forms acceptable to Tk_GetPixels. If this option is negative or zero then the window will not request any size at all.
Specifies where to place the label. A label is only displayed if the -text option is not the empty string. Valid values for this option are (listing them clockwise) nw, n, ne, en, e, es, se, s,sw, ws, w and wn. The default value is nw.
Specifies a widget to use as label. This overrides any -text option. The widget must exist before being used as -labelwidget and if it is not a descendant of this window, it will be raised above it in the stacking order.
Specifies visual information for the new window in any of the forms accepted by Tk_GetVisual. If this option is not specified, the new window will use the same visual as its parent. The -visual option may not be modified with the configure widget command.
Specifies the desired width for the window in any of the forms acceptable to Tk_GetPixels. If this option is negative or zero then the window will not request any size at all.
type ListboxWidget ¶ added in v0.11.0
type ListboxWidget struct {
*Window
}
ListboxWidget represents the Tcl/Tk listbox widget/window
func Listbox ¶ added in v0.2.0
func Listbox(options ...Opt) *ListboxWidget
Listbox — Create and manipulate 'listbox' item list widgets
Description ¶
The listbox command creates a new window (given by the pathName argument) and makes it into a listbox widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the listbox such as its colors, font, text, and relief. The listbox command returns its pathName argument. At the time this command is invoked, there must not exist a window named pathName, but pathName's parent must exist.
A listbox is a widget that displays a list of strings, one per line. When first created, a new listbox has no elements. Elements may be added or deleted using widget commands described below. In addition, one or more elements may be selected as described below. If a listbox is exporting its selection (see -exportselection option), then it will observe the standard X11 protocols for handling the selection. Listbox selections are available as type STRING; the value of the selection will be the text of the selected elements, with newlines separating the elements.
It is not necessary for all the elements to be displayed in the listbox window at once; commands described below may be used to change the view in the window. Listboxes allow scrolling in both directions using the standard -xscrollcommand and -yscrollcommand options. They also support scanning, as described below.
Use Window.Listbox to create a Listbox with a particular parent.
More information might be available at the Tcl/Tk listbox page.
Standard options ¶
- Background
- Borderwidth
- Cursor
- Disabledforeground
- Exportselection
- Foreground
- Highlightbackground
- Highlightcolor
- Highlightthickness
- Justify
- Relief
- Selectbackground
- Selectborderwidth
- Selectforeground
- Setgrid
- Takefocus
- Xscrollcommand
- Yscrollcommand
Widget specific options ¶
Specifies the style in which to draw the active element. This must be one of dotbox (show a focus ring around the active element), none (no special indication of active element) or underline (underline the active element). The default is underline on Windows, and dotbox elsewhere.
Specifies the desired height for the window, in lines. If zero or less, then the desired height for the window is made just large enough to hold all the elements in the listbox.
Specifies the name of a global variable. The value of the variable is a list to be displayed inside the widget; if the variable value changes then the widget will automatically update itself to reflect the new value. Attempts to assign a variable with an invalid list value to -listvariable will cause an error. Attempts to unset a variable in use as a -listvariable will fail but will not generate an error.
Specifies one of several styles for manipulating the selection. The value of the option may be arbitrary, but the default bindings expect it to be either single, browse, multiple, or extended; the default value is browse.
Specifies one of two states for the listbox: normal or disabled. If the listbox is disabled then items may not be inserted or deleted, items are drawn in the -disabledforeground color, and selection cannot be modified and is not shown (though selection information is retained).
Specifies the desired width for the window in characters. If the font does not have a uniform width then the width of the character is used in translating from character units to screen units. If zero or less, then the desired width for the window is made just large enough to hold all the elements in the listbox.
func (*ListboxWidget) Get ¶ added in v0.60.0
func (w *ListboxWidget) Get(first any, last ...any) (r []string)
listbox — Create and manipulate 'listbox' item list widgets
Description ¶
If last is omitted, returns the contents of the listbox element indicated by first, or an empty string if first refers to a non-existent element. If last is specified, the command returns a list whose elements are all of the listbox elements between first and last, inclusive. Both first and last may have any of the standard forms for indices.
More information might be available at the Tcl/Tk listbox page.
func (*ListboxWidget) Insert ¶ added in v0.60.0
func (w *ListboxWidget) Insert(index any, elements ...any)
listbox — Create and manipulate 'listbox' item list widgets
Description ¶
Inserts zero or more new elements in the list just before the element given by index. If index is specified as end then the new elements are added to the end of the list.
More information might be available at the Tcl/Tk listbox page.
type MenuItem ¶ added in v0.47.0
type MenuItem struct {
// contains filtered or unexported fields
}
MenuItem represents an entry on a menu.
type MenuWidget ¶ added in v0.11.0
type MenuWidget struct {
*Window
}
MenuWidget represents the Tcl/Tk menu widget/window
func Menu ¶ added in v0.2.0
func Menu(options ...Opt) *MenuWidget
Menu — Create and manipulate 'menu' widgets and menubars
Use Window.Menu to create a Menu with a particular parent.
More information might be available at the Tcl/Tk menu page.
Standard options ¶
- Activebackground
- Activeborderwidth
- Activeforeground
- Activerelief
- Background
- Borderwidth
- Cursor
- Disabledforeground
- Foreground
- Relief
- Takefocus
Widget specific options ¶
If this option is specified then it provides a Tcl command to execute each time the menu is posted. The command is invoked by the post widget command before posting the menu. Note that in Tk 8.0 on Macintosh and Windows, all post-commands in a system of menus are executed before any of those menus are posted. This is due to the limitations in the individual platforms' menu managers.
For menu entries that are check buttons or radio buttons, this option specifies the color to display in the indicator when the check button or radio button is selected.
This option must have a proper boolean value (default is false), which specifies whether or not the menu should include a tear-off entry at the top. If so, it will exist as entry 0 of the menu and the other entries will number starting at 1. The default menu bindings arrange for the menu to be torn off when the tear-off entry is invoked. This option is ignored under Aqua/MacOS, where menus cannot be torn off.
If this option has a non-empty value, then it specifies a Tcl command to invoke whenever the menu is torn off. The actual command will consist of the value of this option, followed by a space, followed by the name of the menu window, followed by a space, followed by the name of the name of the torn off menu window. For example, if the option's value is and menu .x.y is torn off to create a new menu .x.tearoff1, then the command will be invoked. This option is ignored under Aqua/MacOS, where menus cannot be torn off.
The string will be used to title the window created when this menu is torn off. If the title is NULL, then the window will have the title of the menubutton or the text of the cascade item from which this menu was invoked.
This option can be one of menubar, tearoff, or normal, and is set when the menu is created. While the string returned by the configuration database will change if this option is changed, this does not affect the menu widget's behavior. This is used by the cloning mechanism and is not normally set outside of the Tk library.
func (*MenuWidget) AddCascade ¶ added in v0.15.0
func (w *MenuWidget) AddCascade(options ...Opt) *MenuItem
Menu — Create and manipulate 'menu' widgets and menubars
Description ¶
Add a new cascade entry to the end of the menu.
Additional information might be available at the Tcl/Tk menu page.
func (*MenuWidget) AddCheckbutton ¶ added in v0.41.0
func (w *MenuWidget) AddCheckbutton(options ...Opt) *MenuItem
Menu — Create and manipulate 'menu' widgets and menubars
Description ¶
Add a new checkbutton entry to the bottom of the menu.
Additional information might be available at the Tcl/Tk menu page.
func (*MenuWidget) AddCommand ¶ added in v0.15.0
func (w *MenuWidget) AddCommand(options ...Opt) *MenuItem
Menu — Create and manipulate 'menu' widgets and menubars
Description ¶
Add a new command entry to the bottom of the menu.
Additional information might be available at the Tcl/Tk menu page.
func (*MenuWidget) AddRadiobutton ¶ added in v0.41.0
func (w *MenuWidget) AddRadiobutton(options ...Opt) *MenuItem
Menu — Create and manipulate 'menu' widgets and menubars
Description ¶
Add a new radiobutton entry to the bottom of the menu.
Additional information might be available at the Tcl/Tk menu page.
func (*MenuWidget) AddSeparator ¶ added in v0.15.0
func (w *MenuWidget) AddSeparator(options ...Opt) *MenuItem
Menu — Create and manipulate 'menu' widgets and menubars
Description ¶
Add a new separator entry to the bottom of the menu.
Additional information might be available at the Tcl/Tk menu page.
func (*MenuWidget) EntryConfigure ¶ added in v0.47.0
func (w *MenuWidget) EntryConfigure(index uint, options ...Opt)
Menu — Create and manipulate 'menu' widgets and menubars
Description ¶
This command is similar to the configure command, except that it applies to the options for an individual entry, whereas configure applies to the options for the menu as a whole. Options may have any of the values described in the MENU ENTRY OPTIONS section below. If options are specified, options are modified as indicated in the command and the command returns an empty string. If no options are specified, returns a list describing the current options for entry index (see Tk_ConfigureInfo for information on the format of this list).
Additional information might be available at the Tcl/Tk menu page.
func (*MenuWidget) Invoke ¶ added in v0.15.0
func (w *MenuWidget) Invoke(index uint)
Menu — Create and manipulate 'menu' widgets and menubars
Description ¶
Invoke the action of the menu entry. See the sections on the individual entries above for details on what happens. If the menu entry is disabled then nothing happens. If the entry has a command associated with it then the result of that command is returned as the result of the invoke widget command. Otherwise the result is an empty string. Note: invoking a menu entry does not automatically unpost the menu; the default bindings normally take care of this before invoking the invoke widget command.
Additional information might be available at the Tcl/Tk menu page.
type MenubuttonWidget ¶ added in v0.11.0
type MenubuttonWidget struct {
}MenubuttonWidget represents the Tcl/Tk menubutton widget/window
func Menubutton ¶ added in v0.2.0
func Menubutton(options ...Opt) *MenubuttonWidget
Menubutton — Create and manipulate 'menubutton' pop-up menu indicator widgets
Use Window.Menubutton to create a Menubutton with a particular parent.
More information might be available at the Tcl/Tk menubutton page.
Standard options ¶
- Activebackground
- Activeforeground
- Anchor
- Background
- Bitmap
- Borderwidth
- Compound
- Cursor
- Disabledforeground
- Foreground
- Highlightbackground
- Highlightcolor
- Highlightthickness
- Image
- Justify
- Padx
- Pady
- Relief
- Takefocus
- Textvariable
- Txt
- Underline
- Wraplength
Widget specific options ¶
Specifies where the menu is going to be popup up. above tries to pop the menu above the menubutton. below tries to pop the menu below the menubutton. left tries to pop the menu to the left of the menubutton. right tries to pop the menu to the right of the menu button. flush pops the menu directly over the menubutton. In the case of above or below, the direction will be reversed if the menu would show offscreen.
Specifies a desired height for the menubutton. If an image or bitmap is being displayed in the menubutton then the value is in screen units (i.e. any of the forms acceptable to Tk_GetPixels); for text it is in lines of text. If this option is not specified, the menubutton's desired height is computed from the size of the image or bitmap or text being displayed in it.
The value must be a proper boolean value. If it is true then a small indicator rectangle will be displayed on the right side of the menubutton and the default menu bindings will treat this as an option menubutton. If false then no indicator will be displayed.
Specifies the path name of the menu associated with this menubutton. The menu must be a child of the menubutton.
Specifies one of three states for the menubutton: normal, active, or disabled. In normal state the menubutton is displayed using the foreground and background options. The active state is typically used when the pointer is over the menubutton. In active state the menubutton is displayed using the -activeforeground and -activebackground options. Disabled state means that the menubutton should be insensitive: the default bindings will refuse to activate the widget and will ignore mouse button presses. In this state the -disabledforeground and -background options determine how the button is displayed.
Specifies a desired width for the menubutton. If an image or bitmap is being displayed in the menubutton then the value is in screen units (i.e. any of the forms acceptable to Tk_GetPixels); for text it is in characters. If this option is not specified, the menubutton's desired width is computed from the size of the image or bitmap or text being displayed in it.
type MessageWidget ¶ added in v0.11.0
type MessageWidget struct {
*Window
}
MessageWidget represents the Tcl/Tk message widget/window
func Message ¶ added in v0.2.0
func Message(options ...Opt) *MessageWidget
Message — Create and manipulate 'message' non-interactive text widgets
Description ¶
The message command creates a new window (given by the pathName argument) and makes it into a message widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the message such as its colors, font, text, and initial relief. The message command returns its pathName argument. At the time this command is invoked, there must not exist a window named pathName, but pathName's parent must exist.
A message is a widget that displays a textual string. A message widget has three special features that differentiate it from a label widget. First, it breaks up its string into lines in order to produce a given aspect ratio for the window. The line breaks are chosen at word boundaries wherever possible (if not even a single word would fit on a line, then the word will be split across lines). Newline characters in the string will force line breaks; they can be used, for example, to leave blank lines in the display.
The second feature of a message widget is justification. The text may be displayed left-justified (each line starts at the left side of the window), centered on a line-by-line basis, or right-justified (each line ends at the right side of the window).
The third feature of a message widget is that it handles control characters and non-printing characters specially. Tab characters are replaced with enough blank space to line up on the next 8-character boundary. Newlines cause line breaks. Other control characters (ASCII code less than 0x20) and characters not defined in the font are displayed as a four-character sequence \exhh where hh is the two-digit hexadecimal number corresponding to the character. In the unusual case where the font does not contain all of the characters in 0123456789abcdef\ex then control characters and undefined characters are not displayed at all.
Use Window.Message to create a Message with a particular parent.
More information might be available at the Tcl/Tk message page.
Standard options ¶
- Anchor
- Background
- Borderwidth
- Cursor
- Foreground
- Highlightbackground
- Highlightcolor
- Highlightthickness
- Padx
- Pady
- Relief
- Takefocus
- Textvariable
- Txt
Widget specific options ¶
Specifies a non-negative integer value indicating desired aspect ratio for the text. The aspect ratio is specified as 100*width/height. 100 means the text should be as wide as it is tall, 200 means the text should be twice as wide as it is tall, 50 means the text should be twice as tall as it is wide, and so on. Used to choose line length for text if -width option is not specified. Defaults to 150.
Specifies how to justify lines of text. Must be one of left, center, or right. Defaults to left. This option works together with the -anchor, -aspect, -padx, -pady, and -width options to provide a variety of arrangements of the text within the window. The -aspect and -width options determine the amount of screen space needed to display the text. The -anchor, -padx, and -pady options determine where this rectangular area is displayed within the widget's window, and the -justify option determines how each line is displayed within that rectangular region. For example, suppose -anchor is e and -justify is left, and that the message window is much larger than needed for the text. The text will be displayed so that the left edges of all the lines line up and the right edge of the longest line is -padx from the right side of the window; the entire text block will be centered in the vertical span of the window.
Specifies the length of lines in the window. The value may have any of the forms acceptable to Tk_GetPixels. If this option has a value greater than zero then the -aspect option is ignored and the -width option determines the line length. If this option value is negative or zero, then the -aspect option determines the line length.
type Modifier ¶ added in v0.62.1
type Modifier int
Modifier is a bit field representing 0 or more modifiers.
const ( ModifierNone Modifier = 0 ModifierShift Modifier = 1 << (iota - 1) ModifierLock ModifierControl ModifierMod1 ModifierMod2 ModifierMod3 ModifierMod4 ModifierMod5 ModifierButton1 ModifierButton2 ModifierButton3 ModifierButton4 ModifierButton5 ModifierAlt = ModifierMod1 ModifierNumlock = ModifierMod2 ModifierWindows = ModifierMod4 ModifierSuper = ModifierMod4 )
type Opt ¶ added in v0.2.0
type Opt interface {
// contains filtered or unexported methods
}
Opt represents an optional argument.
func Accelerator ¶ added in v0.4.10
Accelerator option.
Known uses:
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
func Activebackground ¶ added in v0.2.0
Activebackground option.
Specifies background color to use when drawing active elements. An element (a widget or portion of a widget) is active if the mouse cursor is positioned over the element and pressing a mouse button will cause some action to occur. If strict Motif compliance has been requested by setting the tk_strictMotif variable, this option will normally be ignored; the normal background color will be used instead. For some elements on Windows and Macintosh systems, the active color will only be used while mouse button 1 is pressed over the element.
Known uses:
- Button
- Checkbutton
- Label
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
- Menu
- Menubutton
- Radiobutton
- Scale
- Scrollbar
- Spinbox
func Activebitmap ¶ added in v0.4.12
Activebitmap option.
This option specify the bitmap to display in the item in its active state. Bitmap may have any of the forms accepted by Tk_GetBitmap.
Known uses:
- CanvasWidget.CreateBitmap (widget specific)
func Activeborderwidth ¶ added in v0.2.0
Activeborderwidth option.
Specifies a non-negative value indicating the width of the 3-D border drawn around active elements. See above for definition of active elements. The value may have any of the forms acceptable to Tk_GetPixels. This option is typically only available in widgets displaying more than one element at a time (e.g. menus but not buttons).
Known uses:
func Activedash ¶ added in v0.4.12
Activedash option.
This option specifies the dash pattern for the active state of an item. If the dash option is omitted then the default is a solid outline.
Many items support the notion of a dash pattern for outlines. The syntax is a list of integers. Each element represents the number of pixels of a line segment. Only the odd segments are drawn using the “outline” color. The other segments are drawn transparent.
Known uses:
- CanvasWidget.CreateArc (widget specific)
func Activefill ¶ added in v0.4.12
Activefill option.
This option specifies the color to be used to fill item's area in its active state. The even-odd fill rule is used. Color may have any of the forms accepted by Tk_GetColor. For the line item, it specifies the color of the line drawn. For the text item, it specifies the foreground color of the text. If color is an empty string (the default for all canvas items except line and text), then the item will not be filled.
Known uses:
- CanvasWidget.CreateArc (widget specific)
func Activeforeground ¶ added in v0.2.0
Activeforeground option.
Specifies foreground color to use when drawing active elements. See above for definition of active elements.
Known uses:
- Button
- Checkbutton
- Label
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
- Menu
- Menubutton
- Radiobutton
func Activeimage ¶ added in v0.4.12
Activeimage option.
Specifies the name of the image to display in the item in its active state. This image must have been created previously with the image create command.
Known uses:
- CanvasWidget.CreateImage (widget specific)
func Activeoutline ¶ added in v0.4.12
Activeoutline option.
This option specifies the color that should be used to draw the outline of the item in its active state. Color may have any of the forms accepted by Tk_GetColor. If color is specified as an empty string then no outline is drawn for the item.
Known uses:
- CanvasWidget.CreateArc (widget specific)
func Activeoutlinestipple ¶ added in v0.4.12
Activeoutlinestipple option.
This option specifies the stipple pattern that should be used to draw the outline of the item in its active state. Indicates that the outline for the item should be drawn with a stipple pattern; bitmap specifies the stipple pattern to use, in any of the forms accepted by Tk_GetBitmap. If the -outline option has not been specified then this option has no effect. If bitmap is an empty string (the default), then the outline is drawn in a solid fashion. Note that stipples are not well supported on platforms that do not use X11 as their drawing API.
Known uses:
- CanvasWidget.CreateArc (widget specific)
func Activerelief ¶ added in v0.2.0
Activerelief option.
Specifies the 3-D effect desired for the active item of the widget. See the -relief option for details.
Known uses:
func Activestipple ¶ added in v0.4.12
Activestipple option.
This option specifies the stipple patterns that should be used to fill the item in its active state. bitmap specifies the stipple pattern to use, in any of the forms accepted by Tk_GetBitmap. If the -fill option has not been specified then this option has no effect. If bitmap is an empty string (the default), then filling is done in a solid fashion. For the text item, it affects the actual text. Note that stipples are not well supported on platforms that do not use X11 as their drawing API.
Known uses:
- CanvasWidget.CreateArc (widget specific)
func Activewidth ¶ added in v0.4.12
Activewidth option.
This option specifies the width of the outline to be drawn around the item's region, in its active state. outlineWidth may be in any of the forms described in the COORDINATES section above. If the -outline option has been specified as an empty string then this option has no effect. This option defaults to 1.0. For arcs, wide outlines will be drawn centered on the edges of the arc's region.
Known uses:
- CanvasWidget.CreateArc (widget specific)
func Align ¶ added in v0.4.10
Align option.
Known uses:
- Text (widget specific, applies to embedded images)
func Anchor ¶ added in v0.2.0
Anchor option.
Specifies how the information in a widget (e.g. text or a bitmap) is to be displayed in the widget. Must be one of the values n, ne, e, se, s, sw, w, nw, or center. For example, nw means display the information such that its top-left corner is at the top-left corner of the widget.
Known uses:
- Button
- Checkbutton
- Label
- Menubutton
- Message
- Pack (command specific)
- Place (command specific)
- Radiobutton
- TLabel
- TProgressbar
func Angle ¶ added in v0.4.10
Angle option.
RotationDegrees tells how many degrees to rotate the text anticlockwise about the positioning point for the text; it may have any floating-point value from 0.0 to 360.0. For example, if rotationDegrees is 90, then the text will be drawn vertically from bottom to top. This option defaults to 0.0.
Known uses:
- CanvasWidget.CreateText (widget specific)
func Arrowcolor ¶ added in v0.25.1
Arrowcolor — Styling widgets
Arrowcolor is a styling option of one or more widgets. Please see Changing Widget Colors for details.
func Arrowshape ¶ added in v0.4.10
Arrowshape option.
This option indicates how to draw arrowheads. The shape argument must be a list with three elements, each specifying a distance in any of the forms described in the COORDINATES section above. The first element of the list gives the distance along the line from the neck of the arrowhead to its tip. The second element gives the distance along the line from the trailing points of the arrowhead to the tip, and the third element gives the distance from the outside edge of the line to the trailing points. If this option is not specified then Tk picks a “reasonable” shape.
Known uses:
- CanvasWidget.CreateLine (widget specific)
func Arrowsize ¶ added in v0.25.1
Arrowsize — Styling widgets
Arrowsize is a styling option of one or more widgets. Please see Changing Widget Colors for details.
func Background ¶ added in v0.2.0
Background option.
Specifies the normal background color to use when displaying the widget.
Known uses:
- Button
- Canvas
- Checkbutton
- Entry
- Frame (widget specific)
- Label
- Labelframe (widget specific)
- Listbox
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
- Menu
- Menubutton
- Message
- NewBitmap (command specific)
- Panedwindow
- Radiobutton
- Scale
- Scrollbar
- Spinbox
- TLabel (widget specific)
- TextWidget.TagConfigure (command specific)
- Text
- Toplevel (widget specific)
func Backward ¶ added in v0.44.0
func Backward() Opt
Backward option.
Known uses:
- Text (widget specific, applies to Search)
func Bgstipple ¶ added in v0.4.10
Bgstipple option.
Known uses:
- TextWidget.TagConfigure (command specific)
func Bitmap ¶ added in v0.2.0
Bitmap option.
Specifies a bitmap to display in the widget, in any of the forms acceptable to Tk_GetBitmap. The exact way in which the bitmap is displayed may be affected by other options such as -anchor or -justify. Typically, if this option is specified then it overrides other options that specify a textual value to display in the widget but this is controlled by the -compound option; the -bitmap option may be reset to an empty string to re-enable a text display. In widgets that support both -bitmap and -image options, -image will usually override -bitmap.
Known uses:
- Button
- Checkbutton
- Label
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
- Menubutton
- Radiobutton
func Bordercolor ¶ added in v0.25.1
Bordercolor — Styling widgets
Bordercolor is a styling option of one or more widgets. Please see Changing Widget Colors for details.
func Borderwidth ¶ added in v0.2.0
Borderwidth option.
Specifies a non-negative value indicating the width of the 3-D border to draw around the outside of the widget (if such a border is being drawn; the -relief option typically determines this). The value may also be used when drawing 3-D effects in the interior of the widget. The value may have any of the forms acceptable to Tk_GetPixels.
Known uses:
- Button
- Canvas
- Checkbutton
- Entry
- Frame
- Label
- Labelframe
- Listbox
- Menu
- Menubutton
- Message
- Panedwindow
- Radiobutton
- Scale
- Scrollbar
- Spinbox
- TFrame (widget specific)
- TextWidget.TagConfigure (command specific)
- Text
- Toplevel
func Buttonbackground ¶ added in v0.3.0
Buttonbackground option.
Known uses:
- Spinbox (widget specific)
func Buttondownrelief ¶ added in v0.3.0
Buttondownrelief option.
Known uses:
- Spinbox (widget specific)
func Capstyle ¶ added in v0.4.10
Capstyle option.
Specifies the ways in which caps are to be drawn at the endpoints of the line. Style may have any of the forms accepted by Tk_GetCapStyle (butt, projecting, or round). If this option is not specified then it defaults to butt. Where arrowheads are drawn the cap style is ignored.
Known uses:
- CanvasWidget.CreateLine (widget specific)
func Chars ¶ added in v0.48.0
func Chars() Opt
Chars option.
Known uses:
- TextWidget (command specific)
func Children ¶ added in v0.4.10
Children option.
Known uses:
Children describes children of a style layout.
func Class ¶ added in v0.3.0
Class option.
Specifies the window class. The class is used when querying the option database for the window's other options, to determine the default bindtags for the window, and to select the widget's default layout and style. This is a read-only option: it may only be specified when the window is created, and may not be changed with the configure widget command.
Known uses:
- Frame (widget specific)
- Labelframe (widget specific)
- TButton
- TCheckbutton
- TCombobox
- TEntry
- TFrame
- TLabel
- TLabelframe
- TMenubutton
- TNotebook
- TPanedwindow
- TProgressbar
- TRadiobutton
- TScale
- TScrollbar
- TSeparator
- TSizegrip
- TSpinbox
- TTreeview
- Toplevel (widget specific)
func Colormap ¶ added in v0.3.0
Colormap option.
Known uses:
- Frame (widget specific)
- Labelframe (widget specific)
- Toplevel (widget specific)
func Columnbreak ¶ added in v0.4.10
Columnbreak option.
Known uses:
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
func Columnseparatorwidth ¶ added in v0.25.1
Columnseparatorwidth — Styling widgets
Columnseparatorwidth is a styling option of a ttk::treeview. More information might be available at the Tcl/Tk ttk_treeview page.
func Command ¶ added in v0.3.0
Command option.
See also Event handlers.
Known uses:
- Button (widget specific)
- Checkbutton (widget specific)
- Fontchooser (command specific)
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
- MessageBox (command specific)
- Radiobutton (widget specific)
- Scale (widget specific)
- Scrollbar (widget specific)
- Spinbox (widget specific)
- TButton (widget specific)
- TCheckbutton (widget specific)
- TRadiobutton (widget specific)
- TScale (widget specific)
- TScrollbar (widget specific)
- TSpinbox (widget specific)
func Compound ¶ added in v0.2.0
Compound option.
Specifies if the widget should display text and bitmaps/images at the same time, and if so, where the bitmap/image should be placed relative to the text. Must be one of the values none, bottom, top, left, right, or center. For example, the (default) value none specifies that the bitmap or image should (if defined) be displayed instead of the text, the value left specifies that the bitmap or image should be displayed to the left of the text, and the value center specifies that the bitmap or image should be displayed on top of the text.
Known uses:
- Button
- Checkbutton
- Label
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
- Menubutton
- Radiobutton
- TButton
- TCheckbutton
- TLabel
- TMenubutton
- TRadiobutton
func Confirmoverwrite ¶ added in v0.4.10
Confirmoverwrite option.
Known uses:
- GetSaveFile (command specific)
func Cursor ¶ added in v0.2.0
Cursor option.
Specifies the mouse cursor to be used for the widget. The value may have any of the forms acceptable to Tk_GetCursor. In addition, if an empty string is specified, it indicates that the widget should defer to its parent for cursor specification.
Known uses:
- Button
- Canvas
- Checkbutton
- Entry
- Frame
- Label
- Labelframe
- Listbox
- Menu
- Menubutton
- Message
- Panedwindow
- Radiobutton
- Scale
- Scrollbar
- Spinbox
- TButton
- TCheckbutton
- TCombobox
- TEntry
- TFrame
- TLabel
- TLabelframe
- TMenubutton
- TNotebook
- TPanedwindow
- TProgressbar
- TRadiobutton
- TScale
- TScrollbar
- TSeparator
- TSizegrip
- TSpinbox
- TTreeview
- Text
- Toplevel
- Window.Busy (command specific)
func Darkcolor ¶ added in v0.25.1
Darkcolor — Styling widgets
Darkcolor is a styling option of one or more widgets. Please see Changing Widget Colors for details.
func Dash ¶ added in v0.4.12
Dash option.
This option specifies the dash pattern for the normal state of an item. If the dash option is omitted then the default is a solid outline.
Many items support the notion of a dash pattern for outlines. The syntax is a list of integers. Each element represents the number of pixels of a line segment. Only the odd segments are drawn using the “outline” color. The other segments are drawn transparent.
Known uses:
- CanvasWidget.CreateArc (widget specific)
func Dashoffset ¶ added in v0.4.10
Dashoffset option.
The starting offset in pixels into the pattern provided by the -dash option. -dashoffset is ignored if there is no -dash pattern.
Known uses:
- CanvasWidget.CreateArc (widget specific)
func Default ¶ added in v0.3.0
Default option.
Known uses:
- Button (widget specific)
- MessageBox (command specific)
- TButton (widget specific)
func Defaultextension ¶ added in v0.4.10
Defaultextension option.
Known uses:
- GetOpenFile (command specific)
- GetSaveFile (command specific)
func Direction ¶ added in v0.3.0
Direction option.
Known uses:
- Menubutton (widget specific)
- TMenubutton (widget specific)
func Disabledbitmap ¶ added in v0.4.10
Disabledbitmap option.
This option specify the bitmap to display in the item in its disabled state. Bitmap may have any of the forms accepted by Tk_GetBitmap.
Known uses:
- CanvasWidget.CreateBitmap (widget specific)
func Disableddash ¶ added in v0.4.10
Disableddash option.
This option specifies the dash pattern for the disabled state of an item. If the dash option is omitted then the default is a solid outline.
Many items support the notion of a dash pattern for outlines. The syntax is a list of integers. Each element represents the number of pixels of a line segment. Only the odd segments are drawn using the “outline” color. The other segments are drawn transparent.
Known uses:
- CanvasWidget.CreateArc (widget specific)
func Disabledfill ¶ added in v0.4.10
Disabledfill option.
This option specifies the color to be used to fill item's area in its disabled state. The even-odd fill rule is used. Color may have any of the forms accepted by Tk_GetColor. For the line item, it specifies the color of the line drawn. For the text item, it specifies the foreground color of the text. If color is an empty string (the default for all canvas items except line and text), then the item will not be filled.
Known uses:
- CanvasWidget.CreateArc (widget specific)
func Disabledforeground ¶ added in v0.2.0
Disabledforeground option.
Specifies foreground color to use when drawing a disabled element. If the option is specified as an empty string (which is typically the case on monochrome displays), disabled elements are drawn with the normal foreground color but they are dimmed by drawing them with a stippled fill pattern.
Known uses:
- Button
- Checkbutton
- Entry (widget specific)
- Label
- Listbox
- Menu
- Menubutton
- Radiobutton
- Spinbox (widget specific)
func Disabledimage ¶ added in v0.4.10
Disabledimage option.
Specifies the name of the image to display in the item in its disabled state. This image must have been created previously with the image create command.
Known uses:
- CanvasWidget.CreateImage (widget specific)
func Disabledoutline ¶ added in v0.4.10
Disabledline option.
This option specifies the color that should be used to draw the outline of the item in its disabled state. Color may have any of the forms accepted by Tk_GetColor. If color is specified as an empty string then no outline is drawn for the item.
Known uses:
- CanvasWidget.CreateArc (widget specific)
func Disabledoutlinestipple ¶ added in v0.4.10
Disabledoutlinestipple option.
This option specifies the stipple pattern that should be used to draw the outline of the item in its disabled state. Indicates that the outline for the item should be drawn with a stipple pattern; bitmap specifies the stipple pattern to use, in any of the forms accepted by Tk_GetBitmap. If the -outline option has not been specified then this option has no effect. If bitmap is an empty string (the default), then the outline is drawn in a solid fashion. Note that stipples are not well supported on platforms that do not use X11 as their drawing API.
Known uses:
- CanvasWidget.CreateArc (widget specific)
func Disabledstipple ¶ added in v0.4.10
Disabledstipple option.
This option specifies the stipple patterns that should be used to fill the item in its disabled state. bitmap specifies the stipple pattern to use, in any of the forms accepted by Tk_GetBitmap. If the -fill option has not been specified then this option has no effect. If bitmap is an empty string (the default), then filling is done in a solid fashion. For the text item, it affects the actual text. Note that stipples are not well supported on platforms that do not use X11 as their drawing API.
Known uses:
- CanvasWidget.CreateArc (widget specific)
func Disabledwidth ¶ added in v0.4.10
Disabledwidth option.
This option specifies the width of the outline to be drawn around the item's region, in its disabled state. outlineWidth may be in any of the forms described in the COORDINATES section above. If the -outline option has been specified as an empty string then this option has no effect. This option defaults to 1.0. For arcs, wide outlines will be drawn centered on the edges of the arc's region.
Known uses:
- CanvasWidget.CreateArc (widget specific)
func Displaychars ¶ added in v0.48.0
func Displaychars() Opt
Displaychars option.
Known uses:
- TextWidget (command specific)
func Displaycolumns ¶ added in v0.3.0
Displaycolumns option.
Known uses:
- TTreeview (widget specific)
func Displayindices ¶ added in v0.48.0
func Displayindices() Opt
Displayindices option.
Known uses:
- TextWidget (command specific)
func Displaylines ¶ added in v0.48.0
func Displaylines() Opt
Displaylines option.
Known uses:
- TextWidget (command specific)
func Displayof ¶ added in v0.4.8
Displayof option.
Known uses:
- Bell (command specific)
- ClipboardAppend (command specific)
- ClipboardClear (command specific)
- ClipboardGet (command specific)
- Focus (command specific)
- FontFamilies (command specific)
func Elementborderwidth ¶ added in v0.3.0
Elementborderwidth option.
Known uses:
- Scrollbar (widget specific)
func ExitHandler ¶ added in v0.5.18
func ExitHandler() Opt
func Exportselection ¶ added in v0.2.0
Exportselection option.
Specifies whether or not a selection in the widget should also be the X selection. The value may have any of the forms accepted by Tcl_GetBoolean, such as true, false, 0, 1, yes, or no. If the selection is exported, then selecting in the widget deselects the current X selection, selecting outside the widget deselects any widget selection, and the widget will respond to selection retrieval requests when it has a selection. The default is usually for widgets to export selections.
Known uses:
func Extent ¶ added in v0.4.10
Extent option.
Specifies the size of the angular range occupied by the arc. The arc's range extends for degrees degrees counter-clockwise from the starting angle given by the -start option. Degrees may be negative. If it is greater than 360 or less than -360, then degrees modulo 360 is used as the extent.
Known uses:
- CanvasWidget.CreateArc (widget specific)
func Fgstipple ¶ added in v0.4.10
Fgstipple option.
Known uses:
- TextWidget.TagConfigure (command specific)
func Fieldbackground ¶ added in v0.25.1
Fieldbackground — Styling widgets
Fieldbackground is a styling option of one or more widgets. Please see Changing Widget Colors for details.
func Filetypes ¶ added in v0.4.10
Filetypes option.
Known uses:
- GetOpenFile (command specific)
- GetSaveFile (command specific)
func Focusfill ¶ added in v0.25.1
Focusfill — Styling widgets
Focusfill is a styling option of a ttk::combobox. More information might be available at the Tcl/Tk ttk_combobox page.
func Font ¶ added in v0.2.0
Font option.
Specifies the font to use when drawing text inside the widget. The value may have any of the forms described in the font manual page under FONT DESCRIPTION.
Known uses:
- Button
- Checkbutton
- Entry
- Fontchooser (command specific)
- Label
- Labelframe
- Listbox
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
- Menu
- Menubutton
- Message
- Radiobutton
- Scale
- Spinbox
- TEntry
- TLabel
- TProgressbar
- TextWidget.TagConfigure (command specific)
- Text
func Foreground ¶ added in v0.2.0
Foreground option.
Specifies the normal foreground color to use when displaying the widget.
Known uses:
- Button
- Checkbutton
- Entry
- Label
- Labelframe
- Listbox
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
- Menu
- Menubutton
- Message
- NewBitmap (command specific)
- Radiobutton
- Scale
- Spinbox
- TEntry
- TLabel
- TProgressbar
- TextWidget.TagConfigure (command specific)
- Text
func Format ¶ added in v0.3.0
Format option.
Known uses:
- ClipboardAppend (command specific)
- NewPhoto (command specific)
- Spinbox (widget specific)
- TSpinbox (widget specific)
func Forward ¶ added in v0.44.0
func Forward() Opt
Forward option.
Known uses:
- Text (widget specific, applies to Search)
func Gripsize ¶ added in v0.25.1
Gripsize — Styling widgets
Gripsize is a styling option of a ttk::panedwindow and ttk::scrollbar. More information might be available at the Tcl/Tk ttk_panedwindow or Tcl/Tk ttk_scrollbar page.
func Groovewidth ¶ added in v0.25.1
Groovewidth — Styling widgets
Groovewidth is a styling option of a ttk::scale. More information might be available at the Tcl/Tk ttk_scale page.
func Height ¶ added in v0.3.0
Height option.
Known uses:
- Button (widget specific)
- Canvas (widget specific)
- Checkbutton (widget specific)
- Frame (widget specific)
- Label (widget specific)
- Labelframe (widget specific)
- Listbox (widget specific)
- Menubutton (widget specific)
- NewPhoto (command specific)
- Panedwindow (widget specific)
- Place (command specific)
- Radiobutton (widget specific)
- TCombobox (widget specific)
- TFrame (widget specific)
- TLabelframe (widget specific)
- TNotebook (widget specific)
- TPanedwindow (widget specific)
- TTreeview (widget specific)
- Text (widget specific)
- Toplevel (widget specific)
func Hidemargin ¶ added in v0.4.10
Hidemargin option.
Known uses:
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
func Highlightbackground ¶ added in v0.2.0
Highlightbackground option.
Specifies the color to display in the traversal highlight region when the widget does not have the input focus.
Known uses:
func Highlightcolor ¶ added in v0.2.0
Highlightcolor option.
Specifies the color to use for the traversal highlight rectangle that is drawn around the widget when it has the input focus.
Known uses:
func Highlightthickness ¶ added in v0.2.0
Highlightthickness option.
Specifies a non-negative value indicating the width of the highlight rectangle to draw around the outside of the widget when it has the input focus. The value may have any of the forms acceptable to Tk_GetPixels. If the value is zero, no focus highlight is drawn around the widget.
Known uses:
func Id ¶ added in v0.4.10
Id option.
Known uses:
- TTreeviewWidget (command specific)
More information might be available at the Tcl/Tk treeview page.
func Image ¶ added in v0.2.0
Image option.
Specifies an image to display in the widget, which must have been created with the image create command. Typically, if the -image option is specified then it overrides other options that specify a bitmap or textual value to display in the widget, though this is controlled by the -compound option; the -image option may be reset to an empty string to re-enable a bitmap or text display.
Known uses:
- Button
- Checkbutton
- Label
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
- Menubutton
- Radiobutton
- TButton
- TCheckbutton
- TLabel
- TMenubutton
- TRadiobutton
func Inactiveselectbackground ¶ added in v0.3.0
Inactiveselectbackground option.
Known uses:
- Text (widget specific)
func Indent ¶ added in v0.25.1
Indent — Styling widgets
Indent is a styling option of a ttk::treeview. More information might be available at the Tcl/Tk ttk_treeview page.
func Indicatorbackground ¶ added in v0.25.1
Indicatorbackground — Styling widgets
Indicatorbackground is a styling option of one or more widgets. Please see Changing Widget Colors for details.
func Indicatorcolor ¶ added in v0.25.1
Indicatorcolor — Styling widgets
Indicatorcolor is a styling option of one or more widgets. Please see Changing Widget Colors for details.
func Indicatormargin ¶ added in v0.25.1
Indicatormargin — Styling widgets
Indicatormargin is a styling option of one or more widgets. Please see Changing Widget Colors for details.
func Indicatormargins ¶ added in v0.25.1
Indicatormargins — Styling widgets
Indicatormargins is a styling option of a ttk::treeview. More information might be available at the Tcl/Tk ttk_treeview page.
func Indicatoron ¶ added in v0.3.0
Indicatoron option.
Known uses:
- Checkbutton (widget specific)
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
- Menubutton (widget specific)
- Radiobutton (widget specific)
func Indicatorrelief ¶ added in v0.25.1
Indicatorrelief — Styling widgets
Indicatorrelief is a styling option of one or more widgets. Please see Changing Widget Colors for details.
func Indicatorsize ¶ added in v0.25.1
Indicatorsize — Styling widgets
Indicatorsize is a styling option of a ttk::treeview. More information might be available at the Tcl/Tk ttk_treeview page.
func Indices ¶ added in v0.48.0
func Indices() Opt
Indices option.
Known uses:
- TextWidget (command specific)
func Initialcolor ¶ added in v0.4.10
Initialcolor option.
Known uses:
- ChooseColor (command specific)
func Initialdir ¶ added in v0.4.10
Initialdir option.
Known uses:
- ChooseDirectory (command specific)
- GetOpenFile (command specific)
- GetSaveFile (command specific)
func Initialfile ¶ added in v0.4.10
Initialfile option.
Known uses:
- GetOpenFile (command specific)
- GetSaveFile (command specific)
func Insertbackground ¶ added in v0.2.0
Insertbackground option.
Specifies the color to use as background in the area covered by the insertion cursor. This color will normally override either the normal background for the widget (or the selection background if the insertion cursor happens to fall in the selection).
Known uses:
func Insertborderwidth ¶ added in v0.2.0
Insertborderwidth option.
Specifies a non-negative value indicating the width of the 3-D border to draw around the insertion cursor. The value may have any of the forms acceptable to Tk_GetPixels.
Known uses:
func Insertcolor ¶ added in v0.25.1
Insertcolor — Styling widgets
Insertcolor is a styling option of one or more widgets. Please see Changing Widget Colors for details.
func Insertofftime ¶ added in v0.2.0
Insertofftime option.
Specifies a non-negative integer value indicating the number of milliseconds the insertion cursor should remain in each blink cycle. If this option is zero then the cursor does not blink: it is on all the time.
Known uses:
func Insertontime ¶ added in v0.2.0
Insertontime option.
Specifies a non-negative integer value indicating the number of milliseconds the insertion cursor should remain in each blink cycle.
Known uses:
func Insertwidth ¶ added in v0.2.0
Insertwidth option.
Specifies a non-negative value indicating the total width of the insertion cursor. The value may have any of the forms acceptable to Tk_GetPixels. If a border has been specified for the insertion cursor (using the -insertborderwidth option), the border will be drawn inside the width specified by the -insertwidth option.
Known uses:
func ItemWindow ¶ added in v0.62.0
ItemWindow option.
Specifies the window to associate with this item. The window specified by pathName must either be a child of the canvas widget or a child of some ancestor of the canvas widget. PathName may not refer to a top-level window.
Known uses:
- CanvasWidget.CreateWindow (widget specific)
func Joinstyle ¶ added in v0.4.10
Joinstyle option.
Specifies the ways in which joints are to be drawn at the vertices of the line. Style may have any of the forms accepted by Tk_GetJoinStyle (bevel, miter, or round). If this option is not specified then it defaults to round. If the line only contains two points then this option is irrelevant.
Known uses:
- CanvasWidget.CreateLine (widget specific)
func Jump ¶ added in v0.2.0
Jump option.
For widgets with a slider that can be dragged to adjust a value, such as scrollbars, this option determines when notifications are made about changes in the value. The option's value must be a boolean of the form accepted by Tcl_GetBoolean. If the value is false, updates are made continuously as the slider is dragged. If the value is true, updates are delayed until the mouse button is released to end the drag; at that point a single notification is made (the value rather than changing smoothly).
Known uses:
func Justify ¶ added in v0.2.0
Justify option.
When there are multiple lines of text displayed in a widget, this option determines how the lines line up with each other. Must be one of left, center, or right. Left means that the lines' left edges all line up, center means that the lines' centers are aligned, and right means that the lines' right edges line up.
Known uses:
- Button
- Checkbutton
- Entry
- Label
- Listbox
- Menubutton
- Message (widget specific)
- Radiobutton
- Spinbox
- TButton
- TCombobox (widget specific)
- TEntry (widget specific)
- TLabel
- TProgressbar
- TextWidget.TagConfigure (command specific)
func Labelanchor ¶ added in v0.3.0
Labelanchor option.
Known uses:
- Labelframe (widget specific)
- TLabelframe (widget specific)
func Labelmargins ¶ added in v0.25.1
Labelmargins — Styling widgets
Labelmargins is a styling option of a ttk::labelframe. More information might be available at the Tcl/Tk ttk_labelframe page.
func Labeloutside ¶ added in v0.25.1
Labeloutside — Styling widgets
Labeloutside is a styling option of a ttk::labelframe. More information might be available at the Tcl/Tk ttk_labelframe page.
func Labelwidget ¶ added in v0.3.0
Labelwidget option.
Known uses:
- Labelframe (widget specific)
- TLabelframe (widget specific)
func Lbl ¶ added in v0.3.0
Lbl option.
Known uses:
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
- Scale (widget specific)
func Length ¶ added in v0.3.0
Length option.
Known uses:
- Scale (widget specific)
- TProgressbar (widget specific)
- TScale (widget specific)
func Lightcolor ¶ added in v0.25.1
Lightcolor — Styling widgets
Lightcolor is a styling option of one or more widgets. Please see Changing Widget Colors for details.
func Linearrow ¶ added in v0.62.0
Linearrow option.
Indicates whether or not arrowheads are to be drawn at one or both ends of the line. Where must have one of the values none (for no arrowheads), first (for an arrowhead at the first point of the line), last (for an arrowhead at the last point of the line), or both (for arrowheads at both ends). This option defaults to none. When requested to draw an arrowhead, Tk internally adjusts the corresponding line end point so that the rendered line ends at the neck of the arrowhead rather than at its tip so that the line doesn't extend past the edge of the arrowhead. This may trigger a Leave event if the mouse is hovering this line end. Conversely, when removing an arrowhead Tk adjusts the corresponding line point the other way round, which may trigger an Enter event.
Known uses:
- CanvasWidget.CreateLine (widget specific)
func Lines ¶ added in v0.48.0
func Lines() Opt
Lines option.
Known uses:
- TextWidget (command specific)
func Lmargin1 ¶ added in v0.4.10
Lmargin1 option.
Known uses:
- TextWidget.TagConfigure (command specific)
func Lmargin2 ¶ added in v0.4.10
Lmargin2 option.
Known uses:
- TextWidget.TagConfigure (command specific)
func Lmargincolor ¶ added in v0.4.10
Lmargincolor option.
Known uses:
- TextWidget.TagConfigure (command specific)
func Maxphase ¶ added in v0.25.1
Maxphase — Styling widgets
Maxphase is a styling option of a ttk::progressbar. More information might be available at the Tcl/Tk ttk_progressbar page.
func Mnu ¶ added in v0.3.0
Mnu option.
Known uses:
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
- Menubutton (widget specific)
- TMenubutton (widget specific)
- Toplevel (widget specific)
func Msg ¶ added in v0.4.10
Msg option.
Known uses:
- ChooseDirectory (command specific)
- MessageBox (command specific)
func Nocase ¶ added in v0.4.10
func Nocase() Opt
Nocase option.
Known uses:
- Text (widget specific, applies to Search)
func Offrelief ¶ added in v0.3.0
Offrelief option.
Known uses:
- Checkbutton (widget specific)
- Radiobutton (widget specific)
func Offset ¶ added in v0.4.10
Offset option.
Known uses:
- TextWidget.TagConfigure (command specific)
func Offvalue ¶ added in v0.3.0
Offvalue option.
Known uses:
- Checkbutton (widget specific)
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
- TCheckbutton (widget specific)
func Onvalue ¶ added in v0.3.0
Onvalue option.
Known uses:
- Checkbutton (widget specific)
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
- TCheckbutton (widget specific)
func Open ¶ added in v0.53.0
Open option.
Known uses:
- TTreeviewWidget (command specific)
More information might be available at the Tcl/Tk treeview page.
func Orient ¶ added in v0.2.0
Orient option.
For widgets that can lay themselves out with either a horizontal or vertical orientation, such as scrollbars, this option specifies which orientation should be used. Must be either horizontal or vertical or an abbreviation of one of these.
Known uses:
- Panedwindow
- Scale
- Scrollbar
- TPanedwindow (widget specific)
- TProgressbar (widget specific)
- TScale (widget specific)
- TScrollbar (widget specific)
- TSeparator (widget specific)
func Outline ¶ added in v0.4.12
Outline option.
This option specifies the color that should be used to draw the outline of the item in its normal state. Color may have any of the forms accepted by Tk_GetColor. If color is specified as an empty string then no outline is drawn for the item.
Known uses:
- CanvasWidget.CreateArc (widget specific)
func Outlineoffset ¶ added in v0.4.10
Outlineoffset option.
Specifies the offset of the stipple pattern used for outlines, in the same way that the -outline option controls fill stipples. (See the -outline option for a description of the syntax of offset.)
Known uses:
- CanvasWidget.CreateArc (widget specific)
func Outlinestipple ¶ added in v0.4.12
Outlinestipple option.
This option specifies the stipple pattern that should be used to draw the outline of the item in its normal state. Indicates that the outline for the item should be drawn with a stipple pattern; bitmap specifies the stipple pattern to use, in any of the forms accepted by Tk_GetBitmap. If the -outline option has not been specified then this option has no effect. If bitmap is an empty string (the default), then the outline is drawn in a solid fashion. Note that stipples are not well supported on platforms that do not use X11 as their drawing API.
Known uses:
- CanvasWidget.CreateArc (widget specific)
func Overrelief ¶ added in v0.3.0
Overrelief option.
Known uses:
- Button (widget specific)
- Checkbutton (widget specific)
- Radiobutton (widget specific)
func Overstrike ¶ added in v0.4.10
Overstrike option.
Known uses:
- NewFont (command specific)
- TextWidget.TagConfigure (command specific)
func Overstrikefg ¶ added in v0.4.10
Overstrikefg option.
Known uses:
- TextWidget.TagConfigure (command specific)
func Pad ¶ added in v0.56.0
Pad option.
The -pad option specifies the number of screen units that will be added to the largest window contained completely in that column/row when the grid geometry manager requests a size from the containing window.
Known uses:
- GridColumnConfigure (command specific)
- GridRowConfigure (command specific)
func Padding ¶ added in v0.3.0
Padding option.
Specifies the internal padding for the widget. The padding is a list of up to four length specifications left top right bottom. If fewer than four elements are specified, bottom defaults to top, right defaults to left, and top defaults to left. In other words, a list of three numbers specify the left, vertical, and right padding; a list of two numbers specify the horizontal and the vertical padding; a single number specifies the same padding all the way around the widget.
Known uses:
- TFrame
- TLabel
- TLabelframe
- TNotebook (widget specific)
- TTreeview
func Padx ¶ added in v0.2.0
Padx option.
Specifies a non-negative value indicating how much extra space to request for the widget in the X-direction. The value may have any of the forms acceptable to Tk_GetPixels. When computing how large a window it needs, the widget will add this amount to the width it would normally need (as determined by the width of the things displayed in the widget); if the geometry manager can satisfy this request, the widget will end up with extra internal space to the left and/or right of what it displays inside. Most widgets only use this option for padding text: if they are displaying a bitmap or image, then they usually ignore padding options.
Known uses:
- Button
- Checkbutton
- Frame
- Grid (command specific)
- Label
- Labelframe
- Menubutton
- Message
- Pack (command specific)
- Radiobutton
- Text
- Toplevel
func Pady ¶ added in v0.2.0
Pady option.
Specifies a non-negative value indicating how much extra space to request for the widget in the Y-direction. The value may have any of the forms acceptable to Tk_GetPixels. When computing how large a window it needs, the widget will add this amount to the height it would normally need (as determined by the height of the things displayed in the widget); if the geometry manager can satisfy this request, the widget will end up with extra internal space above and/or below what it displays inside. Most widgets only use this option for padding text: if they are displaying a bitmap or image, then they usually ignore padding options.
Known uses:
- Button
- Checkbutton
- Frame
- Grid (command specific)
- Label
- Labelframe
- Menubutton
- Message
- Pack (command specific)
- Radiobutton
- Text
- Toplevel
func Parent ¶ added in v0.4.10
Parent option.
Known uses:
- ChooseColor (command specific)
- ChooseDirectory (command specific)
- Fontchooser (command specific)
- GetOpenFile (command specific)
- GetSaveFile (command specific)
- MessageBox (command specific)
func Period ¶ added in v0.25.1
Period — Styling widgets
Period is a styling option of a ttk::progressbar. More information might be available at the Tcl/Tk ttk_progressbar page.
func Placeholder ¶ added in v0.2.0
Placeholder option.
Specifies a help text string to display if no text is otherwise displayed, that is when the widget is empty. The placeholder text is displayed using the values of the -font and -justify options.
Known uses:
func Placeholderforeground ¶ added in v0.2.0
Placeholderforeground option.
Specifies the foreground color to use when the placeholder text is displayed. The default color is platform-specific.
Known uses:
func Postoffset ¶ added in v0.25.1
Postoffset — Styling widgets
Postoffset is a styling option of a ttk::combobox. More information might be available at the Tcl/Tk ttk_combobox page.
func Proxybackground ¶ added in v0.3.0
Proxybackground option.
Known uses:
- Panedwindow (widget specific)
func Proxyborderwidth ¶ added in v0.3.0
Proxyborderwidth option.
Known uses:
- Panedwindow (widget specific)
func Regexp ¶ added in v0.4.10
func Regexp() Opt
Regexp option.
Known uses:
- Text (widget specific, applies to Search)
func Relief ¶ added in v0.2.0
Relief option.
Specifies the 3-D effect desired for the widget. Acceptable values are raised, sunken, flat, ridge, solid, and groove. The value indicates how the interior of the widget should appear relative to its exterior; for example, raised means the interior of the widget should appear to protrude from the screen, relative to the exterior of the widget.
Known uses:
- Button
- Canvas
- Checkbutton
- Entry
- Frame
- Label
- Labelframe
- Listbox
- Menu
- Menubutton
- Message
- Panedwindow
- Radiobutton
- Scale
- Scrollbar
- Spinbox
- TFrame (widget specific)
- TLabel (widget specific)
- TextWidget.TagConfigure (command specific)
- Text
- Toplevel
func Repeatdelay ¶ added in v0.2.0
Repeatdelay option.
Specifies the number of milliseconds a button or key must be held down before it begins to auto-repeat. Used, for example, on the up- and down-arrows in scrollbars.
Known uses:
func Repeatinterval ¶ added in v0.2.0
Repeatinterval option.
Used in conjunction with -repeatdelay: once auto-repeat begins, this option determines the number of milliseconds between auto-repeats.
Known uses:
func Rmargin ¶ added in v0.4.10
Rmargin option.
Known uses:
- TextWidget.TagConfigure (command specific)
func Rmargincolor ¶ added in v0.4.10
Rmargincolor option.
Known uses:
- TextWidget.TagConfigure (command specific)
func Rowheight ¶ added in v0.25.1
Rowheight — Styling widgets
Rowheight is a styling option of one or more widgets. Please see Changing Widget Colors for details.
func Sashthickness ¶ added in v0.25.1
Sashthickness — Styling widgets
Sashthickness is a styling option of one or more widgets. Please see Changing Widget Colors for details.
func Selectbackground ¶ added in v0.2.0
Selectbackground option.
Specifies the background color to use when displaying selected items.
Known uses:
func Selectborderwidth ¶ added in v0.2.0
Selectborderwidth option.
Specifies a non-negative value indicating the width of the 3-D border to draw around selected items. The value may have any of the forms acceptable to Tk_GetPixels.
Known uses:
func Selectcolor ¶ added in v0.3.0
Selectcolor option.
Known uses:
- Checkbutton (widget specific)
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
- Menu (widget specific)
- Radiobutton (widget specific)
func Selectforeground ¶ added in v0.2.0
Selectforeground option.
Specifies the foreground color to use when displaying selected items.
Known uses:
func Selectimage ¶ added in v0.3.0
Selectimage option.
Known uses:
- Checkbutton (widget specific)
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
- Radiobutton (widget specific)
func Setgrid ¶ added in v0.2.0
Setgrid option.
Specifies a boolean value that determines whether this widget controls the resizing grid for its top-level window. This option is typically used in text widgets, where the information in the widget has a natural size (the size of a character) and it makes sense for the window's dimensions to be integral numbers of these units. These natural window sizes form a grid. If the -setgrid option is set to true then the widget will communicate with the window manager so that when the user interactively resizes the top-level window that contains the widget, the dimensions of the window will be displayed to the user in grid units and the window size will be constrained to integral numbers of grid units. See the section GRIDDED GEOMETRY MANAGEMENT in the wm manual entry for more details.
Known uses:
func Shiftrelief ¶ added in v0.25.1
TButton — Widget that issues a command when pressed
Description ¶
Shiftrelief specifies how far the button contents are shifted down and right in the pressed state. This action provides additional skeuomorphic feedback.
func Sliderwidth ¶ added in v0.25.1
Sliderwidth — Styling widgets
Sliderwidth is a styling option of a ttk::scale. More information might be available at the Tcl/Tk ttk_scale page.
func Smooth ¶ added in v0.4.10
Smooth option.
smoothMethod must have one of the forms accepted by Tcl_GetBoolean or a line smoothing method. Only true and raw are supported in the core (with bezier being an alias for true), but more can be added at runtime. If a boolean false value or empty string is given, no smoothing is applied. A boolean truth value assumes true smoothing. If the smoothing method is true, this indicates that the line should be drawn as a curve, rendered as a set of quadratic splines: one spline is drawn for the first and second line segments, one for the second and third, and so on. Straight-line segments can be generated within a curve by duplicating the end-points of the desired line segment. If the smoothing method is raw, this indicates that the line should also be drawn as a curve but where the list of coordinates is such that the first coordinate pair (and every third coordinate pair thereafter) is a knot point on a cubic Bezier curve, and the other coordinates are control points on the cubic Bezier curve. Straight line segments can be generated within a curve by making control points equal to their neighbouring knot points. If the last point is a control point and not a knot point, the point is repeated (one or two times) so that it also becomes a knot point.
Known uses:
- CanvasWidget.CreateLine (widget specific)
func Spacing1 ¶ added in v0.3.0
Spacing1 option.
Known uses:
- TextWidget.TagConfigure (command specific)
- Text (widget specific)
func Spacing2 ¶ added in v0.3.0
Spacing2 option.
Known uses:
- TextWidget.TagConfigure (command specific)
- Text (widget specific)
func Spacing3 ¶ added in v0.3.0
Spacing3 option.
Known uses:
- TextWidget.TagConfigure (command specific)
- Text (widget specific)
func Splinesteps ¶ added in v0.4.10
Splinesteps option.
Specifies the degree of smoothness desired for curves: each spline will be approximated with number line segments. This option is ignored unless the -smooth option is true or raw.
Known uses:
- CanvasWidget.CreateLine (widget specific)
func Start ¶ added in v0.4.10
Start option.
Specifies the beginning of the angular range occupied by the arc. Degrees is given in units of degrees measured counter-clockwise from the 3-o'clock position; it may be either positive or negative.
Known uses:
- CanvasWidget.CreateArc (widget specific)
func State ¶ added in v0.3.0
State option.
May be set to normal or disabled to control the disabled state bit. This is a write-only option: setting it changes the widget state, but the state widget command does not affect the -state option.
Known uses:
- Button (widget specific)
- Canvas (widget specific)
- Checkbutton (widget specific)
- Entry (widget specific)
- Label (widget specific)
- Listbox (widget specific)
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
- Menubutton (widget specific)
- Radiobutton (widget specific)
- Scale (widget specific)
- Spinbox (widget specific)
- TButton
- TCheckbutton
- TCombobox (widget specific)
- TEntry (widget specific)
- TLabel
- TMenubutton
- TRadiobutton
- TSpinbox
- Text (widget specific)
func Stipple ¶ added in v0.4.12
Stipple option.
This option specifies the stipple patterns that should be used to fill the item in its normal state. bitmap specifies the stipple pattern to use, in any of the forms accepted by Tk_GetBitmap. If the -fill option has not been specified then this option has no effect. If bitmap is an empty string (the default), then filling is done in a solid fashion. For the text item, it affects the actual text. Note that stipples are not well supported on platforms that do not use X11 as their drawing API.
Known uses:
- CanvasWidget.CreateArc (widget specific)
- CanvasWidget.CreateBitmap (widget specific)
func Stretch ¶ added in v0.4.10
Stretch option.
Description ¶
Controls how extra space is allocated to each of the panes. When is one of always, first, last, middle, and never. The panedwindow will calculate the required size of all its panes. Any remaining (or deficit) space will be distributed to those panes marked for stretching. The space will be distributed based on each panes current ratio of the whole. The when values have the following definition:
- always: This pane will always stretch.
- first: Only if this pane is the first pane (left-most or top-most) will it stretch.
- last: Only if this pane is the last pane (right-most or bottom-most) will it stretch. This is the default value.
- middle: Only if this pane is not the first or last pane will it stretch.
- never: This pane will never stretch.
Known uses:
- PanedwindowWidget (command specific)
func Stripedbackground ¶ added in v0.25.1
Stripedbackground — Styling widgets
Stripedbackground is a styling option of a ttk::treeview. More information might be available at the Tcl/Tk ttk_treeview page.
func Style ¶ added in v0.4.10
Style option.
May be used to specify a custom widget style.
Known uses:
func Tabmargins ¶ added in v0.25.1
Tabmargins — Styling widgets
Tabmargins is a styling option of a ttk::notebook. More information might be available at the Tcl/Tk ttk_notebook page.
func Tabposition ¶ added in v0.25.1
Tabposition — Styling widgets
Tabposition is a styling option of a ttk::notebook.
More information might be available at the Tcl/Tk ttk_notebook page.
func Tabs ¶ added in v0.3.0
Tabs option.
Known uses:
- TextWidget.TagConfigure (command specific)
- Text (widget specific)
func Tabstyle ¶ added in v0.3.0
Tabstyle option.
Known uses:
- TextWidget.TagConfigure (command specific)
- Text (widget specific)
func Tags ¶ added in v0.4.10
Tags option.
Specifies a set of tags to apply to the item. TagList consists of a list of tag names, which replace any existing tags for the item. TagList may be an empty list.
Known uses:
- CanvasWidget.CreateArc (widget specific)
- CanvasWidget.CreateBitmap (widget specific)
func Takefocus ¶ added in v0.2.0
Takefocus option.
Determines whether the window accepts the focus during keyboard traversal (e.g., Tab and Shift-Tab). Before setting the focus to a window, the traversal scripts consult the value of the -takefocus option. A value of 0 means that the window should be skipped entirely during keyboard traversal. 1 means that the window should receive the input focus as long as it is viewable (it and all of its ancestors are mapped). An empty value for the option means that the traversal scripts make the decision about whether or not to focus on the window: the current algorithm is to skip the window if it is disabled, if it has no key bindings, or if it is not viewable. If the value has any other form, then the traversal scripts take the value, append the name of the window to it (with a separator space), and evaluate the resulting string as a Tcl script. The script must return 0, 1, or an empty string: a 0 or 1 value specifies whether the window will receive the input focus, and an empty string results in the default decision described above. Note that this interpretation of the option is defined entirely by the Tcl scripts that implement traversal: the widget implementations ignore the option entirely, so you can change its meaning if you redefine the keyboard traversal scripts.
Known uses:
- Button
- Canvas
- Checkbutton
- Entry
- Frame
- Label
- Labelframe
- Listbox
- Menu
- Menubutton
- Message
- Radiobutton
- Scale
- Scrollbar
- Spinbox
- TButton
- TCheckbutton
- TCombobox
- TEntry
- TFrame
- TLabel
- TLabelframe
- TMenubutton
- TNotebook
- TPanedwindow
- TProgressbar
- TRadiobutton
- TScale
- TScrollbar
- TSeparator
- TSizegrip
- TSpinbox
- TTreeview
- Text
- Toplevel
func Tearoffcommand ¶ added in v0.3.0
Tearoffcommand option.
See also Event handlers.
Known uses:
- Menu (widget specific)
func Textvariable ¶ added in v0.2.0
Textvariable option.
Specifies the value to be displayed inside the widget. The way in which the string is displayed in the widget depends on the particular widget and may be determined by other options, such as -anchor or -justify.
Known uses:
- Button
- Checkbutton
- Entry
- Label
- Menubutton
- Message
- Radiobutton
- Spinbox
- TButton
- TCheckbutton
- TCombobox (widget specific)
- TEntry (widget specific)
- TLabel
- TMenubutton
- TRadiobutton
func Title ¶ added in v0.3.0
Title option.
Known uses:
- ChooseColor (command specific)
- ChooseDirectory (command specific)
- Fontchooser (command specific)
- GetOpenFile (command specific)
- GetSaveFile (command specific)
- Menu (widget specific)
- MessageBox (command specific)
func Tristateimage ¶ added in v0.3.0
Tristateimage option.
Known uses:
- Checkbutton (widget specific)
- Radiobutton (widget specific)
func Tristatevalue ¶ added in v0.3.0
Tristatevalue option.
Known uses:
- Checkbutton (widget specific)
- Radiobutton (widget specific)
func Troughcolor ¶ added in v0.2.0
Troughcolor option.
Specifies the color to use for the rectangular trough areas in widgets such as scrollbars and scales. This option is ignored for scrollbars on Windows (native widget does not recognize this option).
Known uses:
func Troughrelief ¶ added in v0.25.1
Troughrelief — Styling widgets
Troughrelief is a styling option of one or more widgets. Please see Changing Widget Colors for details.
func Txt ¶ added in v0.2.0
Txt option.
Specifies a string to be displayed inside the widget. The way in which the string is displayed depends on the particular widget and may be determined by other options, such as -anchor or -justify.
Known uses:
func Type ¶ added in v0.3.0
Type option.
Known uses:
- ClipboardAppend (command specific)
- ClipboardGet (command specific)
- Menu (widget specific)
- MessageBox (command specific)
- WmAttributes (command specific)
func Underline ¶ added in v0.2.0
Underline option.
Specifies the integer index of a character to underline in the widget. This option is used by the default bindings to implement keyboard traversal for menu buttons and menu entries. 0 corresponds to the first character of the text displayed in the widget, 1 to the next character, and so on. end corresponds to the last character, end-1 to the before last character, and so on.
Known uses:
- Button
- Checkbutton
- Label
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
- Menubutton
- NewFont (command specific)
- Radiobutton
- TButton
- TCheckbutton
- TLabel
- TLabelframe (widget specific)
- TMenubutton
- TRadiobutton
- TextWidget.TagConfigure (command specific)
func Underlinefg ¶ added in v0.4.10
Underlinefg option.
Known uses:
- TextWidget.TagConfigure (command specific)
func Value ¶ added in v0.3.0
Value option.
Known uses:
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
- Radiobutton (widget specific)
- TProgressbar (widget specific)
- TRadiobutton (widget specific)
- TScale (widget specific)
func Visual ¶ added in v0.3.0
Visual option.
Known uses:
- Frame (widget specific)
- Labelframe (widget specific)
- Toplevel (widget specific)
func Width ¶ added in v0.3.0
Width option.
If greater than zero, specifies how much space, in character widths, to allocate for the text label. If less than zero, specifies a minimum width. If zero or unspecified, the natural width of the text label is used. Note that some themes may specify a non-zero -width in the style.
Known uses:
- Button (widget specific)
- Canvas (widget specific)
- Checkbutton (widget specific)
- Entry (widget specific)
- Frame (widget specific)
- Label (widget specific)
- Labelframe (widget specific)
- Listbox (widget specific)
- Menubutton (widget specific)
- Message (widget specific)
- NewPhoto (command specific)
- Panedwindow (widget specific)
- Place (command specific)
- Radiobutton (widget specific)
- Scale (widget specific)
- Scrollbar (widget specific)
- Spinbox (widget specific)
- TButton
- TCheckbutton
- TCombobox (widget specific)
- TEntry (widget specific)
- TFrame (widget specific)
- TLabel
- TLabelframe (widget specific)
- TMenubutton
- TNotebook (widget specific)
- TPanedwindow (widget specific)
- TRadiobutton
- Text (widget specific)
- Toplevel (widget specific)
func Win ¶ added in v0.36.0
Win option.
Known uses:
- Text (widget specific, applies to embedded windows)
func Wrap ¶ added in v0.3.0
Wrap option.
Known uses:
- Spinbox (widget specific)
- TSpinbox (widget specific)
- TextWidget.TagConfigure (command specific)
- Text (widget specific)
func Wraplength ¶ added in v0.2.0
Wraplength option.
For widgets that can perform word-wrapping, this option specifies the maximum line length. Lines that would exceed this length are wrapped onto the next line, so that no line is longer than the specified length. The value may be specified in any of the standard forms for screen distances. If this value is negative or zero then no wrapping is done: lines will break only at newline characters in the text.
Known uses:
- Button
- Checkbutton
- Label
- Menubutton
- Radiobutton
- TLabel
- TLabel (widget specific)
- TProgressbar
func Xpixels ¶ added in v0.48.0
func Xpixels() Opt
Xpixels option.
Known uses:
- TextWidget (command specific)
func Xscrollcommand ¶ added in v0.2.0
Xscrollcommand option.
See also Event handlers.
Specifies the prefix for a command used to communicate with horizontal scrollbars. When the view in the widget's window changes (or whenever anything else occurs that could change the display in a scrollbar, such as a change in the total size of the widget's contents), the widget will generate a Tcl command by concatenating the scroll command and two numbers. Each of the numbers is a fraction between 0 and 1, which indicates a position in the document. 0 indicates the beginning of the document, 1 indicates the end, .333 indicates a position one third the way through the document, and so on. The first fraction indicates the first information in the document that is visible in the window, and the second fraction indicates the information just after the last portion that is visible. The command is then passed to the Tcl interpreter for execution. Typically the -xscrollcommand option consists of the path name of a scrollbar widget followed by e.g. this will cause the scrollbar to be updated whenever the view in the window changes. If this option is not specified, then no command will be executed.
Known uses:
func Xscrollincrement ¶ added in v0.3.0
Xscrollincrement option.
Known uses:
- Canvas (widget specific)
func Ypixels ¶ added in v0.48.0
func Ypixels() Opt
Ypixels option.
Known uses:
- TextWidget (command specific)
func Yscrollcommand ¶ added in v0.2.0
Yscrollcommand option.
See also Event handlers.
Specifies the prefix for a command used to communicate with vertical scrollbars. This option is treated in the same way as the -xscrollcommand option, except that it is used for vertical scrollbars and is provided by widgets that support vertical scrolling. See the description of -xscrollcommand for details on how this option is used.
Known uses:
func Yscrollincrement ¶ added in v0.3.0
Yscrollincrement option.
Known uses:
- Canvas (widget specific)
type OptionMenuWidget ¶ added in v0.53.0
type OptionMenuWidget struct { *Window // contains filtered or unexported fields }
OptionMenuWidget represents the Tcl/Tk option menu.
More information might be available at the Tcl/Tk option menu page.
func OptionMenu ¶ added in v0.2.0
func OptionMenu(varName *VariableOpt, options ...any) (r *OptionMenuWidget)
tk_optionMenu — Create an option menubutton and its menu
Description ¶
This procedure creates an option menubutton whose name is pathName, plus an associated menu. Together they allow the user to select one of the values given by the value arguments. The current value will be stored in the global variable whose name is given by varName and it will also be displayed as the label in the option menubutton. The user can click on the menubutton to display a menu containing all of the values and thereby select a new value. Once a new value is selected, it will be stored in the variable and appear in the option menubutton. The current value can also be changed by setting the variable.
The return value from tk_optionMenu is the name of the menu associated with pathName, so that the caller can change its configuration options or manipulate it in other ways.
More information might be available at the Tcl/Tk option menu page.
func (*OptionMenuWidget) Name ¶ added in v0.53.0
func (w *OptionMenuWidget) Name() string
Name returns the menu name of 'w'.
type PanedwindowWidget ¶ added in v0.11.0
type PanedwindowWidget struct {
*Window
}
PanedwindowWidget represents the Tcl/Tk panedwindow widget/window
func Panedwindow ¶ added in v0.2.0
func Panedwindow(options ...Opt) *PanedwindowWidget
Panedwindow — Create and manipulate 'panedwindow' split container widgets
Description ¶
The panedwindow command creates a new window (given by the pathName argument) and makes it into a panedwindow widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the panedwindow such as its default background color and relief. The panedwindow command returns the path name of the new window.
A panedwindow widget contains any number of panes, arranged horizontally or vertically, according to the value of the panes is separated by a moveable (via mouse movements) sash. Moving a sash causes the widgets on either side of the sash to be resized.
Use Window.Panedwindow to create a Panedwindow with a particular parent.
More information might be available at the Tcl/Tk panedwindow page.
Standard options ¶
Widget specific options ¶
When sash handles are drawn, specifies the distance from the top or left end of the sash (depending on the orientation of the widget) at which to draw the handle. May be any value accepted by Tk_GetPixels.
Specifies the side length of a sash handle. Handles are always drawn as squares. May be any value accepted by Tk_GetPixels.
Specifies a desired height for the overall panedwindow widget. May be any value accepted by Tk_GetPixels. If an empty string, the widget will be made high enough to allow all contained widgets to have their natural height.
Specifies whether panes should be resized as a sash is moved (true), or if resizing should be deferred until the sash is placed (false). In the latter case, a version of the sash is displayed during the resizing to show where the panes will be resized to when releasing the mouse button. This version of the sash is the proxy. It's rendering can be configured using the -proxybackground, -proxyborderwidth and -proxyrelief options.
Background color to use when drawing the proxy. If an empty string, the value of the -background option will be used.
Specifies the borderwidth of the proxy. May be any value accepted by Tk_GetPixels.
Relief to use when drawing the proxy. May be any of the standard Tk relief values. If an empty string, the value of the -sashrelief option will be used.
Mouse cursor to use when over a sash. If null, sb_h_double_arrow will be used for horizontal panedwindows, and sb_v_double_arrow will be used for vertical panedwindows.
Specifies the amount of padding to leave of each side of a sash. May be any value accepted by Tk_GetPixels.
Relief to use when drawing a sash. May be any of the standard Tk relief values.
Specifies the width of each sash. May be any value accepted by Tk_GetPixels.
Specifies whether sash handles should be shown. May be any valid Tcl boolean value.
Specifies a desired width for the overall panedwindow widget. May be any value accepted by Tk_GetPixels. If an empty string, the widget will be made wide enough to allow all contained widgets to have their natural width.
func (*PanedwindowWidget) Add ¶ added in v0.41.0
func (w *PanedwindowWidget) Add(subwindow *Window, options ...Opt)
panedwindow — Create and manipulate 'panedwindow' split container widgets
Description ¶
Add one or more windows to the panedwindow, each in a separate pane. The arguments consist of the names of one or more windows followed by pairs of arguments that specify how to manage the windows. Option may have any of the values accepted by the configure subcommand.
More information might be available at the Tcl/Tk panedwindow page.
func (*PanedwindowWidget) Panecget ¶ added in v0.41.0
func (w *PanedwindowWidget) Panecget(subwindow *Window, opt any) string
panedwindow — Create and manipulate 'panedwindow' split container widgets
Description ¶
Query a management option for window. Option may be any value allowed by the paneconfigure subcommand.
More information might be available at the Tcl/Tk panedwindow page.
func (*PanedwindowWidget) Paneconfigure ¶ added in v0.41.0
func (w *PanedwindowWidget) Paneconfigure(subwindow *Window, options ...Opt) string
panedwindow — Create and manipulate 'panedwindow' split container widgets
Description ¶
Query or modify the management options for window. If no option is specified, returns a list describing all of the available options for pathName (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string.
More information might be available at the Tcl/Tk panedwindow page.
type RadiobuttonWidget ¶ added in v0.11.0
type RadiobuttonWidget struct {
}RadiobuttonWidget represents the Tcl/Tk radiobutton widget/window
func Radiobutton ¶ added in v0.2.0
func Radiobutton(options ...Opt) *RadiobuttonWidget
Radiobutton — Create and manipulate 'radiobutton' pick-one widgets
Description ¶
The radiobutton command creates a new window (given by the pathName argument) and makes it into a radiobutton widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the radiobutton such as its colors, font, text, and initial relief. The radiobutton command returns its pathName argument. At the time this command is invoked, there must not exist a window named pathName, but pathName's parent must exist.
A radiobutton is a widget that displays a textual string, bitmap or image and a diamond or circle called an indicator. If text is displayed, it must all be in a single font, but it can occupy multiple lines on the screen (if it contains newlines or if wrapping occurs because of the -wraplength option) and one of the characters may optionally be underlined using the all of the behavior of a simple button: it can display itself in either of three different ways, according to the -state option; it can be made to appear raised, sunken, or flat; it can be made to flash; and it invokes a Tcl command whenever mouse button 1 is clicked over the check button.
In addition, radiobuttons can be selected. If a radiobutton is selected, the indicator is normally drawn with a selected appearance, and a Tcl variable associated with the radiobutton is set to a particular value (normally 1). Under Unix, the indicator is drawn with a sunken relief and a special color. Under Windows, the indicator is drawn with a round mark inside. If the radiobutton is not selected, then the indicator is drawn with a deselected appearance, and the associated variable is set to a different value (typically 0). The indicator is drawn without a round mark inside. Typically, several radiobuttons share a single variable and the value of the variable indicates which radiobutton is to be selected. When a radiobutton is selected it sets the value of the variable to indicate that fact; each radiobutton also monitors the value of the variable and automatically selects and deselects itself when the variable's value changes. If the variable's value matches the -tristatevalue, then the radiobutton is drawn using the tri-state mode. This mode is used to indicate mixed or multiple values. (This is used when the radiobutton represents the state of multiple items.) By default the variable selectedButton is used; its contents give the name of the button that is selected, or the empty string if no button associated with that variable is selected. The name of the variable for a radiobutton, plus the variable to be stored into it, may be modified with options on the command line or in the option database. Configuration options may also be used to modify the way the indicator is displayed (or whether it is displayed at all). By default a radiobutton is configured to select itself on button clicks.
Use Window.Radiobutton to create a Radiobutton with a particular parent.
More information might be available at the Tcl/Tk radiobutton page.
Standard options ¶
- Activebackground
- Activeforeground
- Anchor
- Background
- Bitmap
- Borderwidth
- Compound
- Cursor
- Disabledforeground
- Foreground
- Highlightbackground
- Highlightcolor
- Highlightthickness
- Image
- Justify
- Padx
- Pady
- Relief
- Takefocus
- Textvariable
- Txt
- Underline
- Wraplength
Widget specific options ¶
Specifies a Tcl command to associate with the button. This command is typically invoked when mouse button 1 is released over the button window. The button's global variable (-variable option) will be updated before the command is invoked.
Specifies a desired height for the button. If an image or bitmap is being displayed in the button then the value is in screen units (i.e. any of the forms acceptable to Tk_GetPixels); for text it is in lines of text. If this option is not specified, the button's desired height is computed from the size of the image or bitmap or text being displayed in it.
Specifies whether or not the indicator should be drawn. Must be a proper boolean value. If false, the -relief option is ignored and the widget's relief is always sunken if the widget is selected and raised otherwise.
Specifies the relief for the checkbutton when the indicator is not drawn and the checkbutton is off. The default value is By setting this option to and setting -indicatoron to false and -overrelief to the effect is achieved of having a flat button that raises on mouse-over and which is depressed when activated. This is the behavior typically exhibited by the Align-Left, Align-Right, and Center radiobuttons on the toolbar of a word-processor, for example.
Specifies an alternative relief for the radiobutton, to be used when the mouse cursor is over the widget. This option can be used to make toolbar buttons, by configuring -relief flat -overrelief raised. If the value of this option is the empty string, then no alternative relief is used when the mouse cursor is over the radiobutton. The empty string is the default value.
Specifies a background color to use when the button is selected. If indicatorOn is true then the color is used as the background for the indicator regardless of the select state. If -indicatoron is false, this color is used as the background for the entire widget, in place of -background or -activeBackground, whenever the widget is selected. If specified as an empty string then no special color is used for displaying when the widget is selected.
Specifies an image to display (in place of the -image option) when the radiobutton is selected. This option is ignored unless the -image option has been specified.
Specifies one of three states for the radiobutton: normal, active, or disabled. In normal state the radiobutton is displayed using the -foreground and -background options. The active state is typically used when the pointer is over the radiobutton. In active state the radiobutton is displayed using the -activeforeground and -activebackground options. Disabled state means that the radiobutton should be insensitive: the default bindings will refuse to activate the widget and will ignore mouse button presses. In this state the -disabledforeground and -background options determine how the radiobutton is displayed.
Specifies an image to display (in place of the -image option) when the radiobutton is selected. This option is ignored unless the -image option has been specified.
Specifies the value that causes the radiobutton to display the multi-value selection, also known as the tri-state mode. Defaults to
Specifies value to store in the button's associated variable whenever this button is selected.
Specifies the name of a global variable to set whenever this button is selected. Changes in this variable also cause the button to select or deselect itself. Defaults to the value selectedButton.
Specifies a desired width for the button. If an image or bitmap is being displayed in the button, the value is in screen units (i.e. any of the forms acceptable to Tk_GetPixels); for text it is in characters. If this option is not specified, the button's desired width is computed from the size of the image or bitmap or text being displayed in it.
type ScaleWidget ¶ added in v0.11.0
type ScaleWidget struct {
*Window
}
ScaleWidget represents the Tcl/Tk scale widget/window
func Scale ¶ added in v0.2.0
func Scale(options ...Opt) *ScaleWidget
Scale — Create and manipulate 'scale' value-controlled slider widgets
Description ¶
The scale command creates a new window (given by the pathName argument) and makes it into a scale widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the scale such as its colors, orientation, and relief. The scale command returns its pathName argument. At the time this command is invoked, there must not exist a window named pathName, but pathName's parent must exist.
A scale is a widget that displays a rectangular trough and a small slider. The trough corresponds to a range of real values (determined by the -from, -to, and and the position of the slider selects a particular real value. The slider's position (and hence the scale's value) may be adjusted with the mouse or keyboard as described in the BINDINGS section below. Whenever the scale's value is changed, a Tcl command is invoked (using the -command option) to notify other interested widgets of the change. In addition, the value of the scale can be linked to a Tcl variable (using the -variable option), so that changes in either are reflected in the other.
Three annotations may be displayed in a scale widget: a label appearing at the top right of the widget (top left for horizontal scales), a number displayed just to the left of the slider (just above the slider for horizontal scales), and a collection of numerical tick marks just to the left of the current value (just below the trough for horizontal scales). Each of these three annotations may be enabled or disabled using the configuration options.
Use Window.Scale to create a Scale with a particular parent.
More information might be available at the Tcl/Tk scale page.
Standard options ¶
- Activebackground
- Background
- Borderwidth
- Cursor
- Foreground
- Highlightbackground
- Highlightcolor
- Highlightthickness
- Orient
- Relief
- Repeatdelay
- Repeatinterval
- Takefocus
- Troughcolor
Widget specific options ¶
Some interactions with the scale cause its value to change by increments; this option specifies the size of the large increments. If specified as 0, the large increments default to 1/10 the range of the scale.
Specifies the prefix of a Tcl command to invoke whenever the scale's value is changed via a widget command. The actual command consists of this option followed by a space and a real number indicating the new value of the scale.
An integer specifying how many significant digits should be retained when converting the value of the scale to a string. If the number is negative or zero, then the scale picks the smallest value that guarantees that every possible slider position prints as a different string.
A real value corresponding to the left or top end of the scale.
A string to display as a label for the scale. For vertical scales the label is displayed just to the right of the top end of the scale. For horizontal scales the label is displayed just above the left end of the scale. If the option is specified as an empty string, no label is displayed.
Specifies the desired long dimension of the scale in screen units (i.e. any of the forms acceptable to Tk_GetPixels). For vertical scales this is the scale's height; for horizontal scales it is the scale's width.
A real value specifying the resolution for the scale. If this value is greater than zero then the scale's value will always be rounded to an even multiple of this value, as will the endpoints of the scale. If the value is negative then no rounding occurs. Defaults to 1 (i.e., the value will be integral).
Specifies a boolean value indicating whether or not the current value of the scale is to be displayed.
Specifies the size of the slider, measured in screen units along the slider's long dimension. The value may be specified in any of the forms acceptable to Tk_GetPixels.
Specifies the relief to use when drawing the slider, such as raised or sunken.
Specifies one of three states for the scale: normal, active, or disabled. If the scale is disabled then the value may not be changed and the scale will not activate. If the scale is active, the slider is displayed using the color specified by the -activebackground option.
Must be a real value. Determines the spacing between numerical tick marks displayed below or to the left of the slider. The values will all be displayed with the same number of decimal places, which will be enough to ensure they are all accurate to within 20% of a tick interval. If 0, no tick marks will be displayed.
Specifies a real value corresponding to the right or bottom end of the scale. This value may be either less than or greater than the -from option.
Specifies the name of a global variable to link to the scale. Whenever the value of the variable changes, the scale will update to reflect this value. Whenever the scale is manipulated interactively, the variable will be modified to reflect the scale's new value.
Specifies the desired narrow dimension of the scale in screen units (i.e. any of the forms acceptable to Tk_GetPixels). For vertical scales this is the scale's width; for horizontal scales this is the scale's height.
type ScrollbarWidget ¶ added in v0.11.0
type ScrollbarWidget struct {
*Window
}
ScrollbarWidget represents the Tcl/Tk scrollbar widget/window
func Scrollbar ¶ added in v0.2.0
func Scrollbar(options ...Opt) *ScrollbarWidget
Scrollbar — Create and manipulate 'scrollbar' scrolling control and indicator widgets
Description ¶
The scrollbar command creates a new window (given by the pathName argument) and makes it into a scrollbar widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the scrollbar such as its colors, orientation, and relief. The scrollbar command returns its pathName argument. At the time this command is invoked, there must not exist a window named pathName, but pathName's parent must exist.
A scrollbar is a widget that displays two arrows, one at each end of the scrollbar, and a slider in the middle portion of the scrollbar. It provides information about what is visible in an associated window that displays a document of some sort (such as a file being edited or a drawing). The position and size of the slider indicate which portion of the document is visible in the associated window. For example, if the slider in a vertical scrollbar covers the top third of the area between the two arrows, it means that the associated window displays the top third of its document.
Scrollbars can be used to adjust the view in the associated window by clicking or dragging with the mouse. See the BINDINGS section below for details.
Use Window.Scrollbar to create a Scrollbar with a particular parent.
More information might be available at the Tcl/Tk scrollbar page.
Standard options ¶
- Activebackground
- Background
- Borderwidth
- Cursor
- Highlightbackground
- Highlightcolor
- Highlightthickness
- Jump
- Orient
- Relief
- Repeatdelay
- Repeatinterval
- Takefocus
- Troughcolor
Widget specific options ¶
Specifies the relief to use when displaying the element that is active, if any. Elements other than the active element are always displayed with a raised relief.
Specifies the prefix of a Tcl command to invoke to change the view in the widget associated with the scrollbar. When a user requests a view change by manipulating the scrollbar, a Tcl command is invoked. The actual command consists of this option followed by additional information as described later. This option almost always has a value such as .t xview or .t yview, consisting of the name of a widget and either xview (if the scrollbar is for horizontal scrolling) or yview (for vertical scrolling). All scrollable widgets have xview and yview commands that take exactly the additional arguments appended by the scrollbar as described in SCROLLING COMMANDS below.
Specifies the width of borders drawn around the internal elements of the scrollbar (the two arrows and the slider). The value may have any of the forms acceptable to Tk_GetPixels. If this value is the empty string (the default), the value of the -borderwidth option is used in its place.
Specifies the desired narrow dimension of the scrollbar window, not including 3-D border, if any. For vertical scrollbars this will be the width and for horizontal scrollbars this will be the height. The value may have any of the forms acceptable to Tk_GetPixels.
type SpinboxWidget ¶ added in v0.11.0
type SpinboxWidget struct {
*Window
}
SpinboxWidget represents the Tcl/Tk spinbox widget/window
func Spinbox ¶ added in v0.2.0
func Spinbox(options ...Opt) *SpinboxWidget
Spinbox — Create and manipulate 'spinbox' value spinner widgets
Description ¶
The spinbox command creates a new window (given by the pathName argument) and makes it into a spinbox widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the spinbox such as its colors, font, and relief. The spinbox command returns its pathName argument. At the time this command is invoked, there must not exist a window named pathName, but pathName's parent must exist.
A spinbox is an extended entry widget that allows he user to move, or spin, through a fixed set of ascending or descending values such as times or dates in addition to editing the value as in an entry. When first created, a spinbox's string is empty. A portion of the spinbox may be selected as described below. If a spinbox is exporting its selection (see the -exportselection option), then it will observe the standard protocols for handling the selection; spinbox selections are available as type STRING. Spinboxes also observe the standard Tk rules for dealing with the input focus. When a spinbox has the input focus it displays an insertion cursor to indicate where new characters will be inserted.
Spinboxes are capable of displaying strings that are too long to fit entirely within the widget's window. In this case, only a portion of the string will be displayed; commands described below may be used to change the view in the window. Spinboxes use the standard -xscrollcommand mechanism for interacting with scrollbars (see the description of the -xscrollcommand option for details). They also support scanning, as described below.
Use Window.Spinbox to create a Spinbox with a particular parent.
More information might be available at the Tcl/Tk spinbox page.
Standard options ¶
- Activebackground
- Background
- Borderwidth
- Cursor
- Exportselection
- Foreground
- Highlightbackground
- Highlightcolor
- Highlightthickness
- Insertbackground
- Insertborderwidth
- Insertofftime
- Insertontime
- Insertwidth
- Justify
- Placeholder
- Placeholderforeground
- Relief
- Repeatdelay
- Repeatinterval
- Selectbackground
- Selectborderwidth
- Selectforeground
- Takefocus
- Textvariable
- Xscrollcommand
Widget specific options ¶
The background color to be used for the spin buttons.
The cursor to be used when over the spin buttons. If this is empty (the default), a default cursor will be used.
The relief to be used for the upper spin button.
The relief to be used for the lower spin button.
Specifies a Tcl command to invoke whenever a spinbutton is invoked. The command recognizes several percent substitutions: %W for the widget path, %s for the current value of the widget, and %d for the direction of the button pressed (up or down).
Specifies the background color to use when the spinbox is disabled. If this option is the empty string, the normal background color is used.
Specifies the foreground color to use when the spinbox is disabled. If this option is the empty string, the normal foreground color is used.
Specifies an alternate format to use when setting the string value when using the -from and -to range. This must be a format specifier of the form %<pad>.<pad>f, as it will format a floating-point number.
A floating-point value corresponding to the lowest value for a spinbox, to be used in conjunction with -to and -increment. When all are specified correctly, the spinbox will use these values to control its contents. If this value is greater than the -to option, then -from and -to values are automatically swapped. If -values is specified, it supersedes this option.
Specifies a script to eval when -validatecommand returns 0. Setting it to an empty string disables this feature (the default). The best use of this option is to set it to bell. See VALIDATION below for more information.
A floating-point value specifying the increment. When used with -from and -to, the value in the widget will be adjusted by -increment when a spin button is pressed (up adds the value, down subtracts the value).
Specifies the background color to use when the spinbox is readonly. If this option is the empty string, the normal background color is used.
Specifies one of three states for the spinbox: normal, disabled, or readonly. If the spinbox is readonly, then the value may not be changed using widget commands and no insertion cursor will be displayed, even if the input focus is in the widget; the contents of the widget may still be selected. If the spinbox is disabled, the value may not be changed, no insertion cursor will be displayed, the contents will not be selectable, and the spinbox may be displayed in a different color, depending on the values of the -disabledforeground and -disabledbackground options.
A floating-point value corresponding to the highest value for the spinbox, to be used in conjunction with -from and -increment. When all are specified correctly, the spinbox will use these values to control its contents. If this value is less than the -from option, then -from and -to values are automatically swapped. If -values is specified, it supersedes this option.
Specifies the mode in which validation should operate: none, focus, focusin, focusout, key, or all. It defaults to none. When you want validation, you must explicitly state which mode you wish to use. See VALIDATION below for more.
Specifies a script to evaluate when you want to validate the input in the widget. Setting it to an empty string disables this feature (the default). Validation occurs according to the value of -validate. This command must return a valid Tcl boolean value. If it returns 0 (or the valid Tcl boolean equivalent) then the value of the widget will not change and the -invalidcommand will be evaluated if it is set. If it returns 1, then value will be changed. See VALIDATION below for more information.
Must be a proper list value. If specified, the spinbox will use these values as to control its contents, starting with the first value. This option has precedence over the -from and -to range.
Specifies an integer value indicating the desired width of the spinbox window, in average-size characters of the widget's font. If the value is negative or zero, the widget picks a size just large enough to hold its current text.
Must be a proper boolean value. If on, the spinbox will wrap around the values of data in the widget.
type TButtonWidget ¶ added in v0.11.0
type TButtonWidget struct {
*Window
}
TButtonWidget represents the Tcl/Tk ttk_button widget/window
func TButton ¶ added in v0.2.0
func TButton(options ...Opt) *TButtonWidget
TButton — Widget that issues a command when pressed
Description ¶
A ttk::button widget displays a textual label and/or image, and evaluates a command when pressed.
Use Window.TButton to create a TButton with a particular parent.
More information might be available at the Tcl/Tk ttk_button page.
Standard options ¶
Widget specific options ¶
A script to evaluate when the widget is invoked.
May be set to one of normal, active, or disabled. In a dialog box, one button may be designated the button (meaning, roughly, active indicates that this is currently the default button; normal means that it may become the default button, and disabled means that it is not defaultable. The default is normal.
Standard styles ¶
Ttk::button widgets support the Toolbutton style in all standard themes, which is useful for creating widgets for toolbars.
In the Aqua theme there are several other styles which can be used to produce replicas of many of the different button types that are discussed in Apple's Human Interface Guidelines. These include DisclosureButton, DisclosureTriangle, HelpButton, ImageButton, InlineButton, GradientButton, RoundedRectButton, and RecessedButton.
Styling options ¶
The class name for a ttk::button is TButton.
Dynamic states: active, disabled, pressed, readonly.
TButton styling options configurable with ttk::style are:
- Anchor anchor
- Background color
- Bordercolor color
- Compound compound
- Darkcolor color
- Foreground color
- Font font
- Highlightcolor color
- Highlightthickness amount
- Lightcolor color
- Padding padding
- Relief relief
- Shiftrelief amount
- Width amount
Some options are only available for specific themes.
See the ttk::style manual page for information on how to configure ttk styles.
func TExit ¶ added in v0.5.18
func TExit(options ...Opt) *TButtonWidget
TExit provides a canned TButton with default Txt "Exit", bound to the ExitHandler.
Use Window.TExit to create a TExit with a particular parent.
func (*TButtonWidget) Invoke ¶ added in v0.44.0
func (w *TButtonWidget) Invoke() string
TButton — Widget that issues a command when pressed
Description ¶
Invokes the command associated with the button.
Additional information might be available at the Tcl/Tk ttk::button page.
type TCheckbuttonWidget ¶ added in v0.11.0
type TCheckbuttonWidget struct {
}TCheckbuttonWidget represents the Tcl/Tk ttk_checkbutton widget/window
func TCheckbutton ¶ added in v0.2.0
func TCheckbutton(options ...Opt) *TCheckbuttonWidget
TCheckbutton — On/off widget
Description ¶
A ttk::checkbutton widget is used to show or change a setting. It has two states, selected and deselected. The state of the checkbutton may be linked to a Tcl variable.
Use Window.TCheckbutton to create a TCheckbutton with a particular parent.
More information might be available at the Tcl/Tk ttk_checkbutton page.
Standard options ¶
Widget specific options ¶
A Tcl script to execute whenever the widget is invoked.
The value to store in the associated -variable when the widget is deselected. Defaults to 0.
The value to store in the associated -variable when the widget is selected. Defaults to 1.
The name of a global variable whose value is linked to the widget. Defaults to the widget pathname if not specified.
Standard styles ¶
Ttk::checkbutton widgets support the Toolbutton style in all standard themes, which is useful for creating widgets for toolbars.
Styling options ¶
The class name for a ttk::checkbutton is TCheckbutton.
Dynamic states: active, alternate, disabled, pressed, selected, readonly.
TCheckbutton styling options configurable with ttk::style are:
- Background color
- Compound compound
- Foreground color
- Indicatorbackground color
- Indicatorcolor color
- Indicatormargin padding
- Indicatorrelief relief
- Padding padding
Some options are only available for specific themes.
See the ttk::style manual page for information on how to configure ttk styles.
func (*TCheckbuttonWidget) Invoke ¶ added in v0.32.0
func (w *TCheckbuttonWidget) Invoke() string
ttk::checkbutton — On/off widget
Description ¶
Toggles between the selected and deselected states and evaluates the associated -command. If the widget is currently selected, sets the -variable to the -offvalue and deselects the widget; otherwise, sets the -variable to the -onvalue. Returns the result of the -command.
More information might be available at the Tcl/Tk TCheckbutton page.
type TComboboxWidget ¶ added in v0.11.0
type TComboboxWidget struct {
*Window
}
TComboboxWidget represents the Tcl/Tk ttk_combobox widget/window
func TCombobox ¶ added in v0.2.0
func TCombobox(options ...Opt) *TComboboxWidget
TCombobox — Text field with popdown selection list
Description ¶
A ttk::combobox combines a text field with a pop-down list of values; the user may select the value of the text field from among the values in the list.
Use Window.TCombobox to create a TCombobox with a particular parent.
More information might be available at the Tcl/Tk ttk_combobox page.
Standard options ¶
Widget specific options ¶
Boolean value. If set, the widget selection is linked to the X selection.
Specifies how the text is aligned within the widget. Must be one of left, center, or right.
Specifies the height of the pop-down listbox, in rows.
A Tcl script to evaluate immediately before displaying the listbox. The -postcommand script may specify the -values to display.
One of normal, readonly, or disabled. In the readonly state, the value may not be edited directly, and the user can only select one of the -values from the dropdown list. In the normal state, the text field is directly editable. In the disabled state, no interaction is possible.
Specifies the name of a global variable whose value is linked to the widget value. Whenever the variable changes value the widget value is updated, and vice versa.
Specifies the list of values to display in the drop-down listbox.
Specifies an integer value indicating the desired width of the entry window, in average-size characters of the widget's font.
Styling options ¶
The class name for a ttk::combobox is TCombobox. The ttk::combobox uses the entry and listbox widgets internally. The listbox frame has a class name of ComboboxPopdownFrame.
Dynamic states: disabled, focus, pressed, readonly.
TCombobox styling options configurable with ttk::style are:
- Arrowcolor color
- Arrowsize amount
- Background color
- Bordercolor color
- Darkcolor color
- Focusfill color
- Foreground color
- Fieldbackground color
- Insertcolor color
- Insertwidth amount
- Lightcolor color
- Padding padding
- Placeholderforeground color
- Postoffset padding
- Selectbackground color
- Selectforeground color
The ttk::combobox popdown listbox cannot be configured using ttk::style nor via the widget configure command. The listbox can be configured using the option database.
option add *TCombobox*Listbox.background color option add *TCombobox*Listbox.font font option add *TCombobox*Listbox.foreground color option add *TCombobox*Listbox.selectBackground color option add *TCombobox*Listbox.selectForeground color
To configure a specific listbox (subject to future change):
ComboboxPopdownFrame styling options configurable with ttk::style are:
- Borderwidth amount
- Relief relief
Some options are only available for specific themes.
See the ttk::style manual page for information on how to configure ttk styles.
func (*TComboboxWidget) Current ¶ added in v0.53.0
func (w *TComboboxWidget) Current(newIndex any) (r string)
ttk::combobox — text field with popdown selection list
Description ¶
If newIndex is supplied, sets the combobox value to the element at position newIndex in the list of -values (in addition to integers, the end index is supported and indicates the last element of the list, moreover the same simple interpretation as for the command string index is supported, with simple integer index arithmetic and indexing relative to end). Otherwise, returns the index of the current value in the list of -values or {} if the current value does not appear in the list.
More information might be available at the Tcl/Tk combobox page.
type TEntryWidget ¶ added in v0.11.0
type TEntryWidget struct {
*Window
}
TEntryWidget represents the Tcl/Tk ttk_entry widget/window
func TEntry ¶ added in v0.2.0
func TEntry(options ...Opt) *TEntryWidget
TEntry — Editable text field widget
Description ¶
An ttk::entry widget displays a one-line text string and allows that string to be edited by the user. The value of the string may be linked to a Tcl variable with the -textvariable option. Entry widgets support horizontal scrolling with the standard -xscrollcommand option and xview widget command.
Use Window.TEntry to create a TEntry with a particular parent.
More information might be available at the Tcl/Tk ttk_entry page.
Standard options ¶
Widget specific options ¶
A boolean value specifying whether or not a selection in the widget should be linked to the X selection. If the selection is exported, then selecting in the widget deselects the current X selection, selecting outside the widget deselects any widget selection, and the widget will respond to selection retrieval requests when it has a selection.
A script template to evaluate whenever the -validatecommand returns 0. See VALIDATION below for more information.
Specifies how the text is aligned within the entry widget. One of left, center, or right.
If this option is specified, then the true contents of the entry are not displayed in the window. Instead, each character in the entry's value will be displayed as the first character in the value of this option, such as or a bullet. This is useful, for example, if the entry is to be used to enter a password. If characters in the entry are selected and copied elsewhere, the information copied will be what is displayed, not the true contents of the entry.
Compatibility option; see ttk::widget(n) for details. Specifies one of three states for the entry, normal, disabled, or readonly. See WIDGET STATES, below.
Specifies the name of a global variable whose value is linked to the entry widget's contents. Whenever the variable changes value, the widget's contents are updated, and vice versa.
Specifies the mode in which validation should operate: none, focus, focusin, focusout, key, or all. Default is none, meaning that validation is disabled. See VALIDATION below.
A script template to evaluate whenever validation is triggered. If set to the empty string (the default), validation is disabled. The script must return a boolean value. See VALIDATION below.
Specifies an integer value indicating the desired width of the entry window, in average-size characters of the widget's font.
Styling options ¶
The class name for a ttk::entry is TEntry.
Dynamic states: disabled, focus, readonly.
TEntry styling options configurable with ttk::style are:
- Background color
- Bordercolor color
- Darkcolor color
- Fieldbackground color
- Foreground color
- Insertcolor color
- Insertwidth amount
- Lightcolor color
- Padding padding
- Placeholderforeground color
- Relief relief
- Selectbackground color
- Selectborderwidth amount
- Selectforeground color
See the ttk::style manual page for information on how to configure ttk styles.
func (*TEntryWidget) Icursor ¶ added in v0.58.0
func (w *TEntryWidget) Icursor(index any) (r string)
TEntry — Editable text field widget
Description ¶
Arrange for the insertion cursor to be displayed just before the character given by index. Returns an empty string.
More information might be available at the Tcl/Tk ttk_entry page.
type TFrameWidget ¶ added in v0.11.0
type TFrameWidget struct {
*Window
}
TFrameWidget represents the Tcl/Tk ttk_frame widget/window
func TFrame ¶ added in v0.2.0
func TFrame(options ...Opt) *TFrameWidget
TFrame — Simple container widget
Description ¶
A ttk::frame widget is a container, used to group other widgets together.
Use Window.TFrame to create a TFrame with a particular parent.
More information might be available at the Tcl/Tk ttk_frame page.
Standard options ¶
Widget specific options ¶
The desired width of the widget border. Defaults to 0. May be ignored depending on the theme used.
One of the standard Tk border styles: flat, groove, raised, ridge, solid, or sunken. Defaults to flat.
If specified, the widget's requested width in pixels.
If specified, the widget's requested height in pixels.
Styling options ¶
The class name for a ttk::frame is TFrame.
TFrame styling options configurable with ttk::style are:
- Background color
- Relief relief
Some options are only available for specific themes.
See the ttk::style manual page for information on how to configure ttk styles.
type TLabelWidget ¶ added in v0.11.0
type TLabelWidget struct {
*Window
}
TLabelWidget represents the Tcl/Tk ttk_label widget/window
func TLabel ¶ added in v0.2.0
func TLabel(options ...Opt) *TLabelWidget
TLabel — Display a text string and/or image
Description ¶
A ttk::label widget displays a textual label and/or image. The label may be linked to a Tcl variable to automatically change the displayed text.
Use Window.TLabel to create a TLabel with a particular parent.
More information might be available at the Tcl/Tk ttk_label page.
Standard options ¶
- Anchor
- Class
- Compound
- Cursor
- Foreground
- Image
- Justify
- Padding
- State
- Style
- Takefocus
- Textvariable
- Txt
- Underline
- Width
- Wraplength
Widget specific options ¶
The widget's background color. If unspecified, the theme default is used.
Specifies the 3-D effect desired for the widget border. Valid values are flat, groove, raised, ridge, solid, and sunken.
Specifies the maximum line length (in pixels). If this option is negative or zero, then automatic wrapping is not performed; otherwise the text is split into lines such that no line is longer than the specified value.
Styling options ¶
The class name for a ttk::label is TLabel.
Dynamic states: disabled, readonly.
TLabel styling options configurable with ttk::style are:
- Background color
- Compound compound
- Foreground color
- Font font
Some options are only available for specific themes.
See the ttk::style manual page for information on how to configure ttk styles.
type TLabelframeWidget ¶ added in v0.11.0
type TLabelframeWidget struct {
*Window
}
TLabelframeWidget represents the Tcl/Tk ttk_labelframe widget/window
func TLabelframe ¶ added in v0.2.0
func TLabelframe(options ...Opt) *TLabelframeWidget
TLabelframe — Container widget with optional label
Description ¶
A ttk::labelframe widget is a container used to group other widgets together. It has an optional label, which may be a plain text string or another widget.
Use Window.TLabelframe to create a TLabelframe with a particular parent.
More information might be available at the Tcl/Tk ttk_labelframe page.
Standard options ¶
Widget specific options ¶
If specified, the widget's requested height in pixels. (See ttk::frame(n) for further notes on -width and -height).
Specifies where to place the label. Allowed values are (clockwise from the top upper left corner): nw, n, ne, en, e, es, se, s,sw, ws, w and wn. The default value is theme-dependent.
The name of a widget to use for the label. If set, overrides the -text option. The -labelwidget must be a child of the labelframe widget or one of the labelframe's ancestors, and must belong to the same top-level widget as the labelframe.
Specifies the text of the label.
If set, specifies the integer index (0-based) of a character to underline in the text string. The underlined character is used for mnemonic activation. Mnemonic activation for a ttk::labelframe sets the keyboard focus to the first child of the ttk::labelframe widget.
If specified, the widget's requested width in pixels.
Styling options ¶
The class name for a ttk::labelframe is TLabelframe. The text label has a class of TLabelframe.Label.
Dynamic states: disabled, readonly.
TLabelframe styling options configurable with ttk::style are:
- Background color
- Bordercolor color
- Borderwidth amount
- Darkcolor color
- Labelmargins amount
- Labeloutside boolean
- Lightcolor color
- Relief relief
TLabelframe.Label styling options configurable with ttk::style are:
- Background color
- Font font
- Foreground color
Some options are only available for specific themes.
See the ttk::style manual page for information on how to configure ttk styles.
type TMenubuttonWidget ¶ added in v0.11.0
type TMenubuttonWidget struct {
}TMenubuttonWidget represents the Tcl/Tk ttk_menubutton widget/window
func TMenubutton ¶ added in v0.2.0
func TMenubutton(options ...Opt) *TMenubuttonWidget
TMenubutton — Widget that pops down a menu when pressed
Description ¶
A ttk::menubutton widget displays a textual label and/or image, and displays a menu when pressed.
Use Window.TMenubutton to create a TMenubutton with a particular parent.
More information might be available at the Tcl/Tk ttk_menubutton page.
Standard options ¶
Widget specific options ¶
Specifies where the menu is to be popped up relative to the menubutton. One of: above, below, left, right, or flush. The default is below. flush pops the menu up directly over the menubutton.
Specifies the path name of the menu associated with the menubutton. To be on the safe side, the menu ought to be a direct child of the menubutton.
Standard styles ¶
Ttk::menubutton widgets support the Toolbutton style in all standard themes, which is useful for creating widgets for toolbars.
Styling options ¶
The class name for a ttk::menubutton is TMenubutton.
Dynamic states: active, disabled, readonly.
TMenubutton styling options configurable with ttk::style are:
- Arrowsize amount
- Background color
- Compound compound
- Foreground color
- Font font
- Padding padding
- Relief relief
- Width amount
Some options are only available for specific themes.
See the ttk::style manual page for information on how to configure ttk styles.
type TNotebookWidget ¶ added in v0.11.0
type TNotebookWidget struct {
*Window
}
TNotebookWidget represents the Tcl/Tk ttk_notebook widget/window
func TNotebook ¶ added in v0.2.0
func TNotebook(options ...Opt) *TNotebookWidget
TNotebook — Multi-paned container widget
Description ¶
A ttk::notebook widget manages a collection of windows and displays a single one at a time. Each content window is associated with a tab, which the user may select to change the currently-displayed window.
Use Window.TNotebook to create a TNotebook with a particular parent.
More information might be available at the Tcl/Tk ttk_notebook page.
Standard options ¶
Widget specific options ¶
If present and greater than zero, specifies the desired height of the pane area (not including internal padding or tabs). Otherwise, the maximum height of all panes is used.
Specifies the amount of extra space to add around the outside of the notebook. The padding is a list of up to four length specifications left top right bottom. If fewer than four elements are specified, bottom defaults to top, right defaults to left, and top defaults to left. In other words, a list of three numbers specify the left, vertical, and right padding; a list of two numbers specify the horizontal and the vertical padding; a single number specifies the same padding all the way around the widget.
If present and greater than zero, specifies the desired width of the pane area (not including internal padding). Otherwise, the maximum width of all panes is used.
Styling options ¶
The class name for a ttk::notebook is TNotebook. The tab has a class name of TNotebook.Tab
Dynamic states: active, disabled, selected.
TNotebook styling options configurable with ttk::style are:
- Background color
- Bordercolor color
- Darkcolor color
- Foreground color
- Lightcolor color
- Padding padding
- Tabmargins padding
- Tabposition position
TNotebook.Tab styling options configurable with ttk::style are:
- Background color
- Bordercolor color
- Compound compound
- Expand padding
- Font font
- Foreground color
- Padding padding
Some options are only available for specific themes.
See the ttk::style manual page for information on how to configure ttk styles.
func (*TNotebookWidget) Add ¶ added in v0.30.0
func (w *TNotebookWidget) Add(options ...Opt)
ttk::notebook — Multi-paned container widget
Description ¶
Adds a new tab to the notebook. See TAB OPTIONS for the list of available options. If window is currently managed by the notebook but hidden, it is restored to its previous position.
More information might be available at the Tcl/Tk TNotebook page.
func (*TNotebookWidget) Select ¶ added in v0.31.0
func (w *TNotebookWidget) Select(tabid any) string
TNotebook — Multi-paned container widget
Description ¶
Selects the specified tab. The associated content window will be displayed, and the previously-selected window (if different) is unmapped. If tabid is omitted, returns the widget name of the currently selected pane.
More information might be available at the Tcl/Tk TNotebook page.
func (*TNotebookWidget) Tabs ¶ added in v0.32.0
func (w *TNotebookWidget) Tabs() (r []*Window)
TNotebook — Multi-paned container widget
Description ¶
Returns the list of windows managed by the notebook, in the index order of their associated tabs.
More information might be available at the Tcl/Tk TNotebook page.
type TPanedwindowWidget ¶ added in v0.11.0
type TPanedwindowWidget struct {
*Window
}
TPanedwindowWidget represents the Tcl/Tk ttk_panedwindow widget/window
func TPanedwindow ¶ added in v0.2.0
func TPanedwindow(options ...Opt) *TPanedwindowWidget
TPanedwindow — Multi-pane container window
Description ¶
A ttk::panedwindow widget displays a number of subwindows, stacked either vertically or horizontally. The user may adjust the relative sizes of the subwindows by dragging the sash between panes.
Use Window.TPanedwindow to create a TPanedwindow with a particular parent.
More information might be available at the Tcl/Tk ttk_panedwindow page.
Standard options ¶
Widget specific options ¶
Specifies the orientation of the window. If vertical, subpanes are stacked top-to-bottom; if horizontal, subpanes are stacked left-to-right.
If present and greater than zero, specifies the desired width of the widget in pixels. Otherwise, the requested width is determined by the width of the managed windows.
If present and greater than zero, specifies the desired height of the widget in pixels. Otherwise, the requested height is determined by the height of the managed windows.
Styling options ¶
The class name for a ttk::panedwindow is TPanedwindow. The sash has a class name of Sash.
TPanedwindow styling options configurable with ttk::style are:
- Background color
Sash styling options configurable with ttk::style are:
- Background color
- Bordercolor color
- Gripsize size (number of screen units)
- Handlepad amount
- Handlesize amount
- Lightcolor color
- Sashpad amount
- Sashrelief relief
- Sashthickness amount
Some options are only available for specific themes.
See the ttk::style manual page for information on how to configure ttk styles.
func (*TPanedwindowWidget) Add ¶ added in v0.41.0
func (w *TPanedwindowWidget) Add(subwindow *Window, options ...Opt)
ttk::panedwindow — Multi-pane container window
Description ¶
Adds a new pane to the window. See PANE OPTIONS for the list of available options.
More information might be available at the Tcl/Tk ttk_panedwindow page.
type TProgressbarWidget ¶ added in v0.11.0
type TProgressbarWidget struct {
*Window
}
TProgressbarWidget represents the Tcl/Tk ttk_progressbar widget/window
func TProgressbar ¶ added in v0.2.0
func TProgressbar(options ...Opt) *TProgressbarWidget
TProgressbar — Provide progress feedback
Description ¶
A ttk::progressbar widget shows the status of a long-running operation. They can operate in two modes: determinate mode shows the amount completed relative to the total amount of work to be done, and indeterminate mode provides an animated display to let the user know that something is happening.
If the value of -orient is horizontal a text string can be displayed inside the progressbar. This string can be configured using the -anchor, -font, -foreground, -justify, is vertical then these options are ignored.
Use Window.TProgressbar to create a TProgressbar with a particular parent.
More information might be available at the Tcl/Tk ttk_progressbar page.
Standard options ¶
Widget specific options ¶
Specifies the length of the long axis of the progress bar (width if horizontal, height if vertical). The value may have any of the forms acceptable to Tk_GetPixels.
A floating point number specifying the maximum -value. Defaults to 100.
One of determinate or indeterminate.
One of horizontal or vertical. Specifies the orientation of the progress bar.
Read-only option. The widget periodically increments the value of this option whenever the -value is greater than 0 and, in determinate mode, less than -maximum. This option may be used by the current theme to provide additional animation effects.
The current value of the progress bar. In determinate mode, this represents the amount of work completed. In indeterminate mode, it is interpreted modulo -maximum; that is, the progress bar completes one when the -value increases by -maximum. If -variable is set to an existing variable, specifying -value has no effect (the variable value takes precedence).
The name of a global Tcl variable which is linked to the -value. If specified to an existing variable, the -value of the progress bar is automatically set to the value of the variable whenever the latter is modified.
Styling options ¶
The class name for a ttk::progressbar is TProgressbar.
TProgressbar styling options configurable with ttk::style are:
- Background color
- Bordercolor color
- Darkcolor color
- Lightcolor color
- Maxphase
- Period
- Troughcolor color
Some options are only available for specific themes.
See the ttk::style manual page for information on how to configure ttk styles.
func (*TProgressbarWidget) Start ¶ added in v0.61.0
func (w *TProgressbarWidget) Start(interval ...time.Duration)
ttk::progressbar — Provide progress feedback
Description ¶
Begin autoincrement mode: schedules a recurring timer event that calls step every interval milliseconds. If omitted, interval defaults to 50 milliseconds (20 steps/second).
More information might be available at the Tcl/Tk progressbar page.
func (*TProgressbarWidget) Step ¶ added in v0.61.0
func (w *TProgressbarWidget) Step(amount ...float64)
ttk::progressbar — Provide progress feedback
Description ¶
Increments the -value by amount. amount defaults to 1.0 if omitted.
More information might be available at the Tcl/Tk progressbar page.
func (*TProgressbarWidget) Stop ¶ added in v0.61.0
func (w *TProgressbarWidget) Stop()
ttk::progressbar — Provide progress feedback
Description ¶
Stop autoincrement mode: cancels any recurring timer event initiated by pathName start.
More information might be available at the Tcl/Tk progressbar page.
type TRadiobuttonWidget ¶ added in v0.11.0
type TRadiobuttonWidget struct {
}TRadiobuttonWidget represents the Tcl/Tk ttk_radiobutton widget/window
func TRadiobutton ¶ added in v0.2.0
func TRadiobutton(options ...Opt) *TRadiobuttonWidget
TRadiobutton — Mutually exclusive option widget
Description ¶
ttk::radiobutton widgets are used in groups to show or change a set of mutually-exclusive options. Radiobuttons are linked to a Tcl variable, and have an associated value; when a radiobutton is clicked, it sets the variable to its associated value.
Use Window.TRadiobutton to create a TRadiobutton with a particular parent.
More information might be available at the Tcl/Tk ttk_radiobutton page.
Standard options ¶
Widget specific options ¶
A Tcl script to evaluate whenever the widget is invoked.
The value to store in the associated -variable when the widget is selected.
The name of a global variable whose value is linked to the widget. Default value is ::selectedButton.
Standard styles ¶
Ttk::radiobutton widgets support the Toolbutton style in all standard themes, which is useful for creating widgets for toolbars.
Styling options ¶
The class name for a ttk::radiobutton is TRadiobutton.
Dynamic states: active, alternate, disabled, pressed, readonly, selected.
TRadiobutton styling options configurable with ttk::style are:
- Background color
- Compound compound
- Foreground color
- Indicatorbackground color
- Indicatorcolor color
- Indicatormargin padding
- Indicatorrelief relief
- Padding padding
Some options are only available for specific themes.
See the ttk::style manual page for information on how to configure ttk styles.
type TScaleWidget ¶ added in v0.11.0
type TScaleWidget struct {
*Window
}
TScaleWidget represents the Tcl/Tk ttk_scale widget/window
func TScale ¶ added in v0.2.0
func TScale(options ...Opt) *TScaleWidget
TScale — Create and manipulate a scale widget
Description ¶
A ttk::scale widget is typically used to control the numeric value of a linked variable that varies uniformly over some range. A scale displays a slider that can be moved along over a trough, with the relative position of the slider over the trough indicating the value of the variable.
Use Window.TScale to create a TScale with a particular parent.
More information might be available at the Tcl/Tk ttk_scale page.
Standard options ¶
Widget specific options ¶
Specifies the prefix of a Tcl command to invoke whenever the scale's value is changed via a widget command. The actual command consists of this option followed by a space and a real number indicating the new value of the scale.
A real value corresponding to the left or top end of the scale.
Specifies the desired long dimension of the scale in screen units (i.e. any of the forms acceptable to Tk_GetPixels). For vertical scales this is the scale's height; for horizontal scales it is the scale's width.
Specifies which orientation whether the widget should be laid out horizontally or vertically. Must be either horizontal or vertical or an abbreviation of one of these.
Specifies a real value corresponding to the right or bottom end of the scale. This value may be either less than or greater than the -from option.
Specifies the current floating-point value of the variable. If -variable is set to an existing variable, specifying -value has no effect (the variable value takes precedence).
Specifies the name of a global variable to link to the scale. Whenever the value of the variable changes, the scale will update to reflect this value. Whenever the scale is manipulated interactively, the variable will be modified to reflect the scale's new value.
Styling options ¶
The class name for a ttk::scale is TScale.
Dynamic states: active.
TScale styling options configurable with ttk::style are:
- Background color
- Borderwidth amount
- Darkcolor color
- Groovewidth amount
- Lightcolor color
- Sliderwidth amount
- Troughcolor color
- Troughrelief relief
Some options are only available for specific themes.
See the ttk::style manual page for information on how to configure ttk styles.
func (*TScaleWidget) Get ¶ added in v0.53.0
func (w *TScaleWidget) Get(xy ...any) (r string)
ttk::scale — Create and manipulate a scale widget
Description ¶
Get the current value of the -value option, or the value corresponding to the coordinates x,y if they are specified. X and y are pixel coordinates relative to the scale widget origin.
More information might be available at the Tcl/Tk scale page.
type TScrollbarWidget ¶ added in v0.11.0
type TScrollbarWidget struct {
*Window
}
TScrollbarWidget represents the Tcl/Tk ttk_scrollbar widget/window
func TScrollbar ¶ added in v0.2.0
func TScrollbar(options ...Opt) *TScrollbarWidget
TScrollbar — Control the viewport of a scrollable widget
Description ¶
ttk::scrollbar widgets are typically linked to an associated window that displays a document of some sort, such as a file being edited or a drawing. A scrollbar displays a thumb in the middle portion of the scrollbar, whose position and size provides information about the portion of the document visible in the associated window. The thumb may be dragged by the user to control the visible region. Depending on the theme, two or more arrow buttons may also be present; these are used to scroll the visible region in discrete units.
Use Window.TScrollbar to create a TScrollbar with a particular parent.
More information might be available at the Tcl/Tk ttk_scrollbar page.
Standard options ¶
Widget specific options ¶
A Tcl script prefix to evaluate to change the view in the widget associated with the scrollbar. Additional arguments are appended to the value of this option, as described in SCROLLING COMMANDS below, whenever the user requests a view change by manipulating the scrollbar.
One of horizontal or vertical. Specifies the orientation of the scrollbar.
Styling options ¶
The class name for a ttk::scrollbar is TScrollbar.
Dynamic states: active, disabled.
TScrollbar (or more specifically Vertical.TScrollbar and Horizontal.TScrollbar) styling options that are configurable with ttk::style are:
- Arrowcolor color
- Arrowsize amount
- Background color
- Bordercolor color
- Darkcolor color (color of the dark part of the 3D relief)
- Foreground color
- Gripsize size (number of screen units)
- Lightcolor color (color of the light part of the 3D relief)
- Troughcolor color
Some options are only available for specific themes.
See the ttk::style manual page for information on how to configure ttk styles.
func (*TScrollbarWidget) Set ¶ added in v0.16.2
func (w *TScrollbarWidget) Set(firstLast string)
TScrollbar — Control the viewport of a scrollable widget
Description ¶
This command is normally invoked by the scrollbar's associated widget from an -xscrollcommand or -yscrollcommand callback. Specifies the visible range to be displayed. first and last are real fractions between 0 and 1.
More information might be available at the Tcl/Tk ttk_scrollbar page.
type TSeparatorWidget ¶ added in v0.11.0
type TSeparatorWidget struct {
*Window
}
TSeparatorWidget represents the Tcl/Tk ttk_separator widget/window
func TSeparator ¶ added in v0.2.0
func TSeparator(options ...Opt) *TSeparatorWidget
TSeparator — Separator bar
Description ¶
A ttk::separator widget displays a horizontal or vertical separator bar.
Use Window.TSeparator to create a TSeparator with a particular parent.
More information might be available at the Tcl/Tk ttk_separator page.
Standard options ¶
Widget specific options ¶
One of horizontal or vertical. Specifies the orientation of the separator.
Styling options ¶
The class name for a ttk::separator is TSeparator.
TSeparator styling options configurable with ttk::style are:
- Background color
Some options are only available for specific themes.
See the ttk::style manual page for information on how to configure ttk styles.
type TSizegripWidget ¶ added in v0.11.0
type TSizegripWidget struct {
*Window
}
TSizegripWidget represents the Tcl/Tk ttk_sizegrip widget/window
func TSizegrip ¶ added in v0.2.0
func TSizegrip(options ...Opt) *TSizegripWidget
TSizegrip — Bottom-right corner resize widget
Description ¶
A ttk::sizegrip widget (also known as a grow box) allows the user to resize the containing toplevel window by pressing and dragging the grip.
Use Window.TSizegrip to create a TSizegrip with a particular parent.
More information might be available at the Tcl/Tk ttk_sizegrip page.
Standard options ¶
Styling options ¶
The class name for a ttk::sizegrip is TSizegrip.
TSizegrip styling options configurable with ttk::style are:
- Background color
Some options are only available for specific themes.
See the ttk::style manual page for information on how to configure ttk styles.
type TSpinboxWidget ¶ added in v0.11.0
type TSpinboxWidget struct {
*Window
}
TSpinboxWidget represents the Tcl/Tk ttk_spinbox widget/window
func TSpinbox ¶ added in v0.2.0
func TSpinbox(options ...Opt) *TSpinboxWidget
TSpinbox — Selecting text field widget
Description ¶
A ttk::spinbox widget is a ttk::entry widget with built-in up and down buttons that are used to either modify a numeric value or to select among a set of values. The widget implements all the features of the ttk::entry widget including support of the to a Tcl variable.
Use Window.TSpinbox to create a TSpinbox with a particular parent.
More information might be available at the Tcl/Tk ttk_spinbox page.
Standard options ¶
- Class
- Cursor
- Placeholder
- Placeholderforeground
- State
- Style
- Takefocus
- Validate
- Validatecommand
- Xscrollcommand
Widget specific options ¶
Specifies a Tcl command to be invoked whenever a spinbutton is invoked.
Specifies an alternate format to use when setting the string value when using the -from and -to range. This must be a format specifier of the form %<pad>.<pad>f, as it will format a floating-point number.
A floating-point value specifying the lowest value for the spinbox. This is used in conjunction with -to and -increment to set a numerical range.
A floating-point value specifying the change in value to be applied each time one of the widget spin buttons is pressed. The up button applies a positive increment, the down button applies a negative increment.
A floating-point value specifying the highest permissible value for the widget. See also -from and -increment. range.
This must be a Tcl list of values. If this option is set then this will override any range set using the -from, -to and -increment options. The widget will instead use the values specified beginning with the first value.
Must be a proper boolean value. If on, the spinbox will wrap around the values of data in the widget.
Styling options ¶
The class name for a ttk::spinbox is TSpinbox.
Dynamic states: active, disabled, focus, readonly.
TSpinbox styling options configurable with ttk::style are:
- Arrowcolor color
- Arrowsize amount
- Background color
- Bordercolor color
- Darkcolor color
- Fieldbackground color
- Foreground color
- Insertcolor color
- Insertwidth amount
- Lightcolor color
- Padding padding
- Placeholderforeground color
- Selectbackground color
- Selectforeground color
Some options are only available for specific themes.
See the ttk::style manual page for information on how to configure ttk styles.
type TTreeviewWidget ¶ added in v0.11.0
type TTreeviewWidget struct {
*Window
}
TTreeviewWidget represents the Tcl/Tk ttk_treeview widget/window
func TTreeview ¶ added in v0.2.0
func TTreeview(options ...Opt) *TTreeviewWidget
TTreeview — Hierarchical multicolumn data display widget
Description ¶
The ttk::treeview widget displays a hierarchical collection of items. Each item has a textual label, an optional image, and an optional list of data values. The data values are displayed in successive columns after the tree label.
The order in which data values are displayed may be controlled by setting the -displaycolumns widget option. The tree widget can also display column headings. Columns may be accessed by number or by symbolic names listed in the -columns widget option; see COLUMN IDENTIFIERS.
Each item is identified by a unique name. The widget will generate item IDs if they are not supplied by the caller. There is a distinguished root item, named {}. The root item itself is not displayed; its children appear at the top level of the hierarchy.
Each item also has a list of tags, which can be used to associate event bindings with individual items and control the appearance of the item.
Treeview widgets support horizontal and vertical scrolling with the standard -[xy]scrollcommand options and [xy]view widget commands.
Use Window.TTreeview to create a TTreeview with a particular parent.
More information might be available at the Tcl/Tk ttk_treeview page.
Standard options ¶
Widget specific options ¶
A list of column identifiers, specifying the number of columns and their names.
A list of column identifiers (either symbolic names or integer indices) specifying which data columns are displayed and the order in which they appear, or the string #all. If set to #all (the default), all columns are shown in the order given.
Specifies the number of rows which should be visible. Note that the requested width is determined from the sum of the column widths.
Controls how the built-in class bindings manage the selection. One of extended, browse, or none.
Controls how the built-in class bindings manage the selection. One of item or cell.
A list containing zero or more of the following values, specifying which elements of the tree to display.
Boolean specifying zebra striped item coloring. Note that striped items uses the -stripedbackground option if set by the theme or a tag. If not supported by the current theme, it will not show.
Number of display columns at the left that should not be scrolled. The tree column counts, even if -show tree is not specified. Thus for value N of this option, column #N is the first one that is scrollable. Default is 0.
Number of items at the top that should not be vertically scrolled. Default is 0.
Styling options ¶
The class name for a ttk::treeview is Treeview. The treeview header class name is Heading. The treeview item class name is Item. The treeview cell class name is Cell.
Dynamic states: disabled, selected.
Treeview styling options configurable with ttk::style are:
- Background color
- Fieldbackground color
- Font font
- Foreground color
- Indent amount
- Columnseparatorwidth amount
- Rowheight amount
- Stripedbackground color
Heading styling options configurable with ttk::style are:
- Background color
- Font font
- Relief relief
Item styling options configurable with ttk::style are:
- Foreground color
- Indicatormargins padding
- Indicatorsize amount
- Padding padding
Cell styling options configurable with ttk::style are:
- Padding padding
Some options are only available for specific themes.
See the ttk::style manual page for information on how to configure ttk styles.
func (*TTreeviewWidget) Children ¶ added in v0.58.0
func (w *TTreeviewWidget) Children(item any, newChildren ...any) (r []string)
ttk::treeview — hierarchical multicolumn data display widget
Description ¶
If newchildren is not specified, returns the list of children belonging to item.
If newchildren is specified, replaces item's child list with newchildren. Items in the old child list not present in the new child list are detached from the tree. None of the items in newchildren may be an ancestor of item.
More information might be available at the Tcl/Tk treeview page.
func (*TTreeviewWidget) Column ¶ added in v0.53.0
func (w *TTreeviewWidget) Column(column any, options ...Opt) (r string)
ttk::treeview — hierarchical multicolumn data display widget
Description ¶
Query or modify the options for the specified column. If no -option is specified, returns a dictionary of option/value pairs. If a single -option is specified, returns the value of that option. Otherwise, the options are updated with the specified values. The following options may be set on each column:
- id name: The column name. This is a read-only option. For example, [$pathname column #n -id] returns the data column associated with display column n. The tree column has -id #0.
- anchor anchor: Specifies how the text in this column should be aligned with respect to the cell. Anchor is one of n, ne, e, se, s, sw, w, nw, or center.
- minwidth minwidth: The minimum width of the column in pixels. The treeview widget will not make the column any smaller than -minwidth when the widget is resized or the user drags a heading column separator. Default is 20 pixels.
- separator boolean: Specifies whether or not a column separator should be drawn to the right of the column. Default is false.
- stretch boolean: Specifies whether or not the column width should be adjusted when the widget is resized or the user drags a heading column separator. Boolean may have any of the forms accepted by Tcl_GetBoolean. By default columns are stretchable. -width width: The width of the column in pixels. Default is 200 pixels. The specified column width may be changed by Tk in order to honor -stretch and/or -minwidth, or when the widget is resized or the user drags a heading column separator.
Use pathname "#0" to configure the tree column.
More information might be available at the Tcl/Tk treeview page.
func (*TTreeviewWidget) Delete ¶ added in v0.57.0
func (w *TTreeviewWidget) Delete(itemList ...any)
ttk::treeview — hierarchical multicolumn data display widget
Description ¶
Deletes each of the items in itemList and all of their descendants. The root item may not be deleted. See also: detach.
More information might be available at the Tcl/Tk treeview page.
func (*TTreeviewWidget) Focus ¶ added in v0.59.0
func (w *TTreeviewWidget) Focus(item ...any) (r string)
ttk::treeview — hierarchical multicolumn data display widget
Description ¶
If item is specified, sets the focus item to item. Otherwise, returns the current focus item, or {} if there is none.
More information might be available at the Tcl/Tk treeview page.
func (*TTreeviewWidget) Heading ¶ added in v0.53.0
func (w *TTreeviewWidget) Heading(column any, options ...Opt) (r string)
ttk::treeview — hierarchical multicolumn data display widget
Description ¶
Query or modify the heading options for the specified column. Valid options are:
- text text: The text to display in the column heading.
- image imageName: Specifies an image to display to the right of the column heading.
- anchor anchor: Specifies how the heading text should be aligned. One of the standard Tk anchor values.
- command script: A script to evaluate when the heading label is pressed.
Use pathname heading "#0" to configure the tree column heading.
More information might be available at the Tcl/Tk treeview page.
func (*TTreeviewWidget) IdentifyCell ¶ added in v0.57.0
func (w *TTreeviewWidget) IdentifyCell(x, y int) (r []string)
ttk::treeview — hierarchical multicolumn data display widget
Description ¶
Returns the cell identifier of the cell at position x, y. A cell identifier is a list of item ID and column ID.
More information might be available at the Tcl/Tk treeview page.
func (*TTreeviewWidget) IdentifyColumn ¶ added in v0.57.0
func (w *TTreeviewWidget) IdentifyColumn(x, y int) (r string)
ttk::treeview — hierarchical multicolumn data display widget
Description ¶
Returns the display column identifier of the cell at position x. The tree column has ID #0.
More information might be available at the Tcl/Tk treeview page.
func (*TTreeviewWidget) IdentifyElement ¶ added in v0.57.0
func (w *TTreeviewWidget) IdentifyElement(x, y int) (r string)
ttk::treeview — hierarchical multicolumn data display widget
Description ¶
Returns the element at position x, y.
More information might be available at the Tcl/Tk treeview page.
func (*TTreeviewWidget) IdentifyItem ¶ added in v0.57.0
func (w *TTreeviewWidget) IdentifyItem(x, y int) (r string)
ttk::treeview — hierarchical multicolumn data display widget
Description ¶
Returns the item ID of the item at position x y.
More information might be available at the Tcl/Tk treeview page.
func (*TTreeviewWidget) IdentifyRegion ¶ added in v0.57.0
func (w *TTreeviewWidget) IdentifyRegion(x, y int) (r string)
ttk::treeview — hierarchical multicolumn data display widget
Description ¶
Returns one of:
heading
Tree heading area; use [pathname identify column x y] to determine the heading number.
separator
Space between two column headings; [pathname identify column x y] will return the display column identifier of the heading to left of the separator.
tree
The tree area.
cell
A data cell.
More information might be available at the Tcl/Tk treeview page.
func (*TTreeviewWidget) Index ¶ added in v0.57.0
func (w *TTreeviewWidget) Index(item any) (r int)
ttk::treeview — hierarchical multicolumn data display widget
Description ¶
Returns the integer index of item within its parent's list of children or -1 otherwise.
More information might be available at the Tcl/Tk treeview page.
func (*TTreeviewWidget) Insert ¶ added in v0.53.0
func (w *TTreeviewWidget) Insert(parent, index any, options ...Opt) (r string)
ttk::treeview — hierarchical multicolumn data display widget
Description ¶
Creates a new item. parent is the item ID of the parent item, or the empty string {} to create a new top-level item. index is an integer, or the value end, specifying where in the list of parent's children to insert the new item. If index is negative or zero, the new node is inserted at the beginning; if index is greater than or equal to the current number of children, it is inserted at the end. If -id is specified, it is used as the item identifier; id must not already exist in the tree. Otherwise, a new unique identifier is generated.
Insert returns the item identifier of the newly created item. See ITEM OPTIONS for the list of available options.
More information might be available at the Tcl/Tk treeview page.
func (*TTreeviewWidget) Item ¶ added in v0.53.0
func (w *TTreeviewWidget) Item(item any, options ...any) (r string)
ttk::treeview — hierarchical multicolumn data display widget
Description ¶
Query or modify the options for the specified item. If no -option is specified, returns a dictionary of option/value pairs. If a single -option is specified, returns the value of that option. Otherwise, the item's options are updated with the specified values. See ITEM OPTIONS for the list of available options. pathname move item parent index
More information might be available at the Tcl/Tk treeview page.
func (*TTreeviewWidget) Parent ¶ added in v0.57.0
func (w *TTreeviewWidget) Parent(item any) (r string)
ttk::treeview — hierarchical multicolumn data display widget
Description ¶
Returns the ID of the parent of item, or "" if item is at the top level of the hierarchy.
More information might be available at the Tcl/Tk treeview page.
func (*TTreeviewWidget) See ¶ added in v0.53.0
func (w *TTreeviewWidget) See(item any)
ttk::treeview — hierarchical multicolumn data display widget
Description ¶
Ensure that item is visible: sets all of item's ancestors to -open true, and scrolls the widget if necessary so that item is within the visible portion of the tree.
More information might be available at the Tcl/Tk treeview page.
func (*TTreeviewWidget) Selection ¶ added in v0.53.0
func (w *TTreeviewWidget) Selection(selop string, itemList ...any) (r []string)
ttk::treeview — hierarchical multicolumn data display widget
Description ¶
Manages item selection. Item selection is independent from cell selection handled by the cellselection command. If selop is not specified, returns the list of selected items. Otherwise, selop is one of the following:
- set itemList: itemList becomes the new selection.
- add itemList: Add itemList to the selection.
- remove itemList: Remove itemList from the selection.
- toggle itemList: Toggle the selection state of each item in itemList.
More information might be available at the Tcl/Tk treeview page.
func (*TTreeviewWidget) TagAdd ¶ added in v0.59.0
func (w *TTreeviewWidget) TagAdd(tag string, items ...any)
ttk::treeview — hierarchical multicolumn data display widget
Description ¶
Adds the specified tag to each of the listed items. If tag is already present for a particular item, then the -tags for that item are unchanged.
More information might be available at the Tcl/Tk treeview page.
func (*TTreeviewWidget) TagConfigure ¶ added in v0.59.0
func (w *TTreeviewWidget) TagConfigure(tag string, options ...any) (r string)
ttk::treeview — hierarchical multicolumn data display widget
Description ¶
Query or modify the options for the specified tagName. If one or more option/value pairs are specified, sets the value of those options for the specified tag. If a single option is specified, returns the value of that option (or the empty string if the option has not been specified for tagName). With no additional arguments, returns a dictionary of the option settings for tagName. See TAG OPTIONS for the list of available options.
More information might be available at the Tcl/Tk treeview page.
type TextWidget ¶ added in v0.11.0
type TextWidget struct {
*Window
}
TextWidget represents the Tcl/Tk text widget/window
func Text ¶ added in v0.2.0
func Text(options ...Opt) *TextWidget
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
The text command creates a new window (given by the pathName argument) and makes it into a text widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the text such as its default background color and relief. The text command returns the path name of the new window.
A text widget displays one or more lines of text and allows that text to be edited. Text widgets support four different kinds of annotations on the text, called tags, marks, embedded windows or embedded images. Tags allow different portions of the text to be displayed with different fonts and colors. In addition, Tcl commands can be associated with tags so that scripts are invoked when particular actions such as keystrokes and mouse button presses occur in particular ranges of the text. See TAGS below for more details.
The second form of annotation consists of floating markers in the text called marks . Marks are used to keep track of various interesting positions in the text as it is edited. See MARKS below for more details.
The third form of annotation allows arbitrary windows to be embedded in a text widget. See EMBEDDED WINDOWS below for more details.
The fourth form of annotation allows Tk images to be embedded in a text widget. See EMBEDDED IMAGES below for more details.
The text widget also has a built-in undo/redo mechanism. See THE UNDO MECHANISM below for more details.
The text widget allows for the creation of peer widgets. These are other text widgets which share the same underlying data (text, marks, tags, images, etc). See PEER WIDGETS below for more details.
Use Window.Text to create a Text with a particular parent.
More information might be available at the Tcl/Tk text page.
Standard options ¶
- Background
- Borderwidth
- Cursor
- Exportselection
- Foreground
- Highlightbackground
- Highlightcolor
- Highlightthickness
- Insertbackground
- Insertborderwidth
- Insertofftime
- Insertontime
- Insertwidth
- Padx
- Pady
- Relief
- Selectbackground
- Selectborderwidth
- Selectforeground
- Setgrid
- Takefocus
- Xscrollcommand
- Yscrollcommand
Widget specific options ¶
Specifies a boolean that says whether separators are automatically inserted in the undo stack. Only meaningful when the -undo option is true.
Specifies a boolean that says whether the blinking insertion cursor should be drawn as a character-sized rectangular block. If false (the default) a thin vertical line is used for the insertion cursor.
Specifies an integer line index representing the line of the underlying textual data store that should be just after the last line contained in the widget. This allows a text widget to reflect only a portion of a larger piece of text. Instead of an integer, the empty string can be provided to this configuration option, which will configure the widget to end at the very last line in the textual data store.
Specifies the desired height for the window, in units of characters in the font given by the -font option. Must be at least one.
Specifies the colour to use for the selection (the sel tag) when the window does not have the input focus. If empty, {}, then no selection is shown when the window does not have the focus.
Specifies how to display the insertion cursor when the widget does not have the focus. Must be none (the default) which means to not display the cursor, hollow which means to display a hollow box, or solid which means to display a solid box. Note that hollow and solid will appear very similar when the -blockcursor option is false.
Specifies the maximum number of compound undo actions on the undo stack. A zero or a negative value imply an unlimited undo stack.
Requests additional space above each text line in the widget, using any of the standard forms for screen distances. If a line wraps, this option only applies to the first line on the display. This option may be overridden with -spacing1 options in tags.
For lines that wrap (so that they cover more than one line on the display) this option specifies additional space to provide between the display lines that represent a single line of text. The value may have any of the standard forms for screen distances. This option may be overridden with -spacing2 options in tags.
Requests additional space below each text line in the widget, using any of the standard forms for screen distances. If a line wraps, this option only applies to the last line on the display. This option may be overridden with -spacing3 options in tags.
Specifies an integer line index representing the first line of the underlying textual data store that should be contained in the widget. This allows a text widget to reflect only a portion of a larger piece of text. Instead of an integer, the empty string can be provided to this configuration option, which will configure the widget to start at the very first line in the textual data store.
Specifies one of two states for the text: normal or disabled. If the text is disabled then characters may not be inserted or deleted and no insertion cursor will be displayed, even if the input focus is in the widget.
Specifies a set of tab stops for the window. The option's value consists of a list of screen distances giving the positions of the tab stops, each of which is a distance relative to the left edge of the widget (excluding borders, padding, etc). Each position may optionally be followed in the next list element by one of the keywords left, right, center, or numeric, which specifies how to justify text relative to the tab stop. Left is the default; it causes the text following the tab character to be positioned with its left edge at the tab position. Right means that the right edge of the text following the tab character is positioned at the tab position, and center means that the text is centered at the tab position. Numeric means that the decimal point in the text is positioned at the tab position; if there is no decimal point then the least significant digit of the number is positioned just to the left of the tab position; if there is no number in the text then the text is right-justified at the tab position. For example, creates three tab stops at two-centimeter intervals; the first two use left justification and the third uses center justification.
Specifies how to interpret the relationship between tab stops on a line and tabs in the text of that line. The value must be tabular (the default) or wordprocessor. Note that tabs are interpreted as they are encountered in the text. If the tab style is tabular then the n'th tab character in the line's text will be associated with the n'th tab stop defined for that line. If the tab character's x coordinate falls to the right of the n'th tab stop, then a gap of a single space will be inserted as a fallback. If the tab style is wordprocessor then any tab character being laid out will use (and be defined by) the first tab stop to the right of the preceding characters already laid out on that line. The value of the -tabstyle option may be overridden by -tabstyle options in tags.
Specifies a boolean that says whether the undo mechanism is active or not.
Specifies the desired width for the window in units of characters in the font given by the -font option. If the font does not have a uniform width then the width of the character is used in translating from character units to screen units.
Specifies how to handle lines in the text that are too long to be displayed in a single line of the text's window. The value must be none or char or word. A wrap mode of none means that each line of text appears as exactly one line on the screen; extra characters that do not fit on the screen are not displayed. In the other modes each line of text will be broken up into several screen lines if necessary to keep all the characters visible. In char mode a screen line break may occur after any character; in word mode a line break will only be made at word boundaries.
func (*TextWidget) Clear ¶ added in v0.38.0
func (w *TextWidget) Clear()
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Clear makes 'w' empty.
func (*TextWidget) Copy ¶ added in v0.32.0
func (w *TextWidget) Copy()
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Copies the selection in the widget to the clipboard, if there is a selection.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) Count ¶ added in v0.48.0
func (w *TextWidget) Count(options ...any) []string
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Counts the number of relevant things between the two indices. If index1 is after index2, the result will be a negative number (and this holds for each of the possible options). The actual items which are counted depend on the options given. The result is a list of integers, one for the result of each counting option given. Valid counting options are -chars, -displaychars, -displayindices, -displaylines, -indices, -lines, -xpixels and -ypixels. The default value, if no option is specified, is -indices. There is an additional possible option -update which is a modifier. If given (and if the text widget is managed by a geometry manager), then all subsequent options ensure that any possible out of date information is recalculated. This currently only has any effect for the -ypixels count (which, if -update is not given, will use the text widget's current cached value for each line). This -update option is obsoleted by pathName sync, pathName pendingsync and <<WidgetViewSync>>. The count options are interpreted as follows:
- Chars Count all characters, whether elided or not. Do not count embedded windows or images.
- Displaychars Count all non-elided characters.
- Displayindices Count all non-elided characters, windows and images.
- Displaylines Count all display lines (i.e. counting one for each time a line wraps) from the line of the first index up to, but not including the display line of the second index. Therefore if they are both on the same display line, zero will be returned. By definition displaylines are visible and therefore this only counts portions of actual visible lines.
- Indices Count all characters and embedded windows or images (i.e. everything which counts in text-widget index space), whether they are elided or not.
- Lines Count all logical lines (irrespective of wrapping) from the line of the first index up to, but not including the line of the second index. Therefore if they are both on the same line, zero will be returned. Logical lines are counted whether they are currently visible (non-elided) or not.
- Xpixels Count the number of horizontal pixels from the first pixel of the first index to (but not including) the first pixel of the second index. To count the total desired width of the text widget (assuming wrapping is not enabled), first find the longest line and then use “.text count -xpixels "${line}.0" "${line}.0 lineend"”.
- Ypixels Count the number of vertical pixels from the first pixel of the first index to (but not including) the first pixel of the second index. If both indices are on the same display line, zero will be returned. To count the total number of vertical pixels in the text widget, use “.text count -ypixels 1.0 end”, and to ensure this is up to date, use “.text count -update -ypixels 1.0 end”.
The command returns a positive or negative integer corresponding to the number of items counted between the two indices. One such integer is returned for each counting option given, so a list is returned if more than one option was supplied. For example “.text count -xpixels -ypixels 1.3 4.5” is perfectly valid and will return a list of two elements.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) Cut ¶ added in v0.32.0
func (w *TextWidget) Cut()
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Copies the selection in the widget to the clipboard and deletes the selection. If there is no selection in the widget then these keys have no effect.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) Delete ¶ added in v0.37.0
func (w *TextWidget) Delete(options ...any)
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Delete a range of characters from the text. If both index1 and index2 are specified, then delete all the characters starting with the one given by index1 and stopping just before index2 (i.e. the character at index2 is not deleted). If index2 does not specify a position later in the text than index1 then no characters are deleted. If index2 is not specified then the single character at index1 is deleted. Attempts to delete characters in a way that would leave the text without a newline as the last character will be tweaked by the text widget to avoid this. In particular, deletion of complete lines of text up to the end of the text will also delete the newline character just before the deleted block so that it is replaced by the new final newline of the text widget. The command returns an empty string. If more indices are given, multiple ranges of text will be deleted. All indices are first checked for validity before any deletions are made. They are sorted and the text is removed from the last range to the first range so deleted text does not cause an undesired index shifting side-effects. If multiple ranges with the same start index are given, then the longest range is used. If overlapping ranges are given, then they will be merged into spans that do not cause deletion of text outside the given ranges due to text shifted during deletion.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) EditReset ¶ added in v0.47.0
func (w *TextWidget) EditReset()
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Clears the undo and redo stacks.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) Get ¶ added in v0.30.3
func (w *TextWidget) Get(options ...any) (r []string)
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Return a range of characters from the text. The return value will be all the characters in the text starting with the one whose index is index1 and ending just before the one whose index is index2 (the character at index2 will not be returned). If index2 is omitted then the single character at index1 is returned. If there are no characters in the specified range (e.g. index1 is past the end of the file or index2 is less than or equal to index1) then an empty string is returned. If the specified range contains embedded windows, no information about them is included in the returned string. If multiple index pairs are given, multiple ranges of text will be returned in a list. Invalid ranges will not be represented with empty strings in the list. The ranges are returned in the order passed to pathName get. If the -displaychars option is given, then, within each range, only those characters which are not elided will be returned. This may have the effect that some of the returned ranges are empty strings.
BUG(jnml) TextWidget.Get currently supports only one range.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) ImageCreate ¶ added in v0.36.0
func (w *TextWidget) ImageCreate(index any, options ...Opt)
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
This command creates a new image annotation, which will appear in the text at the position given by index. Any number of option-value pairs may be specified to configure the annotation. Returns a unique identifier that may be used as an index to refer to this image. See EMBEDDED IMAGES for information on the options that are supported, and a description of the identifier returned.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) Index ¶ added in v0.43.0
func (w *TextWidget) Index(index any) (r string)
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Returns the position corresponding to index in the form line.char where line is the line number and char is the character number. Index may have any of the forms described under INDICES above.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) Insert ¶ added in v0.11.0
func (w *TextWidget) Insert(index any, chars string, options ...string) any
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Inserts all of the chars arguments just before the character at index. If index refers to the end of the text (the character after the last newline) then the new text is inserted just before the last newline instead. If there is a single chars argument and no tagList, then the new text will receive any tags that are present on both the character before and the character after the insertion point; if a tag is present on only one of these characters then it will not be applied to the new text. If tagList is specified then it consists of a list of tag names; the new characters will receive all of the tags in this list and no others, regardless of the tags present around the insertion point. If multiple chars-tagList argument pairs are present, they produce the same effect as if a separate pathName insert widget command had been issued for each pair, in order. The last tagList argument may be omitted.
The value that is passed to Tcl/Tk for the 'index' argument is obtained by fmt.Sprint(index), enabling any custom index encoding via implementing fmt.Stringer.
Indices ¶
Many of the widget commands for texts take one or more indices as arguments. An index is a string used to indicate a particular place within a text, such as a place to insert characters or one endpoint of a range of characters to delete. Indices have the syntax
base modifier modifier modifier ...
Where base gives a starting point and the modifiers adjust the index from the starting point (e.g. move forward or backward one character). Every index must contain a base, but the modifiers are optional. Most modifiers (as documented below) allow an optional submodifier. Valid submodifiers are any and display. If the submodifier is abbreviated, then it must be followed by whitespace, but otherwise there need be no space between the submodifier and the following modifier. Typically the display submodifier adjusts the meaning of the following modifier to make it refer to visual or non-elided units rather than logical units, but this is explained for each relevant case below. Lastly, where count is used as part of a modifier, it can be positive or negative, so “base - -3 lines” is perfectly valid (and equivalent to “base +3lines”).
The base for an index must have one of the following forms:
"line.char"
Indicates char'th character on line line. Lines are numbered from 1 for consistency with other UNIX programs that use this numbering scheme. Within a line, characters are numbered from 0. If char is end then it refers to the newline character that ends the line.
This form of index can be passed as LC{line, char}.
"@x,y"
Indicates the character that covers the pixel whose x and y coordinates within the text's window are x and y.
"end"
Indicates the end of the text (the character just after the last newline).
"mark"
Indicates the character just after the mark whose name is mark (see MARKS for details).
"tag.first"
Indicates the first character in the text that has been tagged with tag. This form generates an error if no characters are currently tagged with tag.
"tag.last"
Indicates the character just after the last one in the text that has been tagged with tag. This form generates an error if no characters are currently tagged with tag.
"pathName"
Indicates the position of the embedded window whose name is pathName. This form generates an error if there is no embedded window by the given name.
"imageName"
Indicates the position of the embedded image whose name is imageName. This form generates an error if there is no embedded image by the given name.
If the base could match more than one of the above forms, such as a mark and imageName both having the same value, then the form earlier in the above list takes precedence. If modifiers follow the base index, each one of them must have one of the forms listed below. Keywords such as chars and wordend may be abbreviated as long as the abbreviation is unambiguous.
"+ count ?submodifier? chars"
Adjust the index forward by count characters, moving to later lines in the text if necessary. If there are fewer than count characters in the text after the current index, then set the index to the last index in the text. Spaces on either side of count are optional. If the display submodifier is given, elided characters are skipped over without being counted. If any is given, then all characters are counted. For historical reasons, if neither modifier is given then the count actually takes place in units of index positions (see INDICES for details). This behaviour may be changed in a future major release, so if you need an index count, you are encouraged to use indices instead wherever possible.
"- count ?submodifier? chars"
Adjust the index backward by count characters, moving to earlier lines in the text if necessary. If there are fewer than count characters in the text before the current index, then set the index to the first index in the text (1.0). Spaces on either side of count are optional. If the display submodifier is given, elided characters are skipped over without being counted. If any is given, then all characters are counted. For historical reasons, if neither modifier is given then the count actually takes place in units of index positions (see INDICES for details). This behavior may be changed in a future major release, so if you need an index count, you are encouraged to use indices instead wherever possible.
"+ count ?submodifier? indices"
Adjust the index forward by count index positions, moving to later lines in the text if necessary. If there are fewer than count index positions in the text after the current index, then set the index to the last index position in the text. Spaces on either side of count are optional. Note that an index position is either a single character or a single embedded image or embedded window. If the display submodifier is given, elided indices are skipped over without being counted. If any is given, then all indices are counted; this is also the default behaviour if no modifier is given.
"- count ?submodifier? indices"
Adjust the index backward by count index positions, moving to earlier lines in the text if necessary. If there are fewer than count index positions in the text before the current index, then set the index to the first index position (1.0) in the text. Spaces on either side of count are optional. If the display submodifier is given, elided indices are skipped over without being counted. If any is given, then all indices are counted; this is also the default behaviour if no modifier is given.
"+ count ?submodifier? lines"
Adjust the index forward by count lines, retaining the same character position within the line. If there are fewer than count lines after the line containing the current index, then set the index to refer to the same character position on the last line of the text. Then, if the line is not long enough to contain a character at the indicated character position, adjust the character position to refer to the last character of the line (the newline). Spaces on either side of count are optional. If the display submodifier is given, then each visual display line is counted separately. Otherwise, if any (or no modifier) is given, then each logical line (no matter how many times it is visually wrapped) counts just once. If the relevant lines are not wrapped, then these two methods of counting are equivalent.
"- count ?submodifier? lines"
Adjust the index backward by count logical lines, retaining the same character position within the line. If there are fewer than count lines before the line containing the current index, then set the index to refer to the same character position on the first line of the text. Then, if the line is not long enough to contain a character at the indicated character position, adjust the character position to refer to the last character of the line (the newline). Spaces on either side of count are optional. If the display submodifier is given, then each visual display line is counted separately. Otherwise, if any (or no modifier) is given, then each logical line (no matter how many times it is visually wrapped) counts just once. If the relevant lines are not wrapped, then these two methods of counting are equivalent.
"?submodifier? linestart"
Adjust the index to refer to the first index on the line. If the display submodifier is given, this is the first index on the display line, otherwise on the logical line.
"?submodifier? lineend"
Adjust the index to refer to the last index on the line (the newline). If the display submodifier is given, this is the last index on the display line, otherwise on the logical line.
"?submodifier? wordstart"
Adjust the index to refer to the first character of the word containing the current index. A word consists of any number of adjacent characters that are letters, digits, or underscores, or a single character that is not one of these. If the display submodifier is given, this only examines non-elided characters, otherwise all characters (elided or not) are examined.
"?submodifier? wordend"
Adjust the index to refer to the character just after the last one of the word containing the current index. If the current index refers to the last character of the text then it is not modified. If the display submodifier is given, this only examines non-elided characters, otherwise all characters (elided or not) are examined.
If more than one modifier is present then they are applied in left-to-right order. For example, the index “end - 1 chars” refers to the next-to-last character in the text and “insert wordstart - 1 c” refers to the character just before the first one in the word containing the insertion cursor. Modifiers are applied one by one in this left to right order, and after each step the resulting index is constrained to be a valid index in the text widget. So, for example, the index “1.0 -1c +1c” refers to the index “2.0”.
Where modifiers result in index changes by display lines, display chars or display indices, and the base refers to an index inside an elided tag, that base index is considered to be equivalent to the first following non-elided index.
Insert returns its index argument.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) InsertML ¶ added in v0.17.0
func (w *TextWidget) InsertML(list ...any)
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
InsertML inserts 'ml' at the end of 'w', interpreting it as a HTML-like markup language.
It recognizes and treats accordingly the <br> tag.
The <img> tag is reserved for embedded images. You can inline the image directly:
InsertML("Hello", NewPhoto(...), Align("top"), "world!")
The <embed> tag is reserved for embedded widgets. You can inline a widget directly:
InsertML("Hello", Button(Txt("Foo")), Align("center"), "world!")
The <pre> tag works similarly to HTML, ie. white space and line breaks are kept. To make the content of a <pre> rendered in monospace, configure the tag, for example:
t.TagConfigure("pre", Font(CourierFont(), 10)
Other ML-tags are used as names of configured 'w' tags, if configured, ignored otherwise.
Example usage in _examples/embed.go.
func (*TextWidget) MarkGravity ¶ added in v0.45.0
func (w *TextWidget) MarkGravity(markName, direction string)
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
If direction is not specified, returns left or right to indicate which of its adjacent characters markName is attached to. If direction is specified, it must be left or right; the gravity of markName is set to the given value.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) MarkNames ¶ added in v0.45.0
func (w *TextWidget) MarkNames() []string
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Returns a list whose elements are the names of all the marks that are currently set.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) MarkSet ¶ added in v0.44.0
func (w *TextWidget) MarkSet(markName string, index any)
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Sets the mark named markName to a position just before the character at index. If markName already exists, it is moved from its old position; if it does not exist, a new mark is created. This command returns an empty string.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) MarkUnset ¶ added in v0.45.0
func (w *TextWidget) MarkUnset(markName ...string)
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Remove the mark corresponding to each of the markName arguments. The removed marks will not be usable in indices and will not be returned by future calls to “pathName mark names”. This command returns an empty string.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) Modified ¶ added in v0.41.0
func (w *TextWidget) Modified() bool
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Returns the modified flag of the widget. The insert, delete, edit undo and edit redo commands or the user can set or clear the modified flag.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) Paste ¶ added in v0.32.0
func (w *TextWidget) Paste()
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Inserts the contents of the clipboard at the position of the insertion cursor.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) Redo ¶ added in v0.31.0
func (w *TextWidget) Redo()
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
When the -undo option is true, reapplies the last undone edits provided no other edits were done since then, and returns a list of indices indicating what ranges were changed by the redo operation. Generates an error when the redo stack is empty. Does nothing when the -undo option is false.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) Search ¶ added in v0.44.0
func (w *TextWidget) Search(options ...any) string
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Searches the text in pathName starting at index for a range of characters that matches pattern. If a match is found, the index of the first character in the match is returned as result; otherwise an empty string is returned. One or more of the following switches (or abbreviations thereof) may be specified to control the search:
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) See ¶ added in v0.43.0
func (w *TextWidget) See(index any)
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Adjusts the view in the window so that the character given by index is completely visible. If index is already visible then the command does nothing. If index is a short distance out of view, the command adjusts the view just enough to make index visible at the edge of the window. If index is far out of view, then the command centers index in the window.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) SelectAll ¶ added in v0.41.0
func (w *TextWidget) SelectAll()
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Select all text in 'w'.
func (*TextWidget) SetModified ¶ added in v0.41.0
func (w *TextWidget) SetModified(v bool)
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Sets the modified flag of the widget to 'v'.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) TagAdd ¶ added in v0.11.0
func (w *TextWidget) TagAdd(tagName string, indexes ...any) string
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Associate the tag name with all of the characters starting with index1 and ending just before index2 (the character at index2 is not tagged). A single command may contain any number of index1-index2 pairs. If the last index2 is omitted then the single character at index1 is tagged. If there are no characters in the specified range (e.g. index1 is past the end of the file or index2 is less than or equal to index1) then the command has no effect.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) TagBind ¶ added in v0.40.0
func (w *TextWidget) TagBind(tag, sequence string, handler any) string
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
This command associates a script with the tag given by tagName. Whenever the event sequence given by sequence occurs for a character that has been tagged with tagName, the script will be invoked. This widget command is similar to the bind command except that it operates on characters in a text rather than entire widgets. See the bind manual entry for complete details on the syntax of sequence and the substitutions performed on script before invoking it. A new binding is created, replacing any existing binding for the same sequence and tagName. The only events for which bindings may be specified are those related to the mouse and keyboard (such as Enter, Leave, Button, Motion, and Key) or virtual events. Mouse and keyboard event bindings for a text widget respectively use the current and insert marks described under MARKS above. An Enter event triggers for a tag when the tag first becomes present on the current character, and a Leave event triggers for a tag when it ceases to be present on the current character. Enter and Leave events can happen either because the current mark moved or because the character at that position changed. Note that these events are different than Enter and Leave events for windows. Mouse events are directed to the current character, while keyboard events are directed to the insert character. If a virtual event is used in a binding, that binding can trigger only if the virtual event is defined by an underlying mouse-related or keyboard-related event.
It is possible for the current character to have multiple tags, and for each of them to have a binding for a particular event sequence. When this occurs, one binding is invoked for each tag, in order from lowest-priority to highest priority. If there are multiple matching bindings for a single tag, then the most specific binding is chosen (see the manual entry for the bind command for details). continue and break commands within binding scripts are processed in the same way as for bindings created with the bind command.
If bindings are created for the widget as a whole using the bind command, then those bindings will supplement the tag bindings. The tag bindings will be invoked first, followed by bindings for the window as a whole.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) TagConfigure ¶ added in v0.11.0
func (w *TextWidget) TagConfigure(tagName string, options ...Opt)
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
This command is similar to the pathName configure widget command except that it modifies options associated with the tag given by tagName instead of modifying options for the overall text widget. If no option is specified, the command returns a list describing all of the available options for tagName (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given option(s) to have the given value(s) in tagName; in this case the command returns an empty string. See TAGS above for details on the options available for tags.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) TagDelete ¶ added in v0.38.0
func (w *TextWidget) TagDelete(tags ...string)
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Deletes all tag information for each of the tagName arguments. The command removes the tags from all characters in the file and also deletes any other information associated with the tags, such as bindings and display information. The command returns an empty string.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) TagNames ¶ added in v0.38.0
func (w *TextWidget) TagNames(index string) []string
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Returns a list whose elements are the names of all the tags that are active at the character position given by index. If index is omitted, then the return value will describe all of the tags that exist for the text (this includes all tags that have been named in a “pathName tag” widget command but have not been deleted by a “pathName tag delete” widget command, even if no characters are currently marked with the tag). The list will be sorted in order from lowest priority to highest priority.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) TagRanges ¶ added in v0.51.0
func (w *TextWidget) TagRanges(tagName string) (r []string)
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Returns a list describing all of the ranges of text that have been tagged with tagName. The first two elements of the list describe the first tagged range in the text, the next two elements describe the second range, and so on. The first element of each pair contains the index of the first character of the range, and the second element of the pair contains the index of the character just after the last one in the range. If there are no characters tagged with tag then an empty string is returned.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) TagRemove ¶ added in v0.62.0
func (w *TextWidget) TagRemove(tagName string, indexes ...any) string
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Remove the tag tagName from all of the characters starting at index1 and ending just before index2 (the character at index2 is not affected). A single command may contain any number of index1-index2 pairs. If the last index2 is omitted then the tag is removed from the single character at index1. If there are no characters in the specified range (e.g. index1 is past the end of the file or index2 is less than or equal to index1) then the command has no effect. This command returns an empty string.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) Text ¶ added in v0.31.0
func (w *TextWidget) Text() string
Text is a shortcut for w.Get("1.0", "end-1c")[0].
func (*TextWidget) Undo ¶ added in v0.31.0
func (w *TextWidget) Undo()
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Undoes the last edit action when the -undo option is true, and returns a list of indices indicating what ranges were changed by the undo operation. An edit action is defined as all the insert and delete commands that are recorded on the undo stack in between two separators. Generates an error when the undo stack is empty. Does nothing when the -undo option is false.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) WindowCreate ¶ added in v0.36.0
func (w *TextWidget) WindowCreate(index any, options ...Opt)
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
This command creates a new window annotation, which will appear in the text at the position given by index. Any number of option-value pairs may be specified to configure the annotation. See EMBEDDED WINDOWS for information on the options that are supported. Returns an empty string.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) Xview ¶ added in v0.17.0
func (w *TextWidget) Xview() string
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Returns a list containing two elements, both of which are real fractions between 0 and 1. The first element gives the position of the first visible pixel of the first character (or image, etc) in the top line in the window, relative to the text as a whole (0.5 means it is halfway through the text, for example). The second element gives the position of the first pixel just after the last visible one in the bottom line of the window, relative to the text as a whole. These are the same values passed to scrollbars via the -xscrollcommand option.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) Yview ¶ added in v0.16.2
func (w *TextWidget) Yview() string
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Returns a list containing two elements, both of which are real fractions between 0 and 1. The first element gives the position of the first visible pixel of the first character (or image, etc) in the top line in the window, relative to the text as a whole (0.5 means it is halfway through the text, for example). The second element gives the position of the first pixel just after the last visible one in the bottom line of the window, relative to the text as a whole. These are the same values passed to scrollbars via the -yscrollcommand option.
Additional information might be available at the Tcl/Tk text page.
func (*TextWidget) Yviewmoveto ¶ added in v0.43.0
func (w *TextWidget) Yviewmoveto(fraction any) string
Text — Create and manipulate 'text' hypertext editing widgets
Description ¶
Adjusts the view in the window so that the pixel given by fraction appears at the top of the top line of the window. Fraction is a fraction between 0 and 1; 0 indicates the first pixel of the first character in the text, 0.33 indicates the pixel that is one-third the way through the text; and so on. Values close to 1 will indicate values close to the last pixel in the text (1 actually refers to one pixel beyond the last pixel), but in such cases the widget will never scroll beyond the last pixel, and so a value of 1 will effectively be rounded back to whatever fraction ensures the last pixel is at the bottom of the window, and some other pixel is at the top.
Additional information might be available at the Tcl/Tk text page.
type Theme ¶ added in v0.53.0
type Theme interface { // Activate makes the theme active/in use. The Activate method of themes in // Themes automatically call Initialize if it was not called before. Activate(context ThemeContext) error // Deactivate makes the theme not active. Deactivate cannot be called before // Activate(). Deactivate(context ThemeContext) error // Finalize is called to perform any cleanup. After Finalize returns, the theme // cannot be used. The Finalize method of themes in Themes automatically remove // the theme from Themes after Finalize completes. Finalize(context ThemeContext) error // Initialize is called to perform any one-time initialization of a theme. The // Initialize method of themes in Themes can be called multiple times but only // the first successful call to Initialize will have any effect. Initialize(context ThemeContext) error }
Theme provides handling of a Tk theme. When calling Theme methods registered in Theme, the context argument is ignored and an instance is created automatically.
func CurrentTheme ¶ added in v0.53.0
func CurrentTheme() Theme
CurrentTheme returns the currently activated theme, if any.
type ThemeContext ¶ added in v0.53.0
ThemeContext provides context to Theme methods.
type ToplevelWidget ¶ added in v0.11.0
type ToplevelWidget struct {
*Window
}
ToplevelWidget represents the Tcl/Tk toplevel widget/window
func Toplevel ¶ added in v0.2.0
func Toplevel(options ...Opt) *ToplevelWidget
Toplevel — Create and manipulate 'toplevel' main and popup window widgets
Description ¶
The toplevel command creates a new toplevel widget (given by the pathName argument). Additional options, described above, may be specified on the command line or in the option database to configure aspects of the toplevel such as its background color and relief. The toplevel command returns the path name of the new window.
A toplevel is similar to a frame except that it is created as a top-level window: its X parent is the root window of a screen rather than the logical parent from its Tk path name. The primary purpose of a toplevel is to serve as a container for dialog boxes and other collections of widgets. The only visible features of a toplevel are its background and an optional 3-D border to make the toplevel appear raised or sunken.
Use Window.Toplevel to create a Toplevel with a particular parent.
More information might be available at the Tcl/Tk toplevel page.
Standard options ¶
Widget specific options ¶
This option is the same as the standard -background option except that its value may also be specified as an empty string. In this case, the widget will display no background or border, and no colors will be consumed from its colormap for its background and border. An empty background will disable drawing the background image.
This specifies an image to display on the toplevel's background within the border of the toplevel (i.e., the image will be clipped by the toplevel's highlight ring and border, if either are present) on top of the background; subwidgets of the toplevel will be drawn on top. The image must have been created with the image create command. If specified as the empty string, no image will be displayed.
Specifies a class for the window. This class will be used when querying the option database for the window's other options, and it will also be used later for other purposes such as bindings. Some window managers display the class name for windows in their dock while some others display the window title. The -class option may not be changed with the configure widget command.
Specifies a colormap to use for the window. The value may be either new, in which case a new colormap is created for the window and its children, or the name of another window (which must be on the same screen and have the same visual as pathName), in which case the new window will use the colormap from the specified window. If the -colormap option is not specified, the new window uses the default colormap of its screen. This option may not be changed with the configure widget command.
The value must be a boolean. If true, it means that this window will be used as a container in which some other application will be embedded (for example, a Tk toplevel can be embedded using the -use option). The window will support the appropriate window manager protocols for things like geometry requests. The window should not have any children of its own in this application. This option may not be changed with the configure widget command.
Specifies the desired height for the window in any of the forms acceptable to Tk_GetPixels. If this option is negative or zero then the window will not request any size at all.
Specifies a menu widget to be used as a menubar. On the Macintosh, the menubar will be displayed across the top of the main monitor. On Microsoft Windows and all UNIX platforms, the menu will appear across the toplevel window as part of the window dressing maintained by the window manager.
Specifies the screen on which to place the new window. Any valid screen name may be used, even one associated with a different display. Defaults to the same screen as its parent. This option is special in that it may not be specified via the option database, and it may not be modified with the configure widget command.
This specifies how to draw the background image (see -backgroundimage) on the toplevel. If true (according to Tcl_GetBoolean), the image will be tiled to fill the whole toplevel, with the origin of the first copy of the image being the top left of the interior of the toplevel. If false (the default), the image will be centered within the toplevel.
This option is used for embedding. If the value is not an empty string, it must be the window identifier of a container window, specified as a hexadecimal string like the ones returned by the winfo id command. The toplevel widget will be created as a child of the given container instead of the root window for the screen. If the container window is in a Tk application, it must be a frame or toplevel widget for which the -container option was specified. This option may not be changed with the configure widget command.
Specifies visual information for the new window in any of the forms accepted by Tk_GetVisual. If this option is not specified, the new window will use the default visual for its screen. The -visual option may not be modified with the configure widget command.
Specifies the desired width for the window in any of the forms acceptable to Tk_GetPixels. If this option is negative or zero then the window will not request any size at all.
type VariableOpt ¶ added in v0.53.0
type VariableOpt struct {
// contains filtered or unexported fields
}
VariableOpt is an Opt linking Go and Tcl variables.
func Variable ¶ added in v0.3.0
func Variable(val any) *VariableOpt
Variable option.
Known uses:
- Checkbutton (widget specific)
- MenuWidget.AddCascade (command specific)
- MenuWidget.AddCommand (command specific)
- MenuWidget.AddSeparator (command specific)
- Radiobutton (widget specific)
- Scale (widget specific)
- TCheckbutton (widget specific)
- TProgressbar (widget specific)
- TRadiobutton (widget specific)
- TScale (widget specific)
func (*VariableOpt) Get ¶ added in v0.53.0
func (v *VariableOpt) Get() (r string)
Get return the value of the linked Tcl variable.
func (*VariableOpt) Set ¶ added in v0.53.0
func (v *VariableOpt) Set(val any)
Set sets the value of the linked Tcl variable.
type Widget ¶ added in v0.11.0
type Widget interface {
// contains filtered or unexported methods
}
Widget is implemented by every *Window
Widget implements Opt. When a Widget instance is used as an Opt, it provides its path name.
func Tooltip ¶ added in v0.49.0
tooltip — Tooltip management
Description ¶
This command arranges for widget 'w' to display a tooltip with a message.
If the specified widget is a menu, canvas, listbox, ttk::treeview, ttk::notebook or text widget then additional options are used to tie the tooltip to specific menu, canvas or listbox items, ttk::treeview items or column headings, ttk::notebook tabs, or text widget tags.
Heading columnId: This option is used to set a tooltip for a ttk::treeview column heading. The column does not need to already exist. You should not use the same identifiers for columns and items in a widget for which you are using tooltips as their tooltips will be mixed. The widget must be a ttk::treeview widget.
Image image: The specified (photo) image will be displayed to the left of the primary tooltip message.
Index index: This option is used to set a tooltip on a menu item. The index may be either the entry index or the entry label. The widget must be a menu widget but the entries do not have to exist when the tooltip is set.
Info info: The specified info text will be displayed as additional information below the primary tooltip message.
Items items: This option is used to set a tooltip for canvas, listbox or ttk::treview items. For the canvas widget, the item must already be present in the canvas and will be found with a find withtag lookup. For listbox and ttk::treview widgets the item(s) may be created later but the programmer is responsible for managing the link between the listbox or ttk::treview item index and the corresponding tooltip. If the listbox or ttk::treview items are re-ordered, the tooltips will need amending.
If the widget is not a canvas, listbox or ttk::treview then an error is raised.
Tab tabId: The -tab option can be used to set a tooltip for a ttk::notebook tab. The tab should already be present when this command is called, or an error will be returned. The widget must be a ttk::notebook widget.
Tag name: The -tag option can be used to set a tooltip for a text widget tag. The tag should already be present when this command is called, or an error will be returned. The widget must be a text widget.
"--": The -- option marks the end of options. The argument following this one will be treated as message even if it starts with a -.
Tooltip returns 'w'.
More information might be available at the Tklib tooltip page.
type Window ¶ added in v0.2.0
type Window struct {
// contains filtered or unexported fields
}
Window represents a Tk window/widget. It implements common widget methods.
Window implements Opt. When a Window instance is used as an Opt, it provides its path name.
func WinfoChildren ¶ added in v0.56.4
winfo — Return window-related information
Description ¶
Returns a slice of all the children of window. Top-level windows are returned as children of their logical parents. The list is in stacking order, with the lowest window first, except for Top-level windows which are not returned in stacking order. Use the wm stackorder command to query the stacking order of Top-level windows.
More information might be available at the Tcl/Tk winfo page.
func (*Window) Activebackground ¶ added in v0.5.18
Activebackground — Get the configured option value.
Known uses:
func (*Window) Activeborderwidth ¶ added in v0.5.18
Activeborderwidth — Get the configured option value.
Known uses:
func (*Window) Activeforeground ¶ added in v0.5.18
Activeforeground — Get the configured option value.
Known uses:
func (*Window) Activerelief ¶ added in v0.5.18
Activerelief — Get the configured option value.
Known uses:
func (*Window) Activestyle ¶ added in v0.5.18
Activestyle — Get the configured option value.
Known uses:
- Listbox (widget specific)
func (*Window) Aspect ¶ added in v0.5.18
Aspect — Get the configured option value.
Known uses:
- Message (widget specific)
func (*Window) Autoseparators ¶ added in v0.5.18
Autoseparators — Get the configured option value.
Known uses:
- Text (widget specific)
func (*Window) Background ¶ added in v0.5.18
Background — Get the configured option value.
Known uses:
- Button
- Canvas
- Checkbutton
- Entry
- Frame (widget specific)
- Label
- Labelframe (widget specific)
- Listbox
- Menu
- Menubutton
- Message
- Panedwindow
- Radiobutton
- Scale
- Scrollbar
- Spinbox
- TLabel (widget specific)
- Text
- Toplevel (widget specific)
func (*Window) Backgroundimage ¶ added in v0.5.18
Backgroundimage — Get the configured option value.
Known uses:
func (*Window) Bigincrement ¶ added in v0.5.18
Bigincrement — Get the configured option value.
Known uses:
- Scale (widget specific)
func (*Window) Blockcursor ¶ added in v0.5.18
Blockcursor — Get the configured option value.
Known uses:
- Text (widget specific)
func (*Window) Borderwidth ¶ added in v0.5.18
Borderwidth — Get the configured option value.
Known uses:
- Button
- Canvas
- Checkbutton
- Entry
- Frame
- Label
- Labelframe
- Listbox
- Menu
- Menubutton
- Message
- Panedwindow
- Radiobutton
- Scale
- Scrollbar
- Spinbox
- TFrame (widget specific)
- Text
- Toplevel
func (*Window) Busy ¶ added in v0.5.18
Busy — confine pointer events to a window sub-tree
Description ¶
The Busy command provides a simple means to block pointer events from Tk widgets, while overriding the widget's cursor with a configurable busy cursor. Note this command does not prevent keyboard events from being sent to the widgets made busy.
- Cursor cursorName
Specifies the cursor to be displayed when the widget is made busy. CursorName can be in any form accepted by Tk_GetCursor. The default cursor is wait on Windows and watch on other platforms.
More information might be available at the [Tcl/Tk busy] page.
func (*Window) BusyForget ¶ added in v0.5.18
BusyForget — undo Busy
Description ¶
Releases resources allocated by the Window.Busy command for window, including the transparent window. User events will again be received by window. Resources are also released when window is destroyed. Window must be the name of a widget specified in the hold operation, otherwise an error is reported.
More information might be available at the [Tcl/Tk busy] page.
func (*Window) Button ¶ added in v0.2.0
func (w *Window) Button(options ...Opt) *ButtonWidget
Button — Create and manipulate 'button' action widgets
The resulting Window is a child of 'w'
For details please see Button
func (*Window) Buttonbackground ¶ added in v0.5.18
Buttonbackground — Get the configured option value.
Known uses:
- Spinbox (widget specific)
func (*Window) Buttoncursor ¶ added in v0.5.18
Buttoncursor — Get the configured option value.
Known uses:
- Spinbox (widget specific)
func (*Window) Buttondownrelief ¶ added in v0.5.18
Buttondownrelief — Get the configured option value.
Known uses:
- Spinbox (widget specific)
func (*Window) Buttonuprelief ¶ added in v0.5.18
Buttonuprelief — Get the configured option value.
Known uses:
- Spinbox (widget specific)
func (*Window) Canvas ¶ added in v0.2.0
func (w *Window) Canvas(options ...Opt) *CanvasWidget
Canvas — Create and manipulate 'canvas' hypergraphics drawing surface widgets
The resulting Window is a child of 'w'
For details please see Canvas
func (*Window) Checkbutton ¶ added in v0.2.0
func (w *Window) Checkbutton(options ...Opt) *CheckbuttonWidget
Checkbutton — Create and manipulate 'checkbutton' boolean selection widgets
The resulting Window is a child of 'w'
For details please see Checkbutton
func (*Window) Class ¶ added in v0.5.18
Class — Get the configured option value.
Known uses:
- Frame (widget specific)
- Labelframe (widget specific)
- TButton
- TCheckbutton
- TCombobox
- TEntry
- TFrame
- TLabel
- TLabelframe
- TMenubutton
- TNotebook
- TPanedwindow
- TProgressbar
- TRadiobutton
- TScale
- TScrollbar
- TSeparator
- TSizegrip
- TSpinbox
- TTreeview
- Toplevel (widget specific)
func (*Window) Closeenough ¶ added in v0.5.18
Closeenough — Get the configured option value.
Known uses:
- Canvas (widget specific)
func (*Window) Colormap ¶ added in v0.5.18
Colormap — Get the configured option value.
Known uses:
- Frame (widget specific)
- Labelframe (widget specific)
- Toplevel (widget specific)
func (*Window) Columns ¶ added in v0.5.18
Columns — Get the configured option value.
Known uses:
- TTreeview (widget specific)
func (*Window) Configure ¶ added in v0.4.12
Configure alters the configuration of 'w' and returns 'w'.
func (*Window) Confine ¶ added in v0.5.18
Confine — Get the configured option value.
Known uses:
- Canvas (widget specific)
func (*Window) Container ¶ added in v0.5.18
Container — Get the configured option value.
Known uses:
func (*Window) Cursor ¶ added in v0.5.18
Cursor — Get the configured option value.
Known uses:
- Button
- Canvas
- Checkbutton
- Entry
- Frame
- Label
- Labelframe
- Listbox
- Menu
- Menubutton
- Message
- Panedwindow
- Radiobutton
- Scale
- Scrollbar
- Spinbox
- TButton
- TCheckbutton
- TCombobox
- TEntry
- TFrame
- TLabel
- TLabelframe
- TMenubutton
- TNotebook
- TPanedwindow
- TProgressbar
- TRadiobutton
- TScale
- TScrollbar
- TSeparator
- TSizegrip
- TSpinbox
- TTreeview
- Text
- Toplevel
func (*Window) Digits ¶ added in v0.5.18
Digits — Get the configured option value.
Known uses:
- Scale (widget specific)
func (*Window) Direction ¶ added in v0.5.18
Direction — Get the configured option value.
Known uses:
- Menubutton (widget specific)
- TMenubutton (widget specific)
func (*Window) Disabledbackground ¶ added in v0.5.18
Disabledbackground — Get the configured option value.
Known uses:
func (*Window) Disabledforeground ¶ added in v0.5.18
Disabledforeground — Get the configured option value.
Known uses:
- Button
- Checkbutton
- Entry (widget specific)
- Label
- Listbox
- Menu
- Menubutton
- Radiobutton
- Spinbox (widget specific)
func (*Window) Displaycolumns ¶ added in v0.5.18
Displaycolumns — Get the configured option value.
Known uses:
- TTreeview (widget specific)
func (*Window) Elementborderwidth ¶ added in v0.5.18
Elementborderwidth — Get the configured option value.
Known uses:
- Scrollbar (widget specific)
func (*Window) Endline ¶ added in v0.5.18
Endline — Get the configured option value.
Known uses:
- Text (widget specific)
func (*Window) Entry ¶ added in v0.2.0
func (w *Window) Entry(options ...Opt) *EntryWidget
Entry — Create and manipulate 'entry' one-line text entry widgets
The resulting Window is a child of 'w'
For details please see Entry
func (*Window) Exit ¶ added in v0.5.18
func (w *Window) Exit(options ...Opt) *ButtonWidget
Exit provides a canned Button with default Txt "Exit", bound to the ExitHandler.
The resulting Window is a child of 'w'
func (*Window) Exportselection ¶ added in v0.5.18
Exportselection — Get the configured option value.
Known uses:
func (*Window) Foreground ¶ added in v0.5.18
Foreground — Get the configured option value.
Known uses:
func (*Window) Frame ¶ added in v0.2.0
func (w *Window) Frame(options ...Opt) *FrameWidget
Frame — Create and manipulate 'frame' simple container widgets
The resulting Window is a child of 'w'
For details please see Frame
func (*Window) Handlepad ¶ added in v0.5.18
Handlepad — Get the configured option value.
Known uses:
- Panedwindow (widget specific)
func (*Window) Handlesize ¶ added in v0.5.18
Handlesize — Get the configured option value.
Known uses:
- Panedwindow (widget specific)
func (*Window) Height ¶ added in v0.5.18
Height — Get the configured option value.
Known uses:
- Button (widget specific)
- Canvas (widget specific)
- Checkbutton (widget specific)
- Frame (widget specific)
- Label (widget specific)
- Labelframe (widget specific)
- Listbox (widget specific)
- Menubutton (widget specific)
- Panedwindow (widget specific)
- Radiobutton (widget specific)
- TCombobox (widget specific)
- TFrame (widget specific)
- TLabelframe (widget specific)
- TNotebook (widget specific)
- TPanedwindow (widget specific)
- TTreeview (widget specific)
- Text (widget specific)
- Toplevel (widget specific)
func (*Window) Highlightbackground ¶ added in v0.5.18
Highlightbackground — Get the configured option value.
Known uses:
func (*Window) Highlightcolor ¶ added in v0.5.18
Highlightcolor — Get the configured option value.
Known uses:
func (*Window) Highlightthickness ¶ added in v0.5.18
Highlightthickness — Get the configured option value.
Known uses:
func (*Window) IconPhoto ¶ added in v0.5.18
IconPhoto — change window icon
Description ¶
IconPhoto sets the titlebar icon for window based on the named photo images. If -default is specified, this is applied to all future created toplevels as well. The data in the images is taken as a snapshot at the time of invocation. If the images are later changed, this is not reflected to the titlebar icons. Multiple images are accepted to allow different images sizes (e.g., 16x16 and 32x32) to be provided. The window manager may scale provided icons to an appropriate size.
On Windows, the images are packed into a Windows icon structure. This will override an ico specified to wm iconbitmap, and vice versa. This command sets the taskbar icon for the window.
On X, the images are arranged into the _NET_WM_ICON X property, which most modern window managers support. A wm iconbitmap may exist simultaneously. It is recommended to use not more than 2 icons, placing the larger icon first. This command also sets the panel icon for the application if the window manager or desktop environment supports it.
On Macintosh, the first image called is loaded into an OSX-native icon format, and becomes the application icon in dialogs, the Dock, and other contexts. At the script level the command will accept only the first image passed in the parameters as support for multiple sizes/resolutions on macOS is outside Tk's scope. Developers should use the largest icon they can support (preferably 512 pixels) to ensure smooth rendering on the Mac.
More information might be available at the Tcl/Tk wm page.
func (*Window) Inactiveselectbackground ¶ added in v0.5.18
Inactiveselectbackground — Get the configured option value.
Known uses:
- Text (widget specific)
func (*Window) Increment ¶ added in v0.5.18
Increment — Get the configured option value.
Known uses:
func (*Window) Indicatoron ¶ added in v0.5.18
Indicatoron — Get the configured option value.
Known uses:
- Checkbutton (widget specific)
- Menubutton (widget specific)
- Radiobutton (widget specific)
func (*Window) Insertbackground ¶ added in v0.5.18
Insertbackground — Get the configured option value.
Known uses:
func (*Window) Insertborderwidth ¶ added in v0.5.18
Insertborderwidth — Get the configured option value.
Known uses:
func (*Window) Insertofftime ¶ added in v0.5.18
Insertofftime — Get the configured option value.
Known uses:
func (*Window) Insertontime ¶ added in v0.5.18
Insertontime — Get the configured option value.
Known uses:
func (*Window) Insertunfocussed ¶ added in v0.5.18
Insertunfocussed — Get the configured option value.
Known uses:
- Text (widget specific)
func (*Window) Insertwidth ¶ added in v0.5.18
Insertwidth — Get the configured option value.
Known uses:
func (*Window) Justify ¶ added in v0.5.18
Justify — Get the configured option value.
Known uses:
- Button
- Checkbutton
- Entry
- Label
- Listbox
- Menubutton
- Message (widget specific)
- Radiobutton
- Spinbox
- TButton
- TCombobox (widget specific)
- TEntry (widget specific)
- TLabel
- TProgressbar
func (*Window) Label ¶ added in v0.2.0
func (w *Window) Label(options ...Opt) *LabelWidget
Label — Create and manipulate 'label' non-interactive text or image widgets
The resulting Window is a child of 'w'
For details please see Label
func (*Window) Labelanchor ¶ added in v0.5.18
Labelanchor — Get the configured option value.
Known uses:
- Labelframe (widget specific)
- TLabelframe (widget specific)
func (*Window) Labelframe ¶ added in v0.2.0
func (w *Window) Labelframe(options ...Opt) *LabelframeWidget
Labelframe — Create and manipulate 'labelframe' labelled container widgets
The resulting Window is a child of 'w'
For details please see Labelframe
func (*Window) Labelwidget ¶ added in v0.5.18
Labelwidget — Get the configured option value.
Known uses:
- Labelframe (widget specific)
- TLabelframe (widget specific)
func (*Window) Lbl ¶ added in v0.5.18
Lbl — Get the configured option value.
Known uses:
- Scale (widget specific)
func (*Window) Length ¶ added in v0.5.18
Length — Get the configured option value.
Known uses:
- Scale (widget specific)
- TProgressbar (widget specific)
- TScale (widget specific)
func (*Window) Listbox ¶ added in v0.2.0
func (w *Window) Listbox(options ...Opt) *ListboxWidget
Listbox — Create and manipulate 'listbox' item list widgets
The resulting Window is a child of 'w'
For details please see Listbox
func (*Window) Listvariable ¶ added in v0.5.18
Listvariable — Get the configured option value.
Known uses:
- Listbox (widget specific)
func (*Window) Lower ¶ added in v0.5.18
Lower — Change a window's position in the stacking order
Description ¶
If the belowThis argument is nil then the command lowers window so that it is below all of its siblings in the stacking order (it will be obscured by any siblings that overlap it and will not obscure any siblings). If belowThis is specified then it must be the path name of a window that is either a sibling of window or the descendant of a sibling of window. In this case the lower command will insert window into the stacking order just below belowThis (or the ancestor of belowThis that is a sibling of window); this could end up either raising or lowering window.
All toplevel windows may be restacked with respect to each other, whatever their relative path names, but the window manager is not obligated to strictly honor requests to restack.
Additional information might be available at the Tcl/Tk lower page.
func (*Window) Maximum ¶ added in v0.5.18
Maximum — Get the configured option value.
Known uses:
- TProgressbar (widget specific)
func (*Window) Maxundo ¶ added in v0.5.18
Maxundo — Get the configured option value.
Known uses:
- Text (widget specific)
func (*Window) Menu ¶ added in v0.2.0
func (w *Window) Menu(options ...Opt) *MenuWidget
Menu — Create and manipulate 'menu' widgets and menubars
The resulting Window is a child of 'w'
For details please see Menu
func (*Window) Menubutton ¶ added in v0.2.0
func (w *Window) Menubutton(options ...Opt) *MenubuttonWidget
Menubutton — Create and manipulate 'menubutton' pop-up menu indicator widgets
The resulting Window is a child of 'w'
For details please see Menubutton
func (*Window) Message ¶ added in v0.2.0
func (w *Window) Message(options ...Opt) *MessageWidget
Message — Create and manipulate 'message' non-interactive text widgets
The resulting Window is a child of 'w'
For details please see Message
func (*Window) Mnu ¶ added in v0.5.18
Mnu — Get the configured option value.
Known uses:
- Menubutton (widget specific)
- TMenubutton (widget specific)
- Toplevel (widget specific)
func (*Window) Mode ¶ added in v0.5.18
Mode — Get the configured option value.
Known uses:
- TProgressbar (widget specific)
func (*Window) Offrelief ¶ added in v0.5.18
Offrelief — Get the configured option value.
Known uses:
- Checkbutton (widget specific)
- Radiobutton (widget specific)
func (*Window) Offvalue ¶ added in v0.5.18
Offvalue — Get the configured option value.
Known uses:
- Checkbutton (widget specific)
- TCheckbutton (widget specific)
func (*Window) Onvalue ¶ added in v0.5.18
Onvalue — Get the configured option value.
Known uses:
- Checkbutton (widget specific)
- TCheckbutton (widget specific)
func (*Window) Opaqueresize ¶ added in v0.5.18
Opaqueresize — Get the configured option value.
Known uses:
- Panedwindow (widget specific)
func (*Window) OptionMenu ¶ added in v0.2.0
func (w *Window) OptionMenu(varName *VariableOpt, options ...any) (r *OptionMenuWidget)
tk_optionMenu — Create an option menubutton and its menu
The resulting Widget is a child of 'w'
For details please see Button
func (*Window) Orient ¶ added in v0.5.18
Orient — Get the configured option value.
Known uses:
- Panedwindow
- Scale
- Scrollbar
- TPanedwindow (widget specific)
- TProgressbar (widget specific)
- TScale (widget specific)
- TScrollbar (widget specific)
- TSeparator (widget specific)
func (*Window) Overrelief ¶ added in v0.5.18
Overrelief — Get the configured option value.
Known uses:
- Button (widget specific)
- Checkbutton (widget specific)
- Radiobutton (widget specific)
func (*Window) Padding ¶ added in v0.5.18
Padding — Get the configured option value.
Known uses:
- TFrame
- TLabel
- TLabelframe
- TNotebook (widget specific)
- TTreeview
func (*Window) Panedwindow ¶ added in v0.2.0
func (w *Window) Panedwindow(options ...Opt) *PanedwindowWidget
Panedwindow — Create and manipulate 'panedwindow' split container widgets
The resulting Window is a child of 'w'
For details please see Panedwindow
func (*Window) Phase ¶ added in v0.5.18
Phase — Get the configured option value.
Known uses:
- TProgressbar (widget specific)
func (*Window) Placeholder ¶ added in v0.5.18
Placeholder — Get the configured option value.
Known uses:
func (*Window) Placeholderforeground ¶ added in v0.5.18
Placeholderforeground — Get the configured option value.
Known uses:
func (*Window) Proxybackground ¶ added in v0.5.18
Proxybackground — Get the configured option value.
Known uses:
- Panedwindow (widget specific)
func (*Window) Proxyborderwidth ¶ added in v0.5.18
Proxyborderwidth — Get the configured option value.
Known uses:
- Panedwindow (widget specific)
func (*Window) Proxyrelief ¶ added in v0.5.18
Proxyrelief — Get the configured option value.
Known uses:
- Panedwindow (widget specific)
func (*Window) Radiobutton ¶ added in v0.2.0
func (w *Window) Radiobutton(options ...Opt) *RadiobuttonWidget
Radiobutton — Create and manipulate 'radiobutton' pick-one widgets
The resulting Window is a child of 'w'
For details please see Radiobutton
func (*Window) Raise ¶ added in v0.5.18
Raise — Change a window's position in the stacking order
Description ¶
If the aboveThis argument is nil then the command raises window so that it is above all of its siblings in the stacking order (it will not be obscured by any siblings and will obscure any siblings that overlap it). If aboveThis is specified then it must be the path name of a window that is either a sibling of window or the descendant of a sibling of window. In this case the raise command will insert window into the stacking order just above aboveThis (or the ancestor of aboveThis that is a sibling of window); this could end up either raising or lowering window.
All toplevel windows may be restacked with respect to each other, whatever their relative path names, but the window manager is not obligated to strictly honor requests to restack.
On macOS raising an iconified toplevel window causes it to be deiconified.
Additional information might be available at the Tcl/Tk raise page.
func (*Window) Readonlybackground ¶ added in v0.5.18
Readonlybackground — Get the configured option value.
Known uses:
func (*Window) Relief ¶ added in v0.5.18
Relief — Get the configured option value.
Known uses:
- Button
- Canvas
- Checkbutton
- Entry
- Frame
- Label
- Labelframe
- Listbox
- Menu
- Menubutton
- Message
- Panedwindow
- Radiobutton
- Scale
- Scrollbar
- Spinbox
- TFrame (widget specific)
- TLabel (widget specific)
- Text
- Toplevel
func (*Window) Repeatdelay ¶ added in v0.5.18
Repeatdelay — Get the configured option value.
Known uses:
func (*Window) Repeatinterval ¶ added in v0.5.18
Repeatinterval — Get the configured option value.
Known uses:
func (*Window) Resolution ¶ added in v0.5.18
Resolution — Get the configured option value.
Known uses:
- Scale (widget specific)
func (*Window) Sashcursor ¶ added in v0.5.18
Sashcursor — Get the configured option value.
Known uses:
- Panedwindow (widget specific)
func (*Window) Sashpad ¶ added in v0.5.18
Sashpad — Get the configured option value.
Known uses:
- Panedwindow (widget specific)
func (*Window) Sashrelief ¶ added in v0.5.18
Sashrelief — Get the configured option value.
Known uses:
- Panedwindow (widget specific)
func (*Window) Sashwidth ¶ added in v0.5.18
Sashwidth — Get the configured option value.
Known uses:
- Panedwindow (widget specific)
func (*Window) Scale ¶ added in v0.2.0
func (w *Window) Scale(options ...Opt) *ScaleWidget
Scale — Create and manipulate 'scale' value-controlled slider widgets
The resulting Window is a child of 'w'
For details please see Scale
func (*Window) Screen ¶ added in v0.5.18
Screen — Get the configured option value.
Known uses:
- Toplevel (widget specific)
func (*Window) Scrollbar ¶ added in v0.2.0
func (w *Window) Scrollbar(options ...Opt) *ScrollbarWidget
Scrollbar — Create and manipulate 'scrollbar' scrolling control and indicator widgets
The resulting Window is a child of 'w'
For details please see Scrollbar
func (*Window) Scrollregion ¶ added in v0.5.18
Scrollregion — Get the configured option value.
Known uses:
- Canvas (widget specific)
func (*Window) Selectbackground ¶ added in v0.5.18
Selectbackground — Get the configured option value.
Known uses:
func (*Window) Selectborderwidth ¶ added in v0.5.18
Selectborderwidth — Get the configured option value.
Known uses:
func (*Window) Selectcolor ¶ added in v0.5.18
Selectcolor — Get the configured option value.
Known uses:
- Checkbutton (widget specific)
- Menu (widget specific)
- Radiobutton (widget specific)
func (*Window) Selectforeground ¶ added in v0.5.18
Selectforeground — Get the configured option value.
Known uses:
func (*Window) Selectimage ¶ added in v0.5.18
Selectimage — Get the configured option value.
Known uses:
- Checkbutton (widget specific)
- Radiobutton (widget specific)
func (*Window) Selectmode ¶ added in v0.5.18
Selectmode — Get the configured option value.
Known uses:
func (*Window) Selecttype ¶ added in v0.5.18
Selecttype — Get the configured option value.
Known uses:
- TTreeview (widget specific)
func (*Window) SetResizable ¶ added in v0.39.0
SetResizable — Enable/disable window resizing
Description ¶
This command controls whether or not the user may interactively resize a top-level window. If resizing is disabled, then the window's size will be the size from the most recent interactive resize or wm geometry command. If there has been no such operation then the window's natural size will be used.
More information might be available at the Tcl/Tk wm page.
func (*Window) Showhandle ¶ added in v0.5.18
Showhandle — Get the configured option value.
Known uses:
- Panedwindow (widget specific)
func (*Window) Showvalue ¶ added in v0.5.18
Showvalue — Get the configured option value.
Known uses:
- Scale (widget specific)
func (*Window) Sliderlength ¶ added in v0.5.18
Sliderlength — Get the configured option value.
Known uses:
- Scale (widget specific)
func (*Window) Sliderrelief ¶ added in v0.5.18
Sliderrelief — Get the configured option value.
Known uses:
- Scale (widget specific)
func (*Window) Spacing1 ¶ added in v0.5.18
Spacing1 — Get the configured option value.
Known uses:
- Text (widget specific)
func (*Window) Spacing2 ¶ added in v0.5.18
Spacing2 — Get the configured option value.
Known uses:
- Text (widget specific)
func (*Window) Spacing3 ¶ added in v0.5.18
Spacing3 — Get the configured option value.
Known uses:
- Text (widget specific)
func (*Window) Spinbox ¶ added in v0.2.0
func (w *Window) Spinbox(options ...Opt) *SpinboxWidget
Spinbox — Create and manipulate 'spinbox' value spinner widgets
The resulting Window is a child of 'w'
For details please see Spinbox
func (*Window) Startline ¶ added in v0.5.18
Startline — Get the configured option value.
Known uses:
- Text (widget specific)
func (*Window) State ¶ added in v0.5.18
State — Get the configured option value.
Known uses:
- Button (widget specific)
- Canvas (widget specific)
- Checkbutton (widget specific)
- Entry (widget specific)
- Label (widget specific)
- Listbox (widget specific)
- Menubutton (widget specific)
- Radiobutton (widget specific)
- Scale (widget specific)
- Spinbox (widget specific)
- TButton
- TCheckbutton
- TCombobox (widget specific)
- TEntry (widget specific)
- TLabel
- TMenubutton
- TRadiobutton
- TSpinbox
- Text (widget specific)
func (*Window) Striped ¶ added in v0.5.18
Striped — Get the configured option value.
Known uses:
- TTreeview (widget specific)
func (*Window) TButton ¶ added in v0.2.0
func (w *Window) TButton(options ...Opt) *TButtonWidget
TButton — Widget that issues a command when pressed
The resulting Window is a child of 'w'
For details please see TButton
func (*Window) TCheckbutton ¶ added in v0.2.0
func (w *Window) TCheckbutton(options ...Opt) *TCheckbuttonWidget
TCheckbutton — On/off widget
The resulting Window is a child of 'w'
For details please see TCheckbutton
func (*Window) TCombobox ¶ added in v0.2.0
func (w *Window) TCombobox(options ...Opt) *TComboboxWidget
TCombobox — Text field with popdown selection list
The resulting Window is a child of 'w'
For details please see TCombobox
func (*Window) TEntry ¶ added in v0.2.0
func (w *Window) TEntry(options ...Opt) *TEntryWidget
TEntry — Editable text field widget
The resulting Window is a child of 'w'
For details please see TEntry
func (*Window) TExit ¶ added in v0.5.18
func (w *Window) TExit(options ...Opt) *TButtonWidget
TExit provides a canned TButton with default Txt "Exit", bound to the ExitHandler.
The resulting Window is a child of 'w'
func (*Window) TFrame ¶ added in v0.2.0
func (w *Window) TFrame(options ...Opt) *TFrameWidget
TFrame — Simple container widget
The resulting Window is a child of 'w'
For details please see TFrame
func (*Window) TLabel ¶ added in v0.2.0
func (w *Window) TLabel(options ...Opt) *TLabelWidget
TLabel — Display a text string and/or image
The resulting Window is a child of 'w'
For details please see TLabel
func (*Window) TLabelframe ¶ added in v0.2.0
func (w *Window) TLabelframe(options ...Opt) *TLabelframeWidget
TLabelframe — Container widget with optional label
The resulting Window is a child of 'w'
For details please see TLabelframe
func (*Window) TMenubutton ¶ added in v0.2.0
func (w *Window) TMenubutton(options ...Opt) *TMenubuttonWidget
TMenubutton — Widget that pops down a menu when pressed
The resulting Window is a child of 'w'
For details please see TMenubutton
func (*Window) TNotebook ¶ added in v0.2.0
func (w *Window) TNotebook(options ...Opt) *TNotebookWidget
TNotebook — Multi-paned container widget
The resulting Window is a child of 'w'
For details please see TNotebook
func (*Window) TPanedwindow ¶ added in v0.2.0
func (w *Window) TPanedwindow(options ...Opt) *TPanedwindowWidget
TPanedwindow — Multi-pane container window
The resulting Window is a child of 'w'
For details please see TPanedwindow
func (*Window) TProgressbar ¶ added in v0.2.0
func (w *Window) TProgressbar(options ...Opt) *TProgressbarWidget
TProgressbar — Provide progress feedback
The resulting Window is a child of 'w'
For details please see TProgressbar
func (*Window) TRadiobutton ¶ added in v0.2.0
func (w *Window) TRadiobutton(options ...Opt) *TRadiobuttonWidget
TRadiobutton — Mutually exclusive option widget
The resulting Window is a child of 'w'
For details please see TRadiobutton
func (*Window) TScale ¶ added in v0.2.0
func (w *Window) TScale(options ...Opt) *TScaleWidget
TScale — Create and manipulate a scale widget
The resulting Window is a child of 'w'
For details please see TScale
func (*Window) TScrollbar ¶ added in v0.2.0
func (w *Window) TScrollbar(options ...Opt) *TScrollbarWidget
TScrollbar — Control the viewport of a scrollable widget
The resulting Window is a child of 'w'
For details please see TScrollbar
func (*Window) TSeparator ¶ added in v0.2.0
func (w *Window) TSeparator(options ...Opt) *TSeparatorWidget
TSeparator — Separator bar
The resulting Window is a child of 'w'
For details please see TSeparator
func (*Window) TSizegrip ¶ added in v0.2.0
func (w *Window) TSizegrip(options ...Opt) *TSizegripWidget
TSizegrip — Bottom-right corner resize widget
The resulting Window is a child of 'w'
For details please see TSizegrip
func (*Window) TSpinbox ¶ added in v0.2.0
func (w *Window) TSpinbox(options ...Opt) *TSpinboxWidget
TSpinbox — Selecting text field widget
The resulting Window is a child of 'w'
For details please see TSpinbox
func (*Window) TTreeview ¶ added in v0.2.0
func (w *Window) TTreeview(options ...Opt) *TTreeviewWidget
TTreeview — Hierarchical multicolumn data display widget
The resulting Window is a child of 'w'
For details please see TTreeview
func (*Window) Tabs ¶ added in v0.5.18
Tabs — Get the configured option value.
Known uses:
- Text (widget specific)
func (*Window) Tabstyle ¶ added in v0.5.18
Tabstyle — Get the configured option value.
Known uses:
- Text (widget specific)
func (*Window) Takefocus ¶ added in v0.5.18
Takefocus — Get the configured option value.
Known uses:
- Button
- Canvas
- Checkbutton
- Entry
- Frame
- Label
- Labelframe
- Listbox
- Menu
- Menubutton
- Message
- Radiobutton
- Scale
- Scrollbar
- Spinbox
- TButton
- TCheckbutton
- TCombobox
- TEntry
- TFrame
- TLabel
- TLabelframe
- TMenubutton
- TNotebook
- TPanedwindow
- TProgressbar
- TRadiobutton
- TScale
- TScrollbar
- TSeparator
- TSizegrip
- TSpinbox
- TTreeview
- Text
- Toplevel
func (*Window) Tearoff ¶ added in v0.5.18
Tearoff — Get the configured option value.
Known uses:
- Menu (widget specific)
func (*Window) Text ¶ added in v0.2.0
func (w *Window) Text(options ...Opt) *TextWidget
Text — Create and manipulate 'text' hypertext editing widgets
The resulting Window is a child of 'w'
For details please see Text
func (*Window) Textvariable ¶ added in v0.5.18
Textvariable — Get the configured option value.
Known uses:
- Button
- Checkbutton
- Entry
- Label
- Menubutton
- Message
- Radiobutton
- Spinbox
- TButton
- TCheckbutton
- TCombobox (widget specific)
- TEntry (widget specific)
- TLabel
- TMenubutton
- TRadiobutton
func (*Window) Tickinterval ¶ added in v0.5.18
Tickinterval — Get the configured option value.
Known uses:
- Scale (widget specific)
func (*Window) Title ¶ added in v0.5.18
Title — Get the configured option value.
Known uses:
- Menu (widget specific)
func (*Window) Titlecolumns ¶ added in v0.5.18
Titlecolumns — Get the configured option value.
Known uses:
- TTreeview (widget specific)
func (*Window) Titleitems ¶ added in v0.5.18
Titleitems — Get the configured option value.
Known uses:
- TTreeview (widget specific)
func (*Window) Toplevel ¶ added in v0.2.0
func (w *Window) Toplevel(options ...Opt) *ToplevelWidget
Toplevel — Create and manipulate 'toplevel' main and popup window widgets
The resulting Window is a child of 'w'
For details please see Toplevel
func (*Window) Tristateimage ¶ added in v0.5.18
Tristateimage — Get the configured option value.
Known uses:
- Checkbutton (widget specific)
- Radiobutton (widget specific)
func (*Window) Tristatevalue ¶ added in v0.5.18
Tristatevalue — Get the configured option value.
Known uses:
- Checkbutton (widget specific)
- Radiobutton (widget specific)
func (*Window) Troughcolor ¶ added in v0.5.18
Troughcolor — Get the configured option value.
Known uses:
func (*Window) Type ¶ added in v0.5.18
Type — Get the configured option value.
Known uses:
- Menu (widget specific)
- WmAttributes (command specific)
func (*Window) Underline ¶ added in v0.5.18
Underline — Get the configured option value.
Known uses:
- Button
- Checkbutton
- Label
- Menubutton
- Radiobutton
- TButton
- TCheckbutton
- TLabel
- TLabelframe (widget specific)
- TMenubutton
- TRadiobutton
func (*Window) Undo ¶ added in v0.5.18
Undo — Get the configured option value.
Known uses:
- Text (widget specific)
func (*Window) Use ¶ added in v0.5.18
Use — Get the configured option value.
Known uses:
- Toplevel (widget specific)
func (*Window) Value ¶ added in v0.5.18
Value — Get the configured option value.
Known uses:
- Radiobutton (widget specific)
- TProgressbar (widget specific)
- TRadiobutton (widget specific)
- TScale (widget specific)
func (*Window) Variable ¶ added in v0.5.18
Variable — Get the configured option value.
Known uses:
- Checkbutton (widget specific)
- Radiobutton (widget specific)
- Scale (widget specific)
- TCheckbutton (widget specific)
- TProgressbar (widget specific)
- TRadiobutton (widget specific)
- TScale (widget specific)
func (*Window) Visual ¶ added in v0.5.18
Visual — Get the configured option value.
Known uses:
- Frame (widget specific)
- Labelframe (widget specific)
- Toplevel (widget specific)
func (*Window) Wait ¶ added in v0.5.18
func (w *Window) Wait()
Wait — Wait for a window to be destroyed
Description ¶
Wait command waits for 'w' to be destroyed. This is typically used to wait for a user to finish interacting with a dialog box before using the result of that interaction.
While the Wwait command is waiting it processes events in the normal fashion, so the application will continue to respond to user interactions. If an event handler invokes Wait again, the nested call to Wait must complete before the outer call can complete.
func (*Window) WaitVisibility ¶ added in v0.5.18
func (w *Window) WaitVisibility()
WaitVisibility — Wait for a window to change visibility
Description ¶
WaitVisibility command waits for a change in w's visibility state (as indicated by the arrival of a VisibilityNotify event). This form is typically used to wait for a newly-created window to appear on the screen before taking some action.
While the Wwait command is waiting it processes events in the normal fashion, so the application will continue to respond to user interactions. If an event handler invokes Wait again, the nested call to Wait must complete before the outer call can complete.
func (*Window) WidgetState ¶ added in v0.53.0
ttk::widget — Standard options and commands supported by Tk themed widgets
Description ¶
Modify or inquire widget state. If stateSpec is not "", sets the widget state: for each flag in stateSpec, sets the corresponding flag or clears it if prefixed by an exclamation point. Returns a new state spec indicating which flags were changed.
If stateSpec is "", returns a list of the currently-enabled state flags.
Widget States ¶
The widget state is a bitmap of independent state flags. Widget state flags include:
- active: The mouse cursor is over the widget and pressing a mouse button will cause some action to occur. (aka “prelight” (Gnome), “hot” (Windows), “hover”).
- disabled: Widget is disabled under program control (aka “unavailable”, “inactive”).
- focus: Widget has keyboard focus.
- pressed: Widget is being pressed (aka “armed” in Motif).
- selected: “On”, “true”, or “current” for things like checkbuttons and radiobuttons.
- background: Windows and the Mac have a notion of an “active” or foreground window. The background state is set for widgets in a background window, and cleared for those in the foreground window.
- readonly: Widget should not allow user modification.
- alternate: A widget-specific alternate display format. For example, used for checkbuttons and radiobuttons in the “tristate” or “mixed” state, and for buttons with -default active.
- invalid: The widget's value is invalid. (Potential uses: scale widget value out of bounds, entry widget value failed validation.)
- hover: The mouse cursor is within the widget. This is similar to the active state; it is used in some themes for widgets that provide distinct visual feedback for the active widget in addition to the active element within the widget.
- user1-user6 Freely usable for other purposes
A state specification or stateSpec is a list of state names, optionally prefixed with an exclamation point (!) indicating that the bit is off.
func (*Window) Width ¶ added in v0.5.18
Width — Get the configured option value.
Known uses:
- Button (widget specific)
- Canvas (widget specific)
- Checkbutton (widget specific)
- Entry (widget specific)
- Frame (widget specific)
- Label (widget specific)
- Labelframe (widget specific)
- Listbox (widget specific)
- Menubutton (widget specific)
- Message (widget specific)
- Panedwindow (widget specific)
- Radiobutton (widget specific)
- Scale (widget specific)
- Scrollbar (widget specific)
- Spinbox (widget specific)
- TButton
- TCheckbutton
- TCombobox (widget specific)
- TEntry (widget specific)
- TFrame (widget specific)
- TLabel
- TLabelframe (widget specific)
- TMenubutton
- TNotebook (widget specific)
- TPanedwindow (widget specific)
- TRadiobutton
- Text (widget specific)
- Toplevel (widget specific)
func (*Window) WmTitle ¶ added in v0.5.18
WmTitle — change the window manager title
Description ¶
If string is specified, then it will be passed to the window manager for use as the title for window (the window manager should display this string in window's title bar). In this case the command returns an empty string. If string is not specified then the command returns the current title for the window. The title for a window defaults to its name.
More information might be available at the Tcl/Tk wm page.
func (*Window) Wraplength ¶ added in v0.5.18
Wraplength — Get the configured option value.
Known uses:
- Button
- Checkbutton
- Label
- Menubutton
- Radiobutton
- TLabel
- TLabel (widget specific)
- TProgressbar
func (*Window) Xscrollincrement ¶ added in v0.5.18
Xscrollincrement — Get the configured option value.
Known uses:
- Canvas (widget specific)
func (*Window) Yscrollincrement ¶ added in v0.5.18
Yscrollincrement — Get the configured option value.
Known uses:
- Canvas (widget specific)
Notes ¶
Bugs ¶
TextWidget.Get currently supports only one range.
Additional information might be available at the Tcl/Tk text page.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
The same calculator as in calc.go with additional handling of keyboard input.
|
The same calculator as in calc.go with additional handling of keyboard input. |
The b5 package is a work in progress with no stable API yet.
|
The b5 package is a work in progress with no stable API yet. |
extensions
|
|
autoscroll
Package autoscroll provides the [tklib autoscroll].
|
Package autoscroll provides the [tklib autoscroll]. |
ctext
Package ctext provides the [tklib ctext] package.
|
Package ctext provides the [tklib ctext] package. |
eval
Package eval provides raw Tcl eval.
|
Package eval provides raw Tcl eval. |
ntext
Package ntext provides the [tklib ntext] package.
|
Package ntext provides the [tklib ntext] package. |
tablelist
Package tablelist provides the [tklib tablelist].
|
Package tablelist provides the [tklib tablelist]. |
themes
|
|
azure
Package azure provides the [Azure Tk theme].
|
Package azure provides the [Azure Tk theme]. |
Package vnc provides tk9.0 applications with a built-in VNC over websockets server.
|
Package vnc provides tk9.0 applications with a built-in VNC over websockets server. |