If you don't initialise the button in the initial layout,
in uiSpec:

  the-button: button  ;counter-text

it updates correctly.
I don't know why button acts this way either.

Anton.

> As the following code demonstrates, BUTTON seems to be an antisocial
> little tyke who will get marks off in "plays well with others".  ;-)
> 
> This raises two questions for me:
> 
> 1)  Is this a bug or a "feature"?
> 2)  Are there any nice work-arounds?
> 
> -jn-
> 
> 8<-------------------------------------------------------------------
> 
> #!/usr/local/bin/rebol
> 
> rebol []
> 
> test2: make object! [
>     counter: 0
>     counter-text: to-string counter
>     fix-text: func [thingie] [
>         thingie/text: counter-text
>         show thingie 
>     ]
>     the-head: the-text:
>         the-vhead: the-vtext:
>         the-field: the-info:
>         the-button: the-label:
>         the-recount: the-close: none
>     uiSpec: [
>         the-head:   h3      counter-text 50x20
>         the-text:   text    counter-text 50x20
>         the-vhead:  vh3     counter-text 50x20
>         the-vtext:  vtext   counter-text 50x20
>         the-field:  field   counter-text
>         the-info:   info    counter-text
>         the-button: button  counter-text
>         the-label:  label   counter-text 50x20
>         the-recount: button "Recount" [
>             counter-text: to-string counter: 1 + counter 
>             fix-text the-head
>             fix-text the-text
>             fix-text the-vhead
>             fix-text the-vtext
>             fix-text the-field
>             fix-text the-info
>             fix-text the-button
>             fix-text the-label
>         ]       
>         the-close: button "Close" [unview]
>     ]
>     ui: layout uiSpec
>     run: function [][][
>         view center-face ui
>     ]
> ]
> 
> test2/run
> 
> 8<-----------------------------------------------------------------

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to