Skip to content

Commit 484b619

Browse files
committed
widgets: Clarify access to hilited items from hiliteChanged handler
Now that we don't pass a parameter to the "hiliteChanged" signal, update the default scripts for widgets that send the "hiliteChanged" signal to show how to access the hightlighted status and/or chunk information.
1 parent 26873a2 commit 484b619

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
script "com.livecode.widget.segmented.__DefaultScript"
2-
-- Sent when the set of highlighted segments changes
2+
-- Sent when a navigation item is clicked
3+
--
4+
-- Use the "hilitedItems" property to get the current item number and the
5+
-- "hilitedItemNames" property to get its item name
36
on hiliteChanged
4-
5-
end hiliteChanged
7+
put the hilitedItems of me && the hilitedItemNames of me
8+
end hiliteChanged
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
script "com.livecode.widget.svgpath.__DefaultScript"
22
on mouseUp
3+
-- Toggle the hilited property when clicked
34
set the hilited of me to (not the hilited of me)
45
end mouseUp
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
script "com.livecode.widget.switchbutton.__DefaultScript"
2-
on hiliteChanged pHilited
3-
2+
-- Sent when the switchbutton switches from off to on or from on to off.
3+
on hiliteChanged
4+
put the hilited of me
45
end hiliteChanged

0 commit comments

Comments
 (0)