-
Notifications
You must be signed in to change notification settings - Fork 2
/
doc.go
2388 lines (2387 loc) · 70 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2024 The tk9.0-go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// 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
//
// - [equ] A Plain TeX math editor.
// - [visualmd] A WYSIWYG markdown editor.
//
// # Frequently Asked Questions
//
// - 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.
//
// # 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.
//
// 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
//
// - [time.Duration]
//
// When passing an argument of type [time.Durarion] to a function accepting
// 'any', the duration is converted to an integer number of milliseconds.
//
// - []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:
//
// - [Arrowcolor]
// - [Arrowsize]
// - [Background]
// - [Bordercolor]
// - [Relief]
//
// "Menubutton.indicator" style element options:
//
// - [Arrowcolor]
// - [Arrowsize]
// - [Direction]
//
// "Radiobutton.indicator" style element options:
//
// - [Background]
// - [Bordercolor]
// - [Foreground]
// - [Indicatorcolor]
// - [Indicatormargin]
// - [Lightcolor]
// - [Shadecolor]
//
// "Spinbox.downarrow" style element options:
//
// - [Arrowcolor]
// - [Arrowsize]
// - [Background]
// - [Bordercolor]
// - [Relief]
//
// "Spinbox.uparrow" style element options:
//
// - [Arrowcolor]
// - [Arrowsize]
// - [Background]
// - [Bordercolor]
// - [Relief]
//
// "Treeitem.indicator" style element options:
//
// - [Foreground]
// - [Indicatormargins]
// - [Size]
//
// "arrow" style element options:
//
// - [Arrowcolor]
// - [Arrowsize]
// - [Background]
// - [Bordercolor]
// - [Relief]
//
// "border" style element options:
//
// - [Background]
// - [Bordercolor]
// - [Borderwidth]
// - [Default]
// - [Relief]
//
// "downarrow" style element options:
//
// - [Arrowcolor]
// - [Arrowsize]
// - [Background]
// - [Bordercolor]
// - [Relief]
//
// "field" style element options:
//
// - [Bordercolor]
// - [Fieldbackground]
// - [Focuscolor]
// - [Focuswidth]
//
// "leftarrow" style element options:
//
// - [Arrowcolor]
// - [Arrowsize]
// - [Background]
// - [Bordercolor]
// - [Relief]
//
// "rightarrow" style element options:
//
// - [Arrowcolor]
// - [Arrowsize]
// - [Background]
// - [Bordercolor]
// - [Relief]
//
// "slider" style element options:
//
// - [Background]
// - [Bordercolor]
// - [Borderwidth]
// - [Orient]
// - [Sliderrelief]
// - [Sliderthickness]
//
// "thumb" style element options:
//
// - [Background]
// - [Bordercolor]
// - [Orient]
// - [Relief]
// - [Width]
//
// "uparrow" style element options:
//
// - [Arrowcolor]
// - [Arrowsize]
// - [Background]
// - [Bordercolor]
// - [Relief]
//
// "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:
//
// - [Background]
// - [Fieldbackground]
//
// "GradientButton.button" style element options:
//
// "HelpButton.button" style element options:
//
// "Horizontal.Scrollbar.leftarrow" style element options:
//
// - [Orient]
//
// "Horizontal.Scrollbar.rightarrow" style element options:
//
// - [Orient]
//
// "Horizontal.Scrollbar.thumb" style element options:
//
// - [Orient]
//
// "Horizontal.Scrollbar.trough" style element options:
//
// - [Orient]
//
// "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:
//
// - [Maximum]
// - [Mode]
// - [Orient]
// - [Phase]
// - [Value]
//
// "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:
//
// - [From]
// - [Orient]
// - [To]
// - [Value]
//
// "Searchbox.field" style element options:
//
// - [Background]
// - [Fieldbackground]
//
// "SidebarButton.button" style element options:
//
// "Spinbox.downarrow" style element options:
//
// "Spinbox.field" style element options:
//
// - [Background]
// - [Fieldbackground]
//
// "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:
//
// - [Orient]
//
// "Vertical.Scrollbar.thumb" style element options:
//
// - [Orient]
//
// "Vertical.Scrollbar.trough" style element options:
//
// - [Orient]
//
// "Vertical.Scrollbar.uparrow" style element options:
//
// - [Orient]
//
// "background" style element options:
//
// "field" style element options:
//
// - [Fieldbackground]
//
// "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:
//
// - [Bordercolor]
// - [Fieldbackground]
// - [Lightcolor]
//
// "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:
//
// - [Bordercolor]
// - [Borderwidth]
// - [Darkcolor]
// - [Lightcolor]
// - [Relief]
//
// "client" style element options:
//
// - [Background]
// - [Bordercolor]
// - [Darkcolor]
// - [Lightcolor]
//
// "downarrow" style element options:
//
// - [Arrowcolor]
// - [Arrowsize]
// - [Background]
// - [Bordercolor]
// - [Darkcolor]
// - [Gripsize]
// - [Lightcolor]
// - [Orient]
// - [Sliderlength]
// - [Troughcolor]
//
// "field" style element options:
//
// - [Bordercolor]
// - [Fieldbackground]
// - [Lightcolor]
//
// "hgrip" style element options:
//
// - [Bordercolor]
// - [Gripsize]
// - [Lightcolor]
//
// "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:
//
// - [Background]
// - [Bordercolor]
// - [Darkcolor]
// - [Lightcolor]
//
// "thumb" style element options:
//
// - [Arrowcolor]
// - [Arrowsize]
// - [Background]
// - [Bordercolor]
// - [Darkcolor]
// - [Gripsize]
// - [Lightcolor]
// - [Orient]
// - [Sliderlength]
// - [Troughcolor]
//
// "trough" style element options:
//
// - [Arrowcolor]
// - [Arrowsize]