Hi Brett,
Here is a little VID style element you can use to perform a particular
action onload. This will fire up after the
screen shows. The 'action is whatever is in the [] just like normal vid
stuff.
gadget: stylize [
onload image [
size: 1x1
rate: 1
cue: none
feel: make feel [
engage: func [face action event][
if action = 'time [
do face/action
face/rate: 0
feel/engage: none
show face
]
]
]
]
]
main-face: layout [styles gadget
size 440x220
at 0x0 onload [output/text: read http://www.rebol.com show output]
at 20x20 output: area
Button "Close" [quit]
]
view main-face
It can also be used to display a message, before and after the action like
this.
main-face: layout [styles gadget
size 440x220
at 0x0 status: onload "Loading..." 120x24 [
output/text: read http://www.rebol.com show output
status/text: "Loaded" show status
]
at 20x20 output: area
Button "Close" [quit]
]
view main-face
Hope this helps..
Cheers,
Allen K
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 11, 2000 1:40 PM
Subject: [REBOL] User defined events in /view ?
> Hi all,
> I've written a little Rebol app to learn on, which, on running, simply
reads
> my pop email box and displays the from, subject and date fields in a list.
>
> Now, the window does not show until the network read is done. Because the
> network read is slow, the window does not appear straight away. In fact
the
> Rebol icon does not appear on the task bar (Windows NT 4) until the window
> is created.
>
> In my Powerbuilder work, I strike the same problem when a user opens a
> window that must show the results of a database read. To the user this
looks
> like the application is slow.
>
> What is normally done in Powerbuilder is to declare a post-open event for
> the window. Then in the code that runs at window-open, POST a message to
the
> window's event queue. So that after the window opens and is painted (and
> anything else is done) the system comes to the post-open event which will
> then do the database call. The end result is that windows open almost
> instantaneously (so the user sees that it is working) and then the
> information fills down the page.
>
> I would like to achieve something similiar with my little learning rebol
> app. My guess is that the same technique could possibly be used, but I'm
not
> sure. Or others may have a different technique.
>
> I've considered opening a "dummy" initial window that then calls the other
> stuff , but I used to do that stuff years ago in more primitive (user
> interface days) so I would like something a little more neat and elegant
:)
>
> Brett.
>
>
>