[REBOL] Re: Adding 'alt-action to a text-list
From: brett:codeconscious at: 9-May-2002 0:11
Hi Alan,
> Is there a way to add an 'alt-action to each face of a 'text-list?
Sorry about the delay.
Text-list as it stands does not have the ability to do alt-actions. So
I have added it. Here I am creating a new style based on the existing
text-list style, but with the ability to do right-click actions.
Alternatively if you change "text-list-rc" to just "text-list" it will
modify the existing style.
I developed it under View 1.2.1 - not tested against the beta.
stylize/master [
text-list-rc: text-list with [
append init [
alt-act: :alt-action
iter/feel: make iter/feel [
engage: func [f a e] [
if a = 'down [
if cnt > length? head lines [exit]
if not e/control [f/state: cnt clear picked]
alter picked f/text
do :act slf f/text
]
if a = 'alt-down [
if cnt > length? head lines [exit]
if not e/control [f/state: cnt clear picked]
alter picked f/text
do :alt-act slf f/text
]
if a = 'up [f/state: none]
show pane
]
]
]
]
]
view layout [
text-list-rc data copy system/locale/months
[print now] [print face/picked]
]
Regards,
Brett.