Resurrected form list element
[tcl-tlc.git] / init.tcl
blobd363a1bc7166063c2769d26ee88ad362d8e19328
1 # vim: foldmarker=<<<,>>>
3 package require TLC-base
5 namespace eval :: {
6 package require Itk 3.1
8 namespace import -force ::itcl::*
9 namespace import -force ::itk::*
11 package require blttable
12 namespace eval ::blt {
13 proc table {args} {
14 return [uplevel [list ::blttable::table] $args]
19 namespace eval ::tlc {
20 namespace eval ::blt {}
21 namespace eval ::blttable {namespace export *}
23 variable guilibrary \
24 [file normalize [file join [pwd] [file dirname [info script]]]]
26 namespace import ::blt::*
27 if {[info commands ::blttable::table] != ""} {
28 catch {namespace import ::blttable::*}
32 lappend auto_path [file join $::tlc::guilibrary scripts]
34 if {[info exists tlc::custom_theme_object]} {
35 set tlc::theme $tlc::custom_theme_object ::#auto]
36 } else {
37 if {[info exists ::tlc_UserThemeOverride]} {
38 set tlc::theme [tlc::Daftheme ::#auto]
39 } else {
40 set tlc::theme [tlc::Theme ::#auto]
44 package provide TLC $::tlc::version
46 # Set saner defaults
48 bind Text <Key-Tab> {tk_focusNext %W}
49 bind Text <Shift-Key-Tab> {tk_focusPrev %W}
51 tlc::Baseconfig tlc::default_config -configfile ""
52 array set tlc::config [tlc::default_config dump_config]
54 # Default options <<<
56 foreach {opt settingkey} {
57 *activeBackground background
58 *highlightBackground highlightbackground
59 *highlightColor highlightcolor
60 *font font
61 *labelFont font
62 *textFont font
63 *selectBorderWidth selectborderwidth
64 *selectBackground selectbackground
65 *selectForeground selectforeground
66 *Tabset*selectBackground background
67 *textBackground textbackground
68 *Listbox.background textbackground
69 *disabledBackground disabledbackground
70 *Entry.disabledForeground disabledforeground
71 *Text.disabledForeground disabledforeground
72 *Text.TextHighlightBackground texthighlightbackground
73 *.hidebg hidebg
74 *enabledBackground textbackground
75 *TreeView.background textbackground
76 *TreeView.borderwidth borderwidth
77 *TreeView.highlightThickness borderwidth
78 *Labelframe.font boldfont
79 *labelFont boldfont
80 *Button.padY button_pady
81 *frameRelief framerelief
82 *frameBorderwidth frameborderwidth
83 *Spinner.frameRelief entryrelief
84 *Spinner.frameBorderwidth entryborderwidth
85 *Form.padding formpadding
86 } {
87 option add $opt [$tlc::theme setting $settingkey] startupFile
90 # Hacks. userdefault priority == 60
91 foreach {opt settingkey} {
92 *Entry.background textbackground
93 *Entry.highlightBackground background
94 *TreeCtrl.background textbackground
95 } {
96 option add $opt [$tlc::theme setting $settingkey] 61
99 switch -exact $tcl_platform(platform) {
100 "unix" {
101 option add *Scrollbar.width 12 startupFile
102 option add *Scrollbar.borderWidth 1 startupFile
103 option add *sbWidth 12 startupFile
104 option add *scrollMargin 0 startupFile
105 option add *elementBorderWidth 1 startupFile
106 option add *textFont [$tlc::theme setting font] startupFile
107 option add *Menu.font [$tlc::theme setting boldfont] startupFile
108 option add *Menu.borderWidth 1 startupFile
110 "windows" {
111 option add *Radiobutton.borderWidth 0 startupFile
112 option add *Checkbutton.borderWidth 0 startupFile
113 option add *Entry.highlightThickness 0 startupFile
116 #>>>