Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: Unable to update rebgui display fields
Pages: [1] Print
Author Topic: Unable to update rebgui display fields  (Read 199 times)
dragoncity
Newbie
*
Offline Offline

Posts: 3


View Profile
Unable to update rebgui display fields
« on: July 10, 2008, 12:20:22 AM »

Hi, I've just recently found REBOL, very impressive,  and are developing a simple data entry program using VID. After some confusion about how to actually 'get/put' data into a VID field this program nhow works well.

I then decided to try rebgui , mainly to see the differences to VID , so I proceeded   to convert
my test program and I find I'm back with the same problem !!

How do you get/put data into a rebgui field ? The below code simply copies the contents of
field A to B and prints the results, thats ok, but nothing changes on the form !!

What am I missing ? :-)

========================================================
REBOL [ "rebgui-demo.r"
         { tries to update field B from field A.
            -- does the variable copy but fails to redisplay changes}]

do %/home/brett/rebgui/rebgui.r
   
main: display "Example data input"
  [
   text "Rebgui demo "  bold
   return
   label  " Type in : " bold A: field  "999"
   return
   label  " Copy To : " bold  B: field "**"
   return
   button "Copy/Print" 20 [  prin  reform [ "A is :" A/text ]
                      print  reform [ " | B  is :" B/text ]
                       prin  reform [ "A is :" A/text ]
                      B: A
                      print  reform [ " | B  is :" B/text]
                     
                      ; I assume sone sort of display command needed here
                  ]
   button "Close" 20 [ unview]
]

do-events
======================================================

I had a look at the rebdbgui.r example code but its so tied up with the db functions ( of course) that it does not give much of a idea of simple field usage.

rebgui does not seem to have any /user/ documentation , as against its /reference/ material which is somwewhat confusing in its layout.

A set of simple useful examples would be nice.

Thanks for any help.


Logged
rebolnotes
Newbie
*
Offline Offline

Posts: 23


View Profile
Re: Unable to update rebgui display fields
« Reply #1 on: July 24, 2008, 02:19:53 PM »

You must use Show Face see here:
http://www.rebol.com/how-to/fields.html

f-name: field
across space 0
button "Set to Ann" [
    f-name/text: copy "Ann"
    show f-name
]
button "Set to Bob" [
    f-name/text: copy "Bob"
    show f-name
]
Logged
dragoncity
Newbie
*
Offline Offline

Posts: 3


View Profile
Re: Unable to update rebgui display fields
« Reply #2 on: July 24, 2008, 09:21:07 PM »

Thanks for your reply, I had figured it out after getting in touch with rebgui's developer who pointed me to the rebgui function library.

The example you refered to is actually a VIEW routine, and does not run under REBGUI, and took a small amount of conversion.  Cheesy

My revised example does run under Rebgui and used both the VIEW (show) & rebgui  (set-text) style of displaying a fields value. Under rebgui you must make sure you use COPY to ensure your source data is not nulled.

Its a pity thot there dos not seem to be any complete small example program(s) showing this type of
problem.  Plenty of code 'snippets' that assune you already understand the REBOL/VIEW context.

=========================
REBOL []

do %rebgui.r
   
display "test" [   
 
f-name: field  20x8   font  [  size: 18 color: black  shadow: none  ]
      
button "Set to Ann"  20 [
            f-name/text: copy "Ann"
            set-text f-name copy f-name/text  ; REBGUI code
   ]
button "Set to Bob"  20 [
            f-name/text: copy "Bob"
            show f-name                                ;  VIEW code
   ]
]
do-events
=====================
Logged
Pages: [1] Print 
Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: Unable to update rebgui display fields
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 12, 2008, 12:29:04 AM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2251 Posts in 589 Topics by 2420 Members
Latest Member: pharmacytovvv

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc