Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

How to manage data without events (in view)

 [1/6] from: ale870::gmail::com at: 26-Apr-2006 23:53


Dear all, I'm a newbe in Rebol. I'm creating a Rebol application, and I need to display a progress bar (I'm using RebGUI, but I think the concept is the same using classic view) without user interaction. I hope the following example will better explain what I need (it is not the real code I'm programming, but an easy code I create just represent my real problem): repeat counter 10 [ display compose/deep/only "PROGRESS" [ pro: progress do [ incr: 0 repeat newCounter 10 [ pro/data: incr incr: incr + 0.1 ] ] unview ] Well, the problem is I don't see any progress in the bar, since the form is not shown until the do [ ... ] loop does not finish! Can you help me? Thank you! --Alessandro

 [2/6] from: massung:gmai:l at: 26-Apr-2006 17:39


Not quite sure if this is the problem, but something I typically forget is the SHOW the face again. Changes to the face won't take effect (visibly) until you show it again. HTH, Jeff M. On 4/26/06, Alessandro Manotti <ale870-gmail.com> wrote:
> Dear all, I'm a newbe in Rebol. > I'm creating a Rebol application, and I need to display a progress bar
<<quoted lines omitted: 23>>
> To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject.
-- massung-gmail.com

 [3/6] from: rebolek:gm:ail at: 27-Apr-2006 0:58


Hi Alessandro, the problem is that DO in VID dialect is executed once, when LAYOUT parses the dialect. Try following code in console:
>> view layout [do [val: .1] progress with [data: val] do [val: .7] progress
with [data: val]] As you can see, DO block is somehow "static". Now try this code:
>> view layout [progress rate 0 feel [engage: func [face action
event][face/data: (third now/time/precise) // 1 show face]]] That's probably what you want. Bye, Rebolek On 4/26/06, Alessandro Manotti <ale870-gmail.com> wrote:
> > > >
<<quoted lines omitted: 42>>
> 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: rebolek::gmail::com at: 27-Apr-2006 1:00


Or, easily, try this code:
>> view/new layout [p: progress] >> p/data: .5 show p
As you can you see, you have to SHOW the face to see the changes. Rebolek

 [5/6] from: nick:guitarz at: 26-Apr-2006 21:12


Hi Alessandro, Here's your example in standard VID. Be sure to use "view/new" so that the view function returns immediately. That way, you can put code to be evaluated after the gui layout is created: rebol [] view/new layout [ text "PROGRESS" pro: progress ] repeat counter 10 [ do [ incr: .0 repeat newCounter 11 [ pro/data: incr show pro incr: incr + 0.1 wait .1 ] ] ] unview To make a layout created with view/new event driven, use "do-events". For example: view layout [pro: progress] is the same as: view/new layout [pro: progress] do-events Hope that helps! Quoting Alessandro Manotti <ale870-gmail.com>:

 [6/6] from: ale870::gmail::com at: 27-Apr-2006 11:38


Great! Thank you! I used the concept suggested by Boleslav and Nick, and it works! Thank you again! --Alessandro On 4/27/06, Nick Antonaccio <nick-guitarz.org> wrote:

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted