-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathproto-doc
1912 lines (1750 loc) · 33.9 KB
/
proto-doc
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
Still to do:
- add something like Perl-TKs megawidgets
- support lua 5.2 (test with 5.1, 5.2 and luajit)
- write DOCs!
ltk.var()
ltk.var[name]
methods for all widgets
-----------------------
These methods are available for all widgets, but they may not always do
something. So if you want to use any of these with a widget, please check
its documentation for wether it supports this method or not.
bind(event, function)
the ltk.bind function as a method. For any widget w calling w:bind(...)
is the same as calling ltk.bind(w, ...)
http://www.tcl.tk/man/tcl8.5/TkCmd/bind.htm
bindtags(?tag?, ...)
the ltk.bindtags function as a method.
http://www.tcl.tk/man/tcl8.5/TkCmd/bindtags.htm
cget(option)
return the current value of the named widget option
http://www.tcl.tk/man/tcl8.5/TkCmd/ttk_widget.htm#M17
configure(?option?)
configure {option1=value1, option2=value2, ...}
if called without args, returns a list of config options like this:
{
{option1, default value, current value},
{option2, default value, current value},
...
}
if called with one arg, that must be a valid config option, and the
result is a table like one entry in the table of options above:
{option, default value, current value}
If called with a table, the widgets options are set from the name-value
pairs of the table.
http://www.tcl.tk/man/tcl8.5/TkCmd/ttk_widget.htm#M18
destroy()
destroys the widget
http://www.tcl.tk/man/tcl8.5/TkCmd/destroy.htm
grid()
grid{options}
The ltk.grid function as a method, used to add individual widgets to
the grid geometry manager. For any widget w calling w:grid() is the
same as calling ltk.grid(w, ...)
http://www.tcl.tk/man/tcl8.5/TkCmd/grid.htm
For more grid functionality see the grid family of functions below
instate(statespec)
Test the widget's state. Returns true if the widget state matches
statespec and false or nil otherwise. See "WIDGET STATES" below.
http://www.tcl.tk/man/tcl8.5/TkCmd/ttk_widget.htm#M20
methods()
return a list of methods the widget understands. This does not return
the standard options above, only widget specific methods.
options()
return a list of options the widget can be configured with
pack()
pack{options}
The ltk.pack function as a method, used to add individual widgets to
the pack geometry manager. For any widget w calling w:pack() is the
same as calling ltk.pack(w, ...)
http://www.tcl.tk/man/tcl8.5/TkCmd/pack.htm
For more pack functionality see the pack family of functions below.
place()
place{options}
The ltk.place function as a method, used to add individual widgets to
the place geometry manahg statusger. For any widget w calling w:place()
is the same as calling ltk.place(w, ...)
http://www.tcl.tk/man/tcl8.5/TkCmd/place.htm
For more place functionality see the place family of functions below.
state(?stateSpec?)
Modify or inquire widget state. If stateSpec is present, sets the
widget state: for each flag in stateSpec, sets the corresponding flag
or clears it if prefixed by an exclamation point.
Returns a table indicating which flags were changed:
changes = widget:state(spec)
widget:state(changes)
will restore widget to the original state.
If stateSpec is not specified, returns a table of the
currently-enabled state flags. See "WIDGET STATES" below.
http://www.tcl.tk/man/tcl8.5/TkCmd/ttk_widget.htm#M21
textcopy()
copies marked text from a widget to the system clipboard
textcut()
moves marked text from a widget to the system clipboard, deleting it
from the widget
textpaste()
pastes text from the system clipboard into the widget
WIDGET STATES
The widget state is a table of independent state flags. Not all widget
support all flags. In addition to the Flags listet in the Tk
documentation, ltk also supports the 'normal' flag, which is
equivalent to '!disabled'.
A state specification or stateSpec is either a single state name or a
table of state names, optionally prefixed with an exclamation point (!)
indicating that the flag is off.
http://www.tcl.tk/man/tcl8.5/TkCmd/ttk_widget.htm#M22
Options
-------
See http://www.tcl.tk/man/tcl8.5/TkCmd/options.htm for a list of standard
options supported by most widgets. Keep in mind that in ltk option names
are like the names in tk without the leading dash, so '-background' in tk
becomes 'background' in ltk.
Additional options are described here: http://www.tcl.tk/man/tcl8.5/TkCmd/ttk_widget.htm
These are for themed widgets.
For options that take scripts as arguments, in ltk they take a function.
The arguments that are appended to the script in Tcl are passed as arguments
to the function in ltk.
TODO: scrolling and stuff
widgets
-------
button
http://www.tcl.tk/man/tcl8.5/TkCmd/ttk_button.htm
Options
class, command, compound, cursor, default, image, padding, state, style,
takefocus, takefocus, text, textvariable, underline, width
Methods:
standard methods
bind
bindtags
cget
configure
destroy
grid
instate
methods
options
pack
place
state
widget specific methods
identify(x, y)
Returns the name of the element under the point given by x and y, or an
empty string if the point does not lie within any element. x and y are
pixel coordinates relative to the widget.
invoke()
Invokes the command associated with the button.
canvas
Tk: canvas
Options
standard options
cursor
highlightbackground
highlightcolor
highlightthickness
insertbackground
insertborderwidth
insertofftime
insertontime
insertwidth
offset
relief
selectbackground
selectborderwidth
selectforeground
takefocus
xscrollcommand
yscrollcommand
widget specific options
closeenough
Specifies a floating-point value indicating how close the mouse
cursor must be to an item before it is considered to be
“inside” the item. Defaults to 1.0.
confine
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.
height
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.
scrollregion
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.
state
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.
width
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.
xscrollincrement
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 less than or equal to zero, then
horizontal scrolling is unconstrained.
yscrollincrement
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 less than or equal to zero, then
vertical scrolling is unconstrained.
Methods:
standard methods
bind
bindtags
cget
configure
destroy
grid
instate
methods
options
pack
place
state
textcopy
textcut
textpaste
widget specific methods
addtag(tag, searchspec, arg...)
pathName addtag tag searchSpec ?arg arg ...?
Searchspec:
'above', tagOrId
'all'
'below', tagOrId
'closest', x, y [, halo] [, start]
'enclosed', x1, y1, x2, y2
'overlapping', x1, y1, x2, y2
'withtag', tagOrId
bbox(tagOrId, ...)
-> pathName bbox tagOrId ?tagOrId tagOrId ...?
returns a list of values
canvasx(screenx [, gridspacing])
-> pathName canvasx screeny ?gridspacing?
canvasy(screeny [, gridspacing])
-> pathName canvasy screeny ?gridspacing?
coords(tagOrId[, x0, y0, ...])
-> pathName coords tagOrId ?x0 y0 ...?
create_arc(x1, y1, y2, y2)
create_arc{x1, y1, y2, y2, option=value, ...}
create_arc(coordList)
create_arc{coordList, option=value, ...}
-> pathName create arc x1 y1 x2 y2 ?option value ...?
-> pathName create arc coordList ?option value ...?
coordList must be a table of 4 elements
create_bitmap(x, y)
create_bitmap{x, y, option=value, ...}
create_bitmap(coordList)
create_bitmap{coordList, option=value, ...}
-> pathName create bitmap x y ?option value option value ...?
-> pathName create bitmap x y ?option value option value ...?
coordList must be a table of 2 elements
create_image
create_line
create_oval
create_polygon
create_rectangle
create_text
create_window
dchars(tagOrId, first [,last])
delete
dtag
find
focus
gettags
icursor
index
insert
itembind(tagOrId [, sequence [, function]])
pathname bind tagOrId ?sequence? ?command?
itemcget
itemconfigure
lower
move
postscript
raise
scale
scan_dragto
scan_mark
select_adjust
select_clear
select_from
select_item
select_to
type
xview
xview_moveto
xview_scroll
yview
yview_moveto
yview_scroll
checkbutton
Tk: ttk::checkbutton
Options
standard options
class
compound
cursor
image
padding
style
takefocus
text
textvariable
underline
width
widget specific options
command
A function to execute whenever the widget is invoked.
offvalue
The value to store in the associated -variable when the widget is
deselected. Defaults to 0.
onvalue
The value to store in the associated -variable when the widget is
selected. Defaults to 1.
variable
The name of a ltk.var variable whose value is linked to the widget.
Defaults to the widget pathname if not specified.
Methods:
standard methods
bind
bindtags
cget
configure
destroy
grid
identify
instate
methods
options
pack
place
state
textcopy
textcut
textpaste
widget specific methods
invoke
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.
combobox
Tk: combobox
Options
values
class
exportselection
xscrollcommand
validatecommand
textvariable
takefocus
invalidcommand
postcommand
justify
validate
width
font
style
cursor
height
background
foreground
show
Methods:
standard methods
bind
bindtags
cget
configure
destroy
grid
identify
instate
methods
options
pack
place
state
textcopy
textcut
textpaste
widget specific methods
bbox
current
delete
get
icursor
index
insert
selection_clear
selection_present
selection_range
set
xview
entry
Tk: ttk::entry
Options
class
exportselection
xscrollcommand
validatecommand
textvariable
takefocus
invalidcommand
justify
validate
width
show
font
style
foreground
cursor
background
state
Methods:
standard methods
bind
bindtags
cget
configure
destroy
grid
identify
instate
methods
options
pack
place
state
textcopy
textcut
textpaste
widget specific methods
bbox
delete
get
icursor
index
insert
selection_clear
selection_present
selection_range
set
validate
xview
frame
Tk: ttk::frame
Options
Methods:
standard methods
bind
bindtags
cget
configure
destroy
grid
identify
instate
methods
options
pack
place
state
textcopy
textcut
textpaste
widget specific methods
label
Tk: ttk::label
Options
Methods:
standard methods
bind
bindtags
cget
configure
destroy
grid
identify
instate
methods
options
pack
place
state
textcopy
textcut
textpaste
widget specific methods
labelframe
Tk: ttk::labelframe
Options
labelanchor
relief
text
underline
width
labelwidget
class
style
cursor
height
padding
takefocus
borderwidth
Methods:
standard methods
bind
bindtags
cget
configure
destroy
grid
identify
instate
methods
options
pack
place
state
textcopy
textcut
textpaste
widget specific methods
listbox
Tk: listbox
Options
selectbackground
relief
selectmode
exportselection
xscrollcommand
disabledforeground
setgrid
background
foreground
selectborderwidth
activestyle
yscrollcommand
takefocus
borderwidth
highlightcolor
width
state
font
selectforeground
cursor
height
highlightthickness
highlightbackground
listvariable
Methods:
standard methods
bind
bindtags
cget
configure
destroy
grid
instate
methods
options
pack
place
state
textcopy
textcut
textpaste
widget specific methods
activate
bbox
curselection
delete
get
index
insert
itemcget
itemconfigure
nearest
scan
see
selection
size
xview
yview
menu
Tk: menu
Options
relief
activebackground
disabledforeground
background
tearoffcommand
postcommand
selectcolor
borderwidth
tearoff
type
font
title
cursor
foreground
activeborderwidth
activeforeground
takefocus
Methods:
standard methods
bind
bindtags
cget
configure
destroy
grid
instate
methods
options
pack
place
state
textcopy
textcut
textpaste
widget specific methods
activate
add
clone
delete
entrycget
entryconfigure
index
insert
invoke
post
postcascade
type
unpost
xposition
yposition
menubutton
Tk: ttk::menubutton
Options
direction
class
style
text
underline
width
state
image
menu
cursor
textvariable
takefocus
padding
compound
Methods:
standard methods
bind
bindtags
cget
configure
destroy
grid
identify
instate
methods
options
pack
place
state
textcopy
textcut
textpaste
widget specific methods
message
Tk: message
Options
relief
padx
cursor
pady
highlightbackground
anchor
background
aspect
justify
borderwidth
highlightcolor
width
font
textvariable
foreground
text
takefocus
highlightthickness
Methods:
standard methods (?)
bind
bindtags
cget
configure
destroy
grid
instate
methods
options
pack
place
state
textcopy
textcut
textpaste
notebook
Tk: ttk::notebook
Options
class
style
takefocus
height
padding
cursor
width
Methods:
standard methods
bind
bindtags
cget
configure
destroy
grid
identify
instate
methods
options
pack
place
state
textcopy
textcut
textpaste
widget specific methods
add
forget
hide
index
insert
select
tab
tabs
panedwindow
Tk: ttk::panedwindow
Options
orient
style
class
height
takefocus
cursor
width
Methods:
standard methods
bind
bindtags
cget
configure
destroy
grid
identify
instate
methods
options
pack
place
state
textcopy
textcut
textpaste
widget specific methods
add
forget
insert
pane
panes
sashpos
progressbar
Tk: ttk::progressbar
Options
orient
maximum
phase
class
cursor
style
takefocus
value
length
mode
variable
Methods:
standard methods
bind
bindtags
cget
configure
destroy
grid
identify
instate
methods
options
pack
place
state
textcopy
textcut
textpaste
widget specific methods
start
step
stop
radiobutton
Tk: ttk::radiobutton
Options
class
compound
cursor
padding
text
underline
width
state
image
style
takefocus
command
variable
value
textvariable
Methods:
standard methods
bind
bindtags
cget
configure
destroy
grid
identify
instate
methods
options
pack
place
state
textcopy
textcut
textpaste
widget specific methods
invoke
scale
Tk: ttk::scale
Options
orient
to
class
cursor
length
style
from
value
takefocus
command
variable
Methods:
standard methods
bind
bindtags
cget
configure
destroy
grid
identify
instate
methods
options
pack
place
state
textcopy
textcut
textpaste
widget specific methods
coords
get
set
scrollbar
Tk: ttk::scrollbar
Options
orient
style
command
takefocus
cursor
class
Methods:
standard methods
bind
bindtags
cget
configure
destroy
grid
identify
instate
methods
options
pack
place
state
textcopy
textcut
textpaste
widget specific methods
delta
fraction
get
set
separator
Tk: ttk::separator
Options
orient
style
takefocus
cursor
class
Methods:
standard methods
bind
bindtags