Tk Source Code

Artifact [ed7454a5]
Login

Artifact ed7454a53314a4e923cc82cb85e463c27e4dbea102669c907766043735aff191:

Attachment "bordertest.tcl" to ticket [265ff202] added by nemethi 2025-10-30 15:09:33. Also attachment "bordertest.tcl" to ticket [8b725d6b] added by nemethi 2025-10-27 17:35:40.
#! /usr/bin/env tclsh

package require Tk

ttk::frame .f
ttk::frame .lf

ttk::menubutton .mb -menu .mb.m
menu .mb.m -tearoff 0
foreach theme [lsort -dictionary [ttk::style theme names]] {
    .mb.m add command -label $theme -command [list setTheme $theme]
}

proc setTheme theme {
    ttk::setTheme $theme
    .mb configure -text $theme

    set bg [ttk::style lookup . -background]
    set fg [ttk::style lookup . -foreground]
    .mb.m configure -background $bg -foreground $fg
}
setTheme [ttk::style theme use]

set num 50
ttk::scale .sc -from 0 -to 100 -variable num
ttk::progressbar .pb -variable num
ttk::scrollbar .sb
.sb set 0.3 0.7

pack .mb .sc .pb -in .lf -anchor w -pady {0 6p}
pack .pb  -in .lf -anchor w -pady 0
pack .sb -in .f -side right -fill y -padx 6p -pady 6p
pack .lf -in .f -side right -anchor nw -expand 1 -padx {6p 0} -pady 6p
pack .f -expand true -fill both