Hi Andrew, the reason is that the set-progress function body
code is bound to the my-progress-dialog object when it is
made (by MAKE).
So you are unintentionally doing [show-popup lay] instead of
just show.
You can refer to the global SHOW function like this:

        set-progress: func [val][
                progress-bar/data: val
                system/words/show progress-bar
        ]

but I would advise against redefining the globals SHOW and HIDE
as it will probably just lead to confusion. Up to you, though :)

Anton.

> my-progress-dialog: make object! [
>     progress-bar: none
>     lay: layout [
>         txt "Process in process, please wait"
>         progress-bar: progress 200 black red]
>     set-progress: func ["This doesn't appear to work" val][
>         progress-bar/data: val
>         show progress-bar]
>     show: does [show-popup lay]
>     hide: does [hide-popup]
> ]
> 
> my-func: func [dlg][
>     wait 1
>     for x 1 100 1 [
>         dlg/progress-bar/data: (x / 100)
>         show dlg/progress-bar
>         ;dlg/set-progress (x / 100)
>         wait 0.05
>     ]
> ]
> 
> inform-and-process my-progress-dialog :my-func
> 
>     You'll see that I prefer to wrap the layout in an object to keep
> everything nicely wrapped. It does require that I agree a protocol
> with myself but I'll manage. What I do wonder though is why the
> commented out line in my-func does not update the progress bar in the
> way that the two preceding lines do? Secondly, how would I set up an
> event handler to make the dialog un-closeable?
> 
>     cheers
> 
>         Andrew

-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to