r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!RebGUI] A lightweight alternative to VID

Graham
24-Jun-2006
[3978]
RT is promoting Rebgui http://www.rebol.net/article/0280.html
Ingo
24-Jun-2006
[3979x2]
Version 1, left, down resized ...

display "Test 1" [
   tight
   text 40 #w "free" 
   text 10 #w "11"
   text 40 #w "empty" 
   text 10 #w "12"
   return
   text-list 50x50 #hw data ["entry1" "entry2"]
   text-list 50x50 #hw data ["entry3" ]
   return
   text 40 #w "nothing" 
   text 10 #w "21"
   text 40 #w "whatever" 
   text 10 #w "22"
   return
   text-list 50x50 #hw data ["entry1" "entry2"]
   text-list 50x50 #hw data ["entry3" ]
]
do-events
Version 2, upper left resized ...
display "Test 2" [
   tight
   text 40 #w "free" 
   text 10 #wx "11"
   text 40 #wx "empty" 
   text 10 #wx "12"
   return
   text-list 50x50 #hw data ["entry1" "entry2"]
   text-list 50x50 #hwx data ["entry3" ]
   return
   text 40 #wy "nothing" 
   text 10 #wxy "21"
   text 40 #wxy "whatever" 
   text 10 #wxy "22"
   return
   text-list 50x50 #hwy data ["entry1" "entry2"]
   text-list 50x50 #hwxy data ["entry3" ]
]
do-events
Graham
24-Jun-2006
[3981x9]
the first one you need a #Y for those you want to have a y displacement
what's wrong with the second one?
I've been looking at how to save a form contents and reload the same 
values when opening the form.
all the widgets are anonymous
when I save the form contents, I just go through the pane and grab 
all the values for the widgets I have viz: radio-groups, and edit-lists.
And to restore the form contents, in the do block of the layout, 
I go thru the layout and restore the values.
Only trouble is .. it's not working for me.
How to reference the layout from within a do block ?
I can't use the reference returned by 'display because the display 
hasn't finished yet.
Volker
24-Jun-2006
[3990]
IIRC you have it in 'face in the do-block
Graham
24-Jun-2006
[3991]
Let me try ..
Volker
24-Jun-2006
[3992]
display "Example" compose [
    button "a" [alert "hi"] field "a" return 
    button "b" field "b" return 
    do [
        foreach fac face/pane[
 probe fac/text
]
    ]
]
Graham
24-Jun-2006
[3993x2]
Nope .. not working.
let me try a smaller example ..
Volker
24-Jun-2006
[3995]
mine works here. has rebgui change?
Graham
24-Jun-2006
[3996x2]
keeps changing all the time!
Hmm.
Volker
24-Jun-2006
[3998]
Has rebgui changed in that regard? :)
Graham
24-Jun-2006
[3999x2]
Smaller example works here too.
must be doing something else bad ..
Volker
24-Jun-2006
[4001]
confidential code?
Graham
24-Jun-2006
[4002x3]
display "Test" [
	group-box "Box1" data [
		field 100 return
		field 100 return 
	]
	do [	
		foreach f face/pane [
			if f/type = 'group-box [
				foreach t f/pane [
					t/text: copy "hello"
				]
			]
		]
	]
] do-events
works fine
not confidential code .. just very long!
Volker
24-Jun-2006
[4005x2]
maybe i can dig to the important points.
i am sometimes good at probing.
Graham
24-Jun-2006
[4007x3]
hang on ....
maybe i find the bug.
fixed :)
Volker
24-Jun-2006
[4010]
Grats :)
Graham
24-Jun-2006
[4011]
helps to talk about these things :)
Volker
24-Jun-2006
[4012]
very true:)
Robert
24-Jun-2006
[4013]
Graham, good tip: Don't save/restore anonymous widgets. If (whyever) 
the order of faces change you are lost. I always use named widgets, 
even it's more to code. But I can move the stuff around without any 
problems. And my widgets have the same name as the database-columns.
Graham
24-Jun-2006
[4014]
can't do ... users are allowed to create the forms
Volker
24-Jun-2006
[4015]
But they could be forced to name the fields?
Graham
24-Jun-2006
[4016x2]
but they could overwrite globals
they might name a field rebol: field 100
Volker
24-Jun-2006
[4018]
i would take roberts suggestion but use my own naming. eg have a 
/my-name in your fields and compare with that.
Robert
24-Jun-2006
[4019]
Graham, simple fix: Just prefix each field name internally with graham_<field-name-by-user> 
and you are save.
Graham
24-Jun-2006
[4020x4]
this is an example form http://www.compkarori.com/emr/images/cvs.png
I use the form to create text .. so it is not being saved to any 
database ...
it is being used to create english sentences
I guess I would use named fields though if I had to save and restore 
to database fields
Volker
24-Jun-2006
[4024]
So its stored only short-term and long-term-compatibility is no issue?
Graham
24-Jun-2006
[4025x3]
yes
mostly for forms I store the form data as a block in the database
because you might have a hundred different forms