if the optionkey is down then put script of me into bkgnd field lowerpane
set cursor to 2
get the rect of me
BarButton 4
put the result into bkgnd field results
end mousedown
-- part 2 (button)
-- low flags: 00
-- high flags: 0002
-- rect: left=314 top=189 right=210 bottom=409
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 24
-- style flags: 0
-- line height: 32
-- part name:
----- HyperTalk script -----
on mousedown
if the optionkey is down then put script of me into bkgnd field lowerpane
set cursor to 2
get the rect of me
BarButton 2
put the result into bkgnd field results
end mousedown
-- part 3 (button)
-- low flags: 00
-- high flags: 0002
-- rect: left=408 top=209 right=229 bottom=498
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 24
-- style flags: 0
-- line height: 32
-- part name:
----- HyperTalk script -----
on mousedown
if the optionkey is down then put script of me into bkgnd field lowerpane
set cursor to 2
get the rect of me
BarButton 1
put the result into bkgnd field results
end mousedown
-- part 4 (button)
-- low flags: 00
-- high flags: 0002
-- rect: left=408 top=126 right=210 bottom=429
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 24
-- style flags: 0
-- line height: 32
-- part name:
----- HyperTalk script -----
on mousedown
if the optionkey is down then put script of me into bkgnd field lowerpane
set cursor to 2
get the rect of me
BarButton 3
put the result into bkgnd field results
end mousedown
-- part contents for background part 10
----- text -----
As you probably noticed by reading the scripts, the XCMD is called when you include the "BarButton" command in one of your scripts. You may optionally include up to four parameters after the BarButton command. The first parameter tells the XCMD to operate the bar in a particular direction:
1: left to right
2: right to left
3: bottom to top
4: top to bottom
So you can arrange some interesting graphic effects if you wish.
Of course you also have all of the regular Hypercard choices for the style of the button. The four Bar buttons on this card are Rectangle style. Their rectangles overlap one pixel where they touch.