Rebiol view Newbie question
[1/6] from: thahseen:hotma:il at: 27-Feb-2006 17:17
Hi
I have declared the following button:
btnSave: button "Save" [save-form]
Where [save-form] is the associated action.
Could some help me to How to find out later, what is the name of action
( save-form in this case ) associated with this button ?
Thanks
Thahseen
[2/6] from: kealist:gm:ail at: 27-Feb-2006 11:31
Thakseen,
Here is an example:
view layout [
a: area "stuff"
button "Save" [
write to-file request-file a/data
]
]
Depending on what data you are wanting to save you would need to
modify the code. Documentation on files can be found here:
http://www.rebol.com/docs/core23/rebolcore-12.html
Hope that was what you were looking for
Josh
On 2/27/06, Thahseen Mohammed <thahseen-hotmail.com> wrote:
[3/6] from: rebolek::gmail at: 27-Feb-2006 21:25
Hi Thahseen,
>> x: layout [a: btn [z]]
>> second get in a 'action
== [z]
Rebolek
On 2/27/06, Thahseen Mohammed <thahseen-hotmail.com> wrote:
> Hi
> I have declared the following button:
<<quoted lines omitted: 8>>
> To unsubscribe from the list, just send an email to
> lists at rebol.com with unsubscribe as the subject.
--
/
Boleslav Brezovsky
http://krutek.info
\
[4/6] from: carl:cybercraft at: 28-Feb-2006 0:27
On Monday, 27-February-2006 at 17:17:43 Thahseen Mohammed wrote,
>Hi
> I have declared the following button:
>
> btnSave: button "Save" [save-form]
>
> Where [save-form] is the associated action.
>
> Could some help me to How to find out later, what is the name of action
>( save-form in this case ) associated with this button ?
The block in a style is actually the body of a function. With your example, you'd access
the function like so...
btnSave/action
Now, you can examine a function like this...
>> fun: func [x][yyy]
>> first :fun
== [x]
>> second :fun
== [yyy]
However, the action function in a style has to be accessed via a path, which complicates
matters, but it's still accessible using GET and IN...
>> layout [btnSave: button "Save" [save-form]]
>> second get in btnSave 'action
== [save-form]
thus this (hopefully) returns you what you were wanting...
>> first second get in btnSave 'action
== save-form
-- Carl Read.
[5/6] from: anton:wilddsl:au at: 28-Feb-2006 16:13
Hi Thahseen,
I am suspicious of your intentions :)
I would like to know the reason you need to look inside
the action block. I think we might be able to refactor your
way of programming to be more efficient and "rebolish".
Regards,
Anton.
[6/6] from: thahseen:hot:mail at: 28-Feb-2006 14:36
Thanks Boleslav.
It worked.
Thahseen
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted