FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonnative/src/pythonnative/native_views/desktop.py at main · andevsr/pythonnative · GitHub
andevsr
pythonnative
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonnative
/
src
/
pythonnative
/
native_views
/
desktop.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
2348 lines (2001 loc) · 91.8 KB
Breadcrumbs
pythonnative
/
src
/
pythonnative
/
native_views
/
desktop.py
Copy path
File metadata and controls
2348 lines (2001 loc) · 91.8 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
"""Desktop native-view handlers (Tkinter).
The desktop backend renders a PythonNative app in a real OS window so
the inner development loop doesn't require a device build. It is driven
by ``pn preview`` (which sets ``PN_PLATFORM=desktop``) and powers the
in-process Fast Refresh loop in ``pythonnative.preview``.
Like the iOS and Android backends, **layout is owned by the pure-Python
flex engine** in [`pythonnative.layout`][pythonnative.layout]: the
reconciler computes each view's ``(x, y, width, height)`` in points and
[`set_frame`][pythonnative.native_views.desktop.DesktopViewHandler.set_frame]
applies it. Handlers therefore only deal with *visual* props (text,
colors, fonts) and ignore everything in
[`LAYOUT_STYLE_KEYS`][pythonnative.layout.LAYOUT_STYLE_KEYS].
Event contract
--------------
Handlers never see Python callables. Each view stores its reconciler
tag (``widget._pn_tag``); Tk callbacks forward through
[`dispatch_event`][pythonnative.events.dispatch_event] with that tag,
and the Python-side [`EventRegistry`][pythonnative.events.EventRegistry]
routes to whatever closure the current render registered. Views with a
``gestures`` prop feed Tk pointer events into the shared pure-Python
[`GestureArbiter`][pythonnative.gestures.GestureArbiter].
Placement strategy
------------------
Tkinter fixes a widget's master at construction time, but the
reconciler creates views before parents (``CreateOp`` before
``InsertOp``). To bridge that, every widget is created under a single
shared *stage* frame (see
[`set_root_container`][pythonnative.native_views.desktop.set_root_container])
and positioned with ``place(in_=parent, ...)``. Tk's ``-in`` option
composes coordinates through nested parents, so the engine's
parent-relative frames render correctly without reparenting.
ScrollViews shift their children's placement by the current scroll
offset, which yields real wheel scrolling in the preview.
Interaction and stacking props
------------------------------
``z_index`` is honored among logical siblings: whenever a sibling set
contains an explicit ``z_index``, the parent's children are re-lifted
in ascending ``z_index`` order (missing values count as 0, ties keep
insertion order), so higher values render above their siblings.
``pointer_events`` is approximated by suspending a widget's Tk binding
tags: ``"none"`` mutes the view and its descendants, ``"box_none"``
mutes only the view itself, and ``"box_only"`` mutes only the
descendants. Suspension is reversible (the original tags are restored
when the prop returns to ``"auto"``), but it is coarser than the real
platforms: all bindings go quiet (keyboard included), and muted
widgets drop events rather than passing them through to whatever sits
underneath. ``hit_slop`` can't grow the initial press target (Tk
hit-tests presses strictly by widget bounds), but it does expand press
*tracking*: once a press starts, Tk's implicit grab keeps streaming
motion and release events to the pressed widget, and ``Pressable``
treats positions within the slop insets of its frame as still inside
when deciding whether a release fires ``on_press`` or a pending long
press survives pointer drift.
Scope
-----
This is a **preview** backend, not a production desktop target. It
favors fidelity of layout and behavior over pixel-perfect chrome:
shadows, per-widget opacity, and overflow clipping are approximated or
omitted (Tkinter can't express them cheaply). Rounded corners
(``border_radius`` plus the per-corner ``border_*_radius`` keys, which
fall back to it) are approximated on Frame-based views by painting the
background and a uniform border onto a covering ``Canvas``; the corner
cutouts are filled with the parent's solid background rather than
being truly transparent, and content leaves (Text, Button, Image)
ignore radius entirely. Native animation is declined
(``start_animation`` returns ``False``), so the Python ticker drives
previews of animations through ``set_animated_property``: translation
maps onto placement, animated ``background_color`` and ``color``
(including interpolated ``"#AARRGGBB"`` strings) map onto ``configure``
(or the rounded-corner canvas when one is active), and rotate, scale,
and opacity frames are silently ignored.
This module imports ``tkinter`` at import time, so it is only imported
when ``PN_PLATFORM=desktop``. Off-device unit tests inject a mock
registry via [`set_registry`][pythonnative.native_views.set_registry]
and never trigger this path.
"""
from
__future__
import
annotations
import
bisect
import
math
import
re
import
time
import
tkinter
as
tk
from
tkinter
import
font
as
tkfont
from
tkinter
import
ttk
from
typing
import
Any
,
Dict
,
List
,
Optional
,
Tuple
from
..
import
diagnostics
from
..
events
import
dispatch_event
,
event_names
from
..
gestures
import
make_arbiter
from
.
base
import
ViewHandler
# ======================================================================
# Stage / root container
# ======================================================================
#
# Every Tk widget the backend creates is a child of this single frame.
# ``pn preview`` installs it before mounting the app; the placement
# logic (``_place``) positions widgets *inside* their logical parent via
# Tk's ``-in`` option, which only works when both windows share a
# top-level, guaranteed by the single-stage design.
_ROOT_CONTAINER
:
Any
=
None
_DEFAULT_FONT_SIZE
=
15
def
set_root_container
(
container
:
Any
)
->
None
:
"""Install the stage frame that every desktop view is created under.
Called by ``pythonnative.preview`` before the first screen is
mounted. ``container`` must be a Tk widget (a ``Frame`` filling the
preview window). Also installs the global mouse-wheel binding that
powers ScrollView scrolling.
"""
global
_ROOT_CONTAINER
_ROOT_CONTAINER
=
container
_install_wheel_bindings
(
container
)
def
get_root_container
()
->
Any
:
"""Return the installed stage frame, or ``None`` if unset."""
return
_ROOT_CONTAINER
def
clear_root_container
()
->
None
:
"""Forget the stage frame (used when the preview window closes)."""
global
_ROOT_CONTAINER
_ROOT_CONTAINER
=
None
def
_master
()
->
Any
:
"""Return the master widget new views should be constructed under."""
if
_ROOT_CONTAINER
is
not
None
:
return
_ROOT_CONTAINER
# Fall back to Tk's default root so the handlers stay usable in a
# bare REPL / test that created a Tk root but no explicit stage.
return
tk
.
_get_default_root
()
# ======================================================================
# Color + font helpers
# ======================================================================
_NAMED_PASSTHROUGH
=
re
.
compile
(
r"^[A-Za-z][A-Za-z0-9 ]*$"
)
_BOLD_WORDS
=
frozenset
({
"bold"
,
"semibold"
,
"black"
,
"heavy"
,
"extrabold"
,
"extra_bold"
,
"semi_bold"
})
def
_tk_color
(
value
:
Any
)
->
Optional
[
str
]:
"""Convert a PythonNative color into a Tk color string.
Accepts ``#rgb`` / ``#rrggbb`` / ``#aarrggbb`` hex (alpha is
dropped; Tk has no per-color alpha), ``rgb()`` / ``rgba()``
functional notation, ``(r, g, b)`` tuples, packed integers, and
named colors (passed through for Tk to resolve). Returns ``None``
for ``transparent`` / unparseable values so callers can leave the
widget's default background untouched.
"""
if
value
is
None
or
isinstance
(
value
,
bool
):
return
None
if
isinstance
(
value
,
int
):
return
"#%06x"
%
(
value
&
0xFFFFFF
)
if
isinstance
(
value
, (
tuple
,
list
))
and
len
(
value
)
>=
3
:
try
:
r
,
g
,
b
=
(
int
(
value
[
0
])
&
255
,
int
(
value
[
1
])
&
255
,
int
(
value
[
2
])
&
255
)
return
"#%02x%02x%02x"
%
(
r
,
g
,
b
)
except
(
TypeError
,
ValueError
):
return
None
s
=
str
(
value
).
strip
()
if
not
s
:
return
None
low
=
s
.
lower
()
if
low
in
(
"transparent"
,
"clear"
,
"none"
):
return
None
if
s
.
startswith
(
"#"
):
hexd
=
s
[
1
:]
if
len
(
hexd
)
==
3
:
return
"#"
+
""
.
join
(
c
*
2
for
c
in
hexd
)
if
len
(
hexd
)
==
4
:
# #rgba -> drop alpha
return
"#"
+
""
.
join
(
c
*
2
for
c
in
hexd
[:
3
])
if
len
(
hexd
)
==
6
:
return
"#"
+
hexd
if
len
(
hexd
)
==
8
:
# #aarrggbb -> drop leading alpha
return
"#"
+
hexd
[
2
:]
return
None
if
low
.
startswith
(
"rgb"
):
nums
=
re
.
findall
(
r"[\d.]+"
,
s
)
if
len
(
nums
)
>=
3
:
try
:
r
,
g
,
b
=
(
int
(
float
(
nums
[
0
]))
&
255
,
int
(
float
(
nums
[
1
]))
&
255
,
int
(
float
(
nums
[
2
]))
&
255
)
return
"#%02x%02x%02x"
%
(
r
,
g
,
b
)
except
ValueError
:
return
None
return
None
if
_NAMED_PASSTHROUGH
.
match
(
s
):
return
s
return
None
def
_is_bold
(
props
:
Dict
[
str
,
Any
])
->
bool
:
"""Return whether the merged props imply a bold weight."""
if
props
.
get
(
"bold"
):
return
True
weight
=
props
.
get
(
"font_weight"
)
if
isinstance
(
weight
,
str
):
return
weight
.
lower
()
in
_BOLD_WORDS
if
isinstance
(
weight
, (
int
,
float
))
and
not
isinstance
(
weight
,
bool
):
return
float
(
weight
)
>=
600
return
False
def
_make_font
(
props
:
Dict
[
str
,
Any
])
->
Any
:
"""Build a ``tkinter.font.Font`` from the merged style props.
Sizes are passed as negative values (Tk's convention for *pixels*)
so the rendered text and ``measure_intrinsic`` agree with the
layout engine's pixel coordinate space.
"""
size
=
props
.
get
(
"font_size"
)
try
:
px
=
int
(
round
(
float
(
size
)))
if
size
is
not
None
else
_DEFAULT_FONT_SIZE
except
(
TypeError
,
ValueError
):
px
=
_DEFAULT_FONT_SIZE
px
=
max
(
1
,
px
)
kwargs
:
Dict
[
str
,
Any
]
=
{
"size"
:
-
px
,
"weight"
:
"bold"
if
_is_bold
(
props
)
else
"normal"
,
"slant"
:
"italic"
if
props
.
get
(
"italic"
)
else
"roman"
,
}
family
=
props
.
get
(
"font_family"
)
if
family
:
kwargs
[
"family"
]
=
str
(
family
)
decoration
=
props
.
get
(
"text_decoration"
)
if
decoration
==
"underline"
:
kwargs
[
"underline"
]
=
1
elif
decoration
==
"line_through"
:
kwargs
[
"overstrike"
]
=
1
try
:
return
tkfont
.
Font
(
**
kwargs
)
except
Exception
:
return
tkfont
.
Font
(
size
=
-
px
)
def
_measure_text
(
font
:
Any
,
text
:
str
,
max_width
:
float
)
->
Tuple
[
float
,
float
]:
"""Return the ``(width, height)`` a string occupies in ``font``.
Honors explicit newlines and greedily word-wraps paragraphs wider
than ``max_width`` (``math.inf`` means no wrap) so multi-line
``Text`` measures the same height the engine will lay out.
"""
try
:
line_h
=
float
(
font
.
metrics
(
"linespace"
))
except
Exception
:
line_h
=
float
(
_DEFAULT_FONT_SIZE
+
4
)
if
not
text
:
return
(
0.0
,
line_h
)
bounded
=
math
.
isfinite
(
max_width
)
and
max_width
>
0
longest
=
0.0
lines
=
0
for
paragraph
in
text
.
split
(
"
\n
"
):
if
not
paragraph
:
lines
+=
1
continue
para_w
=
float
(
font
.
measure
(
paragraph
))
if
not
bounded
or
para_w
<=
max_width
:
lines
+=
1
longest
=
max
(
longest
,
para_w
)
continue
current
=
""
for
word
in
paragraph
.
split
(
" "
):
trial
=
word
if
not
current
else
current
+
" "
+
word
if
not
current
or
font
.
measure
(
trial
)
<=
max_width
:
current
=
trial
else
:
lines
+=
1
longest
=
max
(
longest
,
float
(
font
.
measure
(
current
)))
current
=
word
lines
+=
1
longest
=
max
(
longest
,
float
(
font
.
measure
(
current
)))
width
=
min
(
longest
,
max_width
)
if
bounded
else
longest
return
(
math
.
ceil
(
width
),
math
.
ceil
(
lines
*
line_h
))
def
_finite
(
value
:
Any
,
default
:
float
=
0.0
)
->
float
:
"""Coerce ``value`` to a finite float, clamping NaN/inf to ``default``."""
try
:
f
=
float
(
value
)
except
(
TypeError
,
ValueError
):
return
default
return
f
if
math
.
isfinite
(
f
)
else
default
# ======================================================================
# Event dispatch helpers
# ======================================================================
def
_fire
(
widget
:
Any
,
name
:
str
,
*
args
:
Any
)
->
None
:
"""Dispatch event ``name`` for ``widget`` through the tag registry."""
tag
=
getattr
(
widget
,
"_pn_tag"
,
None
)
if
tag
is
not
None
:
dispatch_event
(
tag
,
name
,
*
args
)
def
_has_event
(
widget
:
Any
,
name
:
str
)
->
bool
:
"""Whether the element wired a callback named ``name`` this render."""
merged
=
getattr
(
widget
,
"_pn_props"
,
None
)
or
{}
return
name
in
event_names
(
merged
)
# ======================================================================
# Placement (ordering-independent, scroll-aware)
# ======================================================================
def
_merge_props
(
widget
:
Any
,
props
:
Dict
[
str
,
Any
])
->
Dict
[
str
,
Any
]:
"""Accumulate ``props`` onto the widget so partial updates stay coherent.
The reconciler delivers only *changed* keys on update; Tk needs the
full picture to rebuild a font or re-derive a layout, so each
widget caches its merged props under ``_pn_props``.
"""
merged
:
Dict
[
str
,
Any
]
=
getattr
(
widget
,
"_pn_props"
,
None
)
or
{}
merged
.
update
(
props
)
widget
.
_pn_props
=
merged
return
merged
def
_place
(
widget
:
Any
)
->
None
:
"""Position ``widget`` inside its logical parent, if both are known.
Idempotent and order-independent: ``set_frame`` records the frame
and ``insert_child`` records the parent; whichever runs second
triggers the actual ``place``. Coordinates compose through nested
``-in`` parents, so a child's parent-relative frame lands at the
right absolute spot. A scrollable parent shifts every child by its
current scroll offset.
"""
frame
=
getattr
(
widget
,
"_pn_frame"
,
None
)
if
frame
is
None
:
return
parent
=
getattr
(
widget
,
"_pn_parent"
,
None
)
target
=
parent
if
parent
is
not
None
else
get_root_container
()
if
target
is
None
:
return
x
,
y
,
w
,
h
=
frame
tx
,
ty
=
getattr
(
widget
,
"_pn_translate"
, (
0.0
,
0.0
))
sx
,
sy
=
getattr
(
target
,
"_pn_scroll_offset"
, (
0.0
,
0.0
))
if
parent
is
not
None
else
(
0.0
,
0.0
)
try
:
widget
.
place
(
in_
=
target
,
x
=
x
+
tx
-
sx
,
y
=
y
+
ty
-
sy
,
width
=
max
(
0.0
,
w
),
height
=
max
(
0.0
,
h
))
widget
.
lift
()
except
Exception
:
diagnostics
.
swallowed
(
"desktop._place"
)
return
# The unconditional lift above would put a low ``z_index`` sibling
# on top, so restack whenever this sibling set uses ``z_index``.
if
parent
is
not
None
and
getattr
(
parent
,
"_pn_has_z"
,
False
):
_restack
(
parent
)
# Frames are the only reliable resize signal for unmapped widgets,
# so keep the rounded background in sync here (cheap when the
# paint signature is unchanged).
if
getattr
(
widget
,
"_pn_radius_canvas"
,
None
)
is
not
None
:
_redraw_rounded_background
(
widget
)
def
_register_child
(
parent
:
Any
,
child
:
Any
,
index
:
int
)
->
None
:
"""Track ``child`` in ``parent``'s ordered child list at ``index``."""
children
:
List
[
Any
]
=
getattr
(
parent
,
"_pn_children"
,
None
)
or
[]
if
child
in
children
:
children
.
remove
(
child
)
children
.
insert
(
min
(
max
(
index
,
0
),
len
(
children
)),
child
)
parent
.
_pn_children
=
children
def
_unregister_child
(
parent
:
Any
,
child
:
Any
)
->
None
:
children
:
List
[
Any
]
=
getattr
(
parent
,
"_pn_children"
,
None
)
or
[]
try
:
children
.
remove
(
child
)
except
ValueError
:
pass
parent
.
_pn_children
=
children
def
_z_index
(
widget
:
Any
)
->
float
:
"""Return the widget's ``z_index`` (missing or unparseable is 0)."""
merged
=
getattr
(
widget
,
"_pn_props"
,
None
)
or
{}
z
=
merged
.
get
(
"z_index"
)
if
z
is
None
:
return
0.0
try
:
return
float
(
z
)
except
(
TypeError
,
ValueError
):
return
0.0
def
_lift_subtree
(
widget
:
Any
)
->
None
:
"""Lift ``widget``, then its logical descendants in ``z_index`` order.
Every desktop widget is a Tk child of the shared stage, so
stacking is one global order: lifting a container doesn't carry
its subtree along. Pre-order lifting keeps each subtree above its
root and applies nested ``z_index`` ordering along the way.
"""
try
:
widget
.
lift
()
except
Exception
:
diagnostics
.
swallowed
(
"desktop._lift_subtree"
)
for
child
in
sorted
(
getattr
(
widget
,
"_pn_children"
,
None
)
or
[],
key
=
_z_index
):
_lift_subtree
(
child
)
def
_restack
(
parent
:
Any
)
->
None
:
"""Re-lift ``parent``'s children (and their subtrees) by ``z_index``.
``sorted`` is stable, so siblings with equal ``z_index`` keep their
insertion order. Called whenever a sibling set contains an explicit
``z_index`` (see ``_place`` and ``_apply_common``).
"""
for
child
in
sorted
(
getattr
(
parent
,
"_pn_children"
,
None
)
or
[],
key
=
_z_index
):
_lift_subtree
(
child
)
# ----------------------------------------------------------------------
# ``pointer_events`` (best-effort via Tk binding tags)
# ----------------------------------------------------------------------
#
# A muted widget gets a single dummy binding tag with no bindings, so
# no event scripts (its own, its class's, or the global "all" tag's)
# run while the mode is active; the original tags are saved and
# restored when the prop returns to "auto". This is coarser than the
# real platforms: keyboard bindings go quiet too, and Tk still routes
# the event to the widget under the cursor, so muted widgets drop
# events instead of letting them fall through to lower widgets.
_PE_MUTED_TAG
=
"pn_pointer_events_off"
def
_pointer_mode
(
widget
:
Any
)
->
str
:
"""Return the widget's own ``pointer_events`` mode (default ``"auto"``)."""
merged
=
getattr
(
widget
,
"_pn_props"
,
None
)
or
{}
mode
=
merged
.
get
(
"pointer_events"
)
return
mode
if
mode
in
(
"none"
,
"box_none"
,
"box_only"
)
else
"auto"
def
_pointer_muted
(
widget
:
Any
)
->
bool
:
"""Whether the widget should ignore pointer events right now.
True when its own mode mutes the view (``"none"`` / ``"box_none"``)
or when any logical ancestor mutes its subtree (``"none"`` /
``"box_only"``).
"""
if
_pointer_mode
(
widget
)
in
(
"none"
,
"box_none"
):
return
True
node
=
getattr
(
widget
,
"_pn_parent"
,
None
)
while
node
is
not
None
:
if
_pointer_mode
(
node
)
in
(
"none"
,
"box_only"
):
return
True
node
=
getattr
(
node
,
"_pn_parent"
,
None
)
return
False
def
_set_pointer_muted
(
widget
:
Any
,
muted
:
bool
)
->
None
:
"""Suspend or restore the widget's Tk binding tags (idempotent)."""
try
:
current
=
tuple
(
widget
.
bindtags
())
if
muted
:
if
current
!=
(
_PE_MUTED_TAG
,):
widget
.
_pn_saved_bindtags
=
current
widget
.
bindtags
((
_PE_MUTED_TAG
,))
elif
current
==
(
_PE_MUTED_TAG
,):
saved
=
getattr
(
widget
,
"_pn_saved_bindtags"
,
None
)
if
saved
:
widget
.
bindtags
(
saved
)
except
Exception
:
diagnostics
.
swallowed
(
"desktop._set_pointer_muted"
)
def
_refresh_pointer_events
(
widget
:
Any
)
->
None
:
"""Recompute pointer muting for ``widget`` and its logical subtree."""
muted
=
_pointer_muted
(
widget
)
_set_pointer_muted
(
widget
,
muted
)
canvas
=
getattr
(
widget
,
"_pn_radius_canvas"
,
None
)
if
canvas
is
not
None
:
# The rounded-corner canvas covers the widget and forwards
# events to it (see ``_set_rounded_background``), so it mutes
# exactly when its host does.
_set_pointer_muted
(
canvas
,
muted
)
for
child
in
getattr
(
widget
,
"_pn_children"
,
None
)
or
[]:
_refresh_pointer_events
(
child
)
# ----------------------------------------------------------------------
# ``hit_slop`` (press-tracking expansion)
# ----------------------------------------------------------------------
#
# Tk delivers the initial press only to the widget under the cursor,
# so the slop insets can't grow the press target the way they do on
# device. They do expand the *tracking* rect: Tk's implicit grab keeps
# streaming motion and release events to the pressed widget even past
# its edges, and ``_within_hit_rect`` treats positions within the slop
# insets of the widget's frame as inside.
def
_parse_hit_slop
(
value
:
Any
)
->
Tuple
[
float
,
float
,
float
,
float
]:
"""Normalize a ``hit_slop`` prop into ``(top, left, bottom, right)`` insets.
Accepts a uniform number or a dict with any of ``top`` / ``left``
/ ``bottom`` / ``right``; missing or unparseable entries are 0.
"""
if
isinstance
(
value
,
dict
):
return
(
max
(
0.0
,
_finite
(
value
.
get
(
"top"
))),
max
(
0.0
,
_finite
(
value
.
get
(
"left"
))),
max
(
0.0
,
_finite
(
value
.
get
(
"bottom"
))),
max
(
0.0
,
_finite
(
value
.
get
(
"right"
))),
)
uniform
=
max
(
0.0
,
_finite
(
value
))
return
(
uniform
,
uniform
,
uniform
,
uniform
)
def
_within_hit_rect
(
widget
:
Any
,
x
:
float
,
y
:
float
)
->
bool
:
"""Whether a widget-relative point is inside the frame plus ``hit_slop``.
Falls back to the live Tk size when the layout frame isn't known
yet, and to "inside" when neither is available (never drop a press
for lack of geometry).
"""
frame
=
getattr
(
widget
,
"_pn_frame"
,
None
)
if
frame
is
not
None
:
w
,
h
=
frame
[
2
],
frame
[
3
]
else
:
try
:
w
,
h
=
float
(
widget
.
winfo_width
()),
float
(
widget
.
winfo_height
())
except
Exception
:
return
True
top
,
left
,
bottom
,
right
=
getattr
(
widget
,
"_pn_hit_slop"
, (
0.0
,
0.0
,
0.0
,
0.0
))
return
(
-
left
<=
x
<=
w
+
right
)
and
(
-
top
<=
y
<=
h
+
bottom
)
# ----------------------------------------------------------------------
# Rounded corners (Canvas approximation)
# ----------------------------------------------------------------------
#
# Tk widgets are rectangles and can't be clipped, so Frame-based views
# with a border radius get a full-size Canvas child that paints the
# background (and a uniform border outline) as a rounded polygon. The
# corner cutouts can't be transparent; they're filled with the logical
# parent's background color, which reads correctly whenever the parent
# paints a solid color behind the view. Content leaves (Text, Button,
# Image) skip the approximation entirely: a covering canvas would hide
# what they draw.
_RADIUS_ARC_STEPS
=
8
_SIDE_BORDER_WIDTH_KEYS
=
(
"border_left_width"
,
"border_top_width"
,
"border_right_width"
,
"border_bottom_width"
,
)
def
_corner_radii
(
props
:
Dict
[
str
,
Any
])
->
Tuple
[
float
,
float
,
float
,
float
]:
"""Resolve ``(top-left, top-right, bottom-right, bottom-left)`` radii.
Per-corner keys fall back to ``border_radius``; missing values are
0. Negative or unparseable values clamp to 0.
"""
base
=
max
(
0.0
,
_finite
(
props
.
get
(
"border_radius"
)))
def
_one
(
key
:
str
)
->
float
:
value
=
props
.
get
(
key
)
if
value
is
None
:
return
base
return
max
(
0.0
,
_finite
(
value
,
base
))
return
(
_one
(
"border_top_left_radius"
),
_one
(
"border_top_right_radius"
),
_one
(
"border_bottom_right_radius"
),
_one
(
"border_bottom_left_radius"
),
)
def
_resolve_border
(
props
:
Dict
[
str
,
Any
])
->
Tuple
[
float
,
str
]:
"""Resolve the uniform ``(width, color)`` border approximation.
Tk borders are uniform, so per-side borders collapse to the widest
side's width and the first nonzero side's color.
"""
width
=
props
.
get
(
"border_width"
)
color
=
_tk_color
(
props
.
get
(
"border_color"
))
or
"#3c3c43"
side_widths
=
[
props
.
get
(
k
)
for
k
in
_SIDE_BORDER_WIDTH_KEYS
]
if
any
(
w
is
not
None
for
w
in
side_widths
):
width
=
max
(
float
(
w
)
for
w
in
side_widths
if
w
is
not
None
)
for
side
,
w
in
zip
((
"left"
,
"top"
,
"right"
,
"bottom"
),
side_widths
):
if
w
is
not
None
and
float
(
w
)
>
0
:
side_color
=
_tk_color
(
props
.
get
(
f"border_
{
side
}
_color"
))
if
side_color
is
not
None
:
color
=
side_color
break
return
(
max
(
0.0
,
_finite
(
width
)),
color
)
def
_underlay_color
(
widget
:
Any
)
->
str
:
"""Best-effort color of whatever paints behind ``widget``.
Used to fill the corner cutouts of a rounded view: the logical
parent's rounded fill when it has one, else its plain Tk
background. A solid guess is the documented limitation; gradients
or images behind a rounded view can't be matched.
"""
parent
=
getattr
(
widget
,
"_pn_parent"
,
None
)
target
=
parent
if
parent
is
not
None
else
get_root_container
()
if
target
is
not
None
:
state
=
getattr
(
target
,
"_pn_radius_state"
,
None
)
if
state
is
not
None
and
state
.
get
(
"fill"
):
return
str
(
state
[
"fill"
])
try
:
return
str
(
target
.
cget
(
"background"
))
except
Exception
:
pass
return
"#ffffff"
def
_rounded_rect_points
(
w
:
float
,
h
:
float
,
radii
:
Tuple
[
float
,
float
,
float
,
float
])
->
List
[
float
]:
"""Vertices of a rounded rectangle, corner arcs sampled clockwise.
Radii are clamped proportionally so adjacent corners never
overlap. A zero radius degenerates to the plain corner point.
"""
tl
,
tr
,
br
,
bl
=
radii
scale
=
min
(
1.0
,
w
/
max
(
1e-6
,
tl
+
tr
),
w
/
max
(
1e-6
,
bl
+
br
),
h
/
max
(
1e-6
,
tl
+
bl
),
h
/
max
(
1e-6
,
tr
+
br
),
)
tl
,
tr
,
br
,
bl
=
(
r
*
scale
for
r
in
(
tl
,
tr
,
br
,
bl
))
points
:
List
[
float
]
=
[]
def
_arc
(
cx
:
float
,
cy
:
float
,
r
:
float
,
start_deg
:
float
)
->
None
:
if
r
<=
0
:
points
.
extend
((
cx
,
cy
))
return
for
step
in
range
(
_RADIUS_ARC_STEPS
+
1
):
a
=
math
.
radians
(
start_deg
-
90.0
*
step
/
_RADIUS_ARC_STEPS
)
points
.
extend
((
cx
+
r
*
math
.
cos
(
a
),
cy
-
r
*
math
.
sin
(
a
)))
_arc
(
tl
,
tl
,
tl
,
180.0
)
_arc
(
w
-
tr
,
tr
,
tr
,
90.0
)
_arc
(
w
-
br
,
h
-
br
,
br
,
0.0
)
_arc
(
bl
,
h
-
bl
,
bl
,
-
90.0
)
return
points
def
_redraw_rounded_background
(
widget
:
Any
)
->
None
:
"""Repaint the rounded background canvas if its inputs changed.
Sizes prefer the layout frame (kept current by ``_place``) over
``winfo_*`` so the polygon is right even before Tk maps the
window. Redraws are skipped when the (size, colors, radii,
underlay) signature matches the last paint.
"""
canvas
=
getattr
(
widget
,
"_pn_radius_canvas"
,
None
)
state
=
getattr
(
widget
,
"_pn_radius_state"
,
None
)
if
canvas
is
None
or
state
is
None
:
return
frame
=
getattr
(
widget
,
"_pn_frame"
,
None
)
if
frame
is
not
None
and
frame
[
2
]
>
0
and
frame
[
3
]
>
0
:
w
,
h
=
frame
[
2
],
frame
[
3
]
else
:
try
:
w
,
h
=
float
(
canvas
.
winfo_width
()),
float
(
canvas
.
winfo_height
())
except
Exception
:
return
if
w
<=
1
or
h
<=
1
:
return
under
=
_underlay_color
(
widget
)
signature
=
(
w
,
h
,
state
[
"radii"
],
state
[
"fill"
],
state
[
"outline"
],
state
[
"outline_width"
],
under
)
if
state
.
get
(
"drawn"
)
==
signature
:
return
state
[
"drawn"
]
=
signature
try
:
canvas
.
configure
(
background
=
under
)
canvas
.
delete
(
"all"
)
if
state
[
"fill"
]
or
state
[
"outline"
]:
canvas
.
create_polygon
(
_rounded_rect_points
(
w
,
h
,
state
[
"radii"
]),
fill
=
state
[
"fill"
]
or
""
,
outline
=
state
[
"outline"
],
width
=
max
(
1.0
,
state
[
"outline_width"
]),
)
except
Exception
:
diagnostics
.
swallowed
(
"desktop._redraw_rounded_background"
)
def
_set_rounded_background
(
widget
:
Any
,
radii
:
Tuple
[
float
,
float
,
float
,
float
],
props
:
Dict
[
str
,
Any
])
->
None
:
"""Install (or refresh) the rounded background canvas on ``widget``."""
border_width
,
border_color
=
_resolve_border
(
props
)
widget
.
_pn_radius_state
=
{
"radii"
:
radii
,
"fill"
:
_tk_color
(
props
.
get
(
"background_color"
)),
"outline"
:
border_color
if
border_width
else
""
,
"outline_width"
:
border_width
,
}
canvas
=
getattr
(
widget
,
"_pn_radius_canvas"
,
None
)
if
canvas
is
None
:
try
:
canvas
=
tk
.
Canvas
(
widget
,
highlightthickness
=
0
,
bd
=
0
)
canvas
.
place
(
x
=
0
,
y
=
0
,
relwidth
=
1.0
,
relheight
=
1.0
)
# Below any direct Tk children the handler owns (TabBar /
# SegmentedControl buttons); PythonNative children live on
# the stage and are lifted above the whole frame anyway.
# ``Canvas.lower`` is the canvas-item method, so reach for
# the widget-stacking ``Misc.lower`` explicitly.
tk
.
Misc
.
lower
(
canvas
)
# Clicks over the frame now land on the covering canvas,
# so append the frame's bindtag: its gesture and press
# bindings keep firing, with matching coordinates (the
# canvas fills the frame exactly).
canvas
.
bindtags
(
tuple
(
canvas
.
bindtags
())
+
(
str
(
widget
),))
canvas
.
bind
(
"<Configure>"
,
lambda
_e
:
_redraw_rounded_background
(
widget
),
add
=
"+"
)
except
Exception
:
diagnostics
.
swallowed
(
"desktop._set_rounded_background"
)
return
canvas
.
_pn_parent
=
widget
# wheel hit-testing walks through
widget
.
_pn_radius_canvas
=
canvas
_set_pointer_muted
(
canvas
,
_pointer_muted
(
widget
))
_redraw_rounded_background
(
widget
)
def
_clear_rounded_background
(
widget
:
Any
)
->
None
:
"""Drop the rounded background canvas when radii return to zero."""
canvas
=
getattr
(
widget
,
"_pn_radius_canvas"
,
None
)
if
canvas
is
None
:
return
widget
.
_pn_radius_canvas
=
None
widget
.
_pn_radius_state
=
None
try
:
canvas
.
destroy
()
except
Exception
:
diagnostics
.
swallowed
(
"desktop._clear_rounded_background"
)
def
_set_translate_from_transform
(
widget
:
Any
,
spec
:
Any
)
->
None
:
"""Extract a translate offset from a ``transform`` prop for placement.
Tkinter can't scale or rotate widgets, but translation maps cleanly
onto ``place`` coordinates, so animated/transformed views still move
in the preview. Scale and rotate are ignored.
"""
tx
=
0.0
ty
=
0.0
if
spec
is
not
None
:
entries
=
spec
if
isinstance
(
spec
,
list
)
else
[
spec
]
for
entry
in
entries
:
if
not
isinstance
(
entry
,
dict
):
continue
if
"translate_x"
in
entry
:
tx
=
_finite
(
entry
[
"translate_x"
])
if
"translate_y"
in
entry
:
ty
=
_finite
(
entry
[
"translate_y"
])
widget
.
_pn_translate
=
(
tx
,
ty
)
def
_apply_common
(
widget
:
Any
,
props
:
Dict
[
str
,
Any
])
->
None
:
"""Apply visual props shared across most handlers (bg, border, transform)."""
radii
=
_corner_radii
(
props
)
if
isinstance
(
widget
,
tk
.
Frame
)
else
(
0.0
,
0.0
,
0.0
,
0.0
)
rounded
=
any
(
r
>
0
for
r
in
radii
)
if
"background_color"
in
props
and
not
rounded
:
color
=
_tk_color
(
props
[
"background_color"
])
if
color
is
not
None
:
try
:
widget
.
configure
(
background
=
color
)
except
Exception
:
diagnostics
.
swallowed
(
"desktop._apply_common"
)
if
rounded
:
# Background and border move onto the rounded canvas; the
# square highlight border would poke out of the corners.
try
:
widget
.
configure
(
highlightthickness
=
0
)
except
Exception
:
diagnostics
.
swallowed
(
"desktop._apply_common"
)
_set_rounded_background
(
widget
,
radii
,
props
)
else
:
_clear_rounded_background
(
widget
)
if
any
(
k
in
props
for
k
in
(
"border_width"
,
"border_color"
,
*
_SIDE_BORDER_WIDTH_KEYS
)):
try
:
width
,
color
=
_resolve_border
(
props
)
if
width
:
widget
.
configure
(
highlightthickness
=
int
(
round
(
width
)),
highlightbackground
=
color
,
highlightcolor
=
color
,
)
else
:
widget
.
configure
(
highlightthickness
=
0
)
except
Exception
:
diagnostics
.
swallowed
(
"desktop._apply_common"
)
if
"hit_slop"
in
props
:
widget
.
_pn_hit_slop
=
_parse_hit_slop
(
props
.
get
(
"hit_slop"
))
if
"test_id"
in
props
and
props
[
"test_id"
]
is
not
None
:
# Stamped for introspection so preview-level tooling and tests
# can locate widgets the same way Maestro does on device.
widget
.
_pn_test_id
=
str
(
props
[
"test_id"
])
if
"transform"
in
props
:
_set_translate_from_transform
(
widget
,
props
[
"transform"
])
_place
(
widget
)
if
"z_index"
in
props
:
parent
=
getattr
(
widget
,
"_pn_parent"
,
None
)
if
parent
is
not
None
:
parent
.
_pn_has_z
=
True
_restack
(
parent
)
if
"pointer_events"
in
props
:
_refresh_pointer_events
(
widget
)
# ======================================================================
# Gesture wiring (pure-Python arbiter over Tk pointer events)
# ======================================================================
def
_wire_gestures
(
widget
:
Any
,
specs
:
Any
)
->
None
:
"""Feed Tk pointer events on ``widget`` into a `GestureArbiter`.
The arbiter emits ``(gesture_index, payload)`` pairs which are
forwarded as ``gesture:<i>`` events for this widget's tag. Long
presses use Tk's ``after`` timer to poll the arbiter at its next
deadline.
"""
if
not
isinstance
(
specs
, (
list
,
tuple
))
or
not
specs
:
widget
.
_pn_arbiter
=
None
return
def
_emit
(
index
:
int
,
payload
:
Dict
[
str
,
Any
])
->
None
:
_fire
(
widget
,
f"gesture:
{
index
}
"
,
payload
)
arbiter
=
make_arbiter
([
s
for
s
in
specs
if
isinstance
(
s
,
dict
)],
_emit
)
widget
.
_pn_arbiter
=
arbiter
if
getattr
(
widget
,
"_pn_gestures_bound"
,
False
):
return
widget
.
_pn_gestures_bound
=
True
def
_schedule_poll
()
->
None
:
current
=
getattr
(
widget
,
"_pn_arbiter"
,
None
)
if
current
is
None
:
return
deadline
=
current
.
next_deadline
()
if
deadline
is
None
:
return
delay_ms
=
max
(
1
,
int
((
deadline
-
time
.
monotonic
())
*
1000.0
))
def
_poll
()
->
None
:
live
=
getattr
(
widget
,
"_pn_arbiter"
,
None
)
if
live
is
not
None
:
live
.
poll
(
time
.
monotonic
())
_schedule_poll
()
try
:
widget
.
after
(
delay_ms
,
_poll
)
except
Exception
:
diagnostics
.
swallowed
(
"desktop._wire_gestures._schedule_poll"
)
def
_on_down
(
event
:
Any
)
->
None
:
current
=
getattr
(
widget
,
"_pn_arbiter"
,
None
)
if
current
is
not
None
:
current
.
pointer_down
(
0
,
float
(
event
.
x
),
float
(
event
.
y
),
time
.
monotonic
())
_schedule_poll
()
def
_on_move
(
event
:
Any
)
->
None
:
current
=
getattr
(
widget
,
"_pn_arbiter"
,
None
)
if
current
is
not
None
:
current
.
pointer_move
(
0
,
float
(
event
.
x
),
float
(
event
.
y
),
time
.
monotonic
())
def
_on_up
(
event
:
Any
)
->
None
:
current
=
getattr
(
widget
,
"_pn_arbiter"
,
None
)
if
current
is
not
None
:
current
.
pointer_up
(
0
,
float
(
event
.
x
),
float
(
event
.
y
),
time
.
monotonic
())
try
:
widget
.
bind
(
"<ButtonPress-1>"
,
_on_down
,
add
=
"+"
)
widget
.
bind
(
"<B1-Motion>"
,
_on_move
,
add
=
"+"
)
widget
.
bind
(
"<ButtonRelease-1>"
,
_on_up
,
add
=
"+"
)
except
Exception
:
diagnostics
.
swallowed
(
"desktop._wire_gestures"
)
# ======================================================================
# ScrollView wheel support
# ======================================================================
_WHEEL_BOUND
=
False
def
_install_wheel_bindings
(
container
:
Any
)
->
None
:
"""Install the global wheel handler that drives preview scrolling.
Tk pointer events don't bubble, so a single ``bind_all`` on the
toplevel hit-tests the widget under the cursor and walks the
logical ``_pn_parent`` chain to the nearest scrollable ancestor.
"""
global
_WHEEL_BOUND
if
_WHEEL_BOUND
:
return
try
:
top
=
container
.
winfo_toplevel
()
except
Exception
:
return
def
_on_wheel
(
event
:
Any
)
->
None
:
delta
=
getattr
(
event
,
"delta"
,
0
)
if
getattr
(
event
,
"num"
,
None
)
==
4
:
delta
=
120
elif
getattr
(
event
,
"num"
,
None
)
==
5
:
delta
=
-
120
if
not
delta
:
return
try
:
under
=
event
.
widget
.
winfo_containing
(
event
.
x_root
,
event
.
y_root
)
except
Exception
:
under
=
None
node
=
under
while
node
is
not
None
:
if
getattr
(
node
,
"_pn_scrollable"
,
False
):
_scroll_by
(
node
,
delta
)
return
node
=
getattr
(
node
,
"_pn_parent"
,
None
)
try
:
top
.
bind_all
(
"<MouseWheel>"
,
_on_wheel
,
add
=
"+"
)
top
.
bind_all
(
"<Button-4>"
,
_on_wheel
,
add
=
"+"
)
top
.
bind_all
(
"<Button-5>"
,
_on_wheel
,
add
=
"+"
)
_WHEEL_BOUND
=
True
except
Exception
:
diagnostics
.
swallowed
(
"desktop._install_wheel_bindings"
)
def
_content_extent
(
widget
:
Any
)
->
Tuple
[
float
,
float
]:
"""Max (right, bottom) edge over the scroll container's children.
Containers that window their children (``VirtualList``) publish
the full logical extent via ``_pn_content_extent`` so clamping
covers rows that aren't currently mounted.
"""
override
=
getattr
(
widget
,
"_pn_content_extent"
,
None
)
if
override
is
not
None
:
return
override
max_x
=
0.0
max_y
=
0.0
for
child
in
getattr
(
widget
,
"_pn_children"
, [])
or
[]:
frame
=
getattr
(
child
,
"_pn_frame"
,
None
)
if
frame
is
None
:
continue
x
,
y
,
w
,
h
=
frame
max_x
=
max
(
max_x
,
x
+
w
)
max_y
=
max
(
max_y
,
y
+
h
)
return
(
max_x
,
max_y
)
def
_scroll_to
(
widget
:
Any
,
x
:
float
,
y
:
float
,
fire_event
:
bool
=
True
)
->
None
:
"""Set a scroll container's offset, clamped to its content extent."""
frame
=
getattr
(
widget
,
"_pn_frame"
,
None
)
vw
=
frame
[
2
]
if
frame
else
0.0
vh
=
frame
[
3
]
if
frame
else
0.0
content_w
,
content_h
=
_content_extent
(
widget
)
max_x
=
max
(
0.0
,
content_w
-
vw
)
max_y
=
max
(
0.0
,
content_h
-
vh
)
new_offset
=
(
min
(
max
(
0.0
,
x
),
max_x
),
min
(
max
(
0.0
,
y
),
max_y
))
if
new_offset
==
getattr
(
widget
,
"_pn_scroll_offset"
, (
0.0
,
0.0
)):
return
widget
.
_pn_scroll_offset
=
new_offset
for
child
in
getattr
(
widget
,
"_pn_children"
, [])
or
[]:
_place
(
child
)
hook
=
getattr
(
widget
,
"_pn_scroll_hook"
,
None
)
if
hook
is
not
None
:
# ``VirtualList`` re-windows its rows and reports the richer
# native-list scroll payload instead of the default event.
hook
(
new_offset
,
fire_event
)
elif
fire_event
:
_fire
(
widget
,
"on_scroll"
, {
"x"
:
new_offset
[
0
],
"y"
:
new_offset
[
1
]})
def
_scroll_by
(
widget
:
Any
,
wheel_delta
:
float
)
->
None
:
sx
,
sy
=
getattr
(
widget
,
"_pn_scroll_offset"
, (
0.0
,
0.0
))
step
=
-
wheel_delta
# natural direction: wheel up scrolls content up
horizontal
=
(
getattr
(
widget
,
"_pn_props"
, {})
or
{}).
get
(
"scroll_axis"
)
==
"horizontal"
if
horizontal
:
_scroll_to
(
widget
,
sx
+
step
,
sy
)
else
:
_scroll_to
(
widget
,
sx
,
sy
+
step
)
View remainder of file in raw view
Back
|
FazBrowse Home
|
New Git URL