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

World: r3wp

[View] discuss view related issues

ICarii
17-Jul-2007
[7116]
Pekr: i normally create view objects by using a func - but GC doesnt 
handle things very well with multiple calls to the same func :(
Graham
17-Jul-2007
[7117]
If you're memory constrained, I wouldn't use VID!
Pekr
17-Jul-2007
[7118x2]
That is my question in Core group - does function call, once finished, 
discard its context? If not, you will not save memory either. You 
would have to unset your func, recycle, and define it later once 
again ...
Graham - I am curious what will happen after R3 release. Theoretically, 
we should get VID more memory savy. I wonder if there will still 
be place for RebGUI (my opinion is - why not, right?)
Gregg
17-Jul-2007
[7120]
If you are *really* constrained, create your UI with draw commands 
and manage events and everything yourself. Of course, you may end 
up with so much more code that it's a moot point, so it depends on 
what constraints you have. 


It reminds me of when VB1 came out, and people tried to use thousands 
of text boxes to create spreadsheets, which was slow, resource hungry, 
and limited in size, because you could only create so many windows. 
The common question was "How does Excel do it then?", and the answer 
was that Excel (v3 at the time I thnk) created only 3 (or so) actual 
GDI windows, everything else was rendered, and interaction handled, 
dynamically
BrianH
17-Jul-2007
[7121]
If you are really, really constrained, use a wrapper around the native 
GUI controls for your platform, carefully. Only cell phones and other 
embedded platforms are that constrained though.
Pekr
17-Jul-2007
[7122]
Thanks for your input guys. I am not constrained that much. Our kiosk 
PCs do have 256MB of memory, being older PCs, some Duron 1.2 or so, 
WinXP. It runs presentation in full mode, local Apache based. Plenty 
of photos, simply kiosk presenation, not ordinary web pages. Dunno 
how IE is memory hungry. My script, which will run in background, 
easily eats some 39MB memory. I did some unsets, recycles, so while 
in wait mode, script goes down to some 24MB. It is that I was just 
curious how to aproach that ...
Gregg
17-Jul-2007
[7123]
Carl once said "View is miserly, saving pennies, while VID is like 
the government, spending millions".
Ingo
23-Jul-2007
[7124]
Hi, I'm trying to visualize data I get from a network port within 
a view window. IIRC using wait within a view handler is greatly discouraged 
(and my first tests seem to show it: the window is updated for the 
first info, but the updates stop after the second, or so. )
So, how do I connect to a tcp port from within /View?
ICarii
23-Jul-2007
[7125]
depending on your display needs you could set a rate in a view face 
for interval polling and catch the 'time event under engage - the 
application could then check a data pool/dump area that is being 
generated in a forever loop or something similar by a tcp watcher
Ingo
23-Jul-2007
[7126]
Hi ICarii ... what do you mean? Having 2 rebol instances, one that 
listens on tcp and creates a file, which is then read by the other, 
and used for display?
ICarii
23-Jul-2007
[7127x3]
data-i-want-to-display: [..............] ;probably a block
window: layout/tight [
	data-box: box 400x200 rate 0:00:0.001 feel [
		engage: func [f a e][

   if a = 'time [do-something-nifty data-i-want-to-display show f]
		]
	]
]
view/new center-face window
setup-port-listener
forever [
	check-my-port-and-update data-i-want-to-display

 ;add some window shutdown code to close ports etc after window closes..
]
but change the rate in the layout to whatever interval you desire 
for precision
make sure there is also some form of wait inside the forever loop 
or it will thrash about and not release any breathing room for view. 
 A wait of 0.001 typically takes processor usage from 100% to 1% 
as well.  Wait 0 inside a forever loop seems to stick at 100%.  Your 
mileage may vary ;)
Ingo
23-Jul-2007
[7130]
Ahhh, thank you. I'll try that next. And thanks for the wait timings, 
I'll try it out.
james_nak
21-Aug-2007
[7131]
Has anyone developed any code for a text field that can keep a history 
of previously entered values?
Henrik
21-Aug-2007
[7132]
I have built an enhanced text field, that does not have this capability, 
but it would be nice to have it.
james_nak
21-Aug-2007
[7133]
I know I saw that! I was thinking of just  using yours and adding 
that with the key action. BTW, the new List-View is great.
Henrik
21-Aug-2007
[7134]
feel free to mess around with it. :-)
james_nak
21-Aug-2007
[7135]
Well, I just saw list-view get updated with the mysql data. How cool.
amacleod
22-Aug-2007
[7136x2]
the new list-view is great
? is there a new version available?
I just saw list-view get updated with the mysql data
? Is there some mysql interface now in list-view?
Henrik
22-Aug-2007
[7138]
it supports object lists now. mysql views, I think he means that 
output from mysql-protocol.r fits in list-view.
amacleod
22-Aug-2007
[7139]
I've been using list-view with mysql-protocol for a while but the 
method I use to move data back and forth between mysql data and the 
list-view is not very elegant. Are there any examples of how object 
lists..mysql views work with list-view?
Henrik
22-Aug-2007
[7140]
object lists are not suited for mysql results. just use plain blocks 
in blocks, returned from the database. that works fine.
amacleod
28-Aug-2007
[7141x2]
hI'm trying to append to a face for export to a .png later. I'm able 
to append some text using something like: append gui [at 264x72 text 
"SOME TEXT" bold font-size 20]
That works fine, however, when I try to step through a block of data 
to be appended usinf FOREACH I only end up with the last item of 
data appended. Previously appended text remains but any text I attemt 
to append in the FOREACH loop does not "Stick". Any ideas?
Henrik
28-Aug-2007
[7143]
source example?
amacleod
28-Aug-2007
[7144x4]
data: [

 ["3/20/1965" "75 Pond Place" "Babylon" "NY" "11702" "Soleiman" "Single 
 Family" "Standard" "Form" "Richaard Soleiman"] 

 ["5/20/1965" "22-75 Pond Place" "Babylon" "NY" "11702" "Soleiman" 
 "Single Family" "Standard" "Form" "Richaard Soleiman"]

 ["6/20/1965" "75 Pond Place" "Babylon" "NY" "11702" "Soleiman" "Single 
 Family" "Standard" "Form" "Richaard Soleiman"]

 ["7/20/1965" "875 Pond Place" "Babylon" "NY" "11702" "Soleiman" "Single 
 Family" "Standard" "Form" "Richaard Soleiman"]

 ["8/20/1965" "175 Pond Place" "Babylon" "NY" "11702" "Soleiman" "Single 
 Family" "Standard" "Form" "Richaard Soleiman"]

 ["9/20/2007" "80 Pond Place" "Babylon" "NY" "11702" "Soleiman" "Single 
 Family" "Standard" "Form" "Richaard Soleiman"]

 ["10/20/1965" "75 Pond Place" "Babylon" "NY" "11702" "Soleiman" "Single 
 Family" "Standard" "Form" "Richaard Soleiman"]	

gui: [
pic: image picture
]

coorx: [73 203 440 555 700 790 920]
coory: [281 346 410 472 536 603 662]
y: 215
append gui [at 264x72 text "Some Text" bold font-size 20]


		foreach dat data [
		append gui [
					at to-pair reduce [80 y] text reduce bold font-size 15 dat/1

     at to-pair reduce [215 y] text reduce bold font-size 15 dat/2

     at to-pair reduce [215 y + 15] text bold font-size 15 reform [dat/3 
     ", " dat/4 " " dat/5] 

     at to-pair reduce [452 y] text reduce bold font-size 15 dat/6

     at to-pair reduce [567 y] text reduce bold font-size 15 dat/7

     at to-pair reduce [712 y] text reduce bold font-size 15 dat/8

     at to-pair reduce [802 y] text reduce bold font-size 15 dat/9

     at to-pair reduce [935 y] text reduce bold font-size 15 dat/10
					]
					y: y + 65
				]
		
append gui [at 264x200 text "Some more text" bold font-size 20]
view layout gui
SOME TEXT

 and "SOME MORE TEXT" will appemd to picture but I only get the last 
 data block appended.
I've stepped trhrough with a view layout after each FOREACH and I 
see that each data block is appended but disappears on the next loop
forget that coorx and coory stuff. I ment to remove that
Henrik
28-Aug-2007
[7148x2]
you are appending a non-reduced block to 'gui. that could be the 
problem.
in the loop
amacleod
28-Aug-2007
[7150x2]
I'm not sure.
Do I need to some how save "gui" face inside the loop?
Henrik
28-Aug-2007
[7152x3]
well, the block inside the loop is not reduced, which means that 
all positions and texts are not really being put into the 'gui block.
just before 'view'ing the block, try:
probe gui
>> a: "some text"
== "some text"
>> b: []
== []
>> append b [a]
== [a]
>> append b reduce [a]
== [a "some text"]
amacleod
28-Aug-2007
[7155]
I se the problem...The append statements are there but there but 
my  y coordinate takes on the last value of  y so they are getting 
appended on top of each other in the same location.
Henrik
28-Aug-2007
[7156]
yes, because the block is never reduced, so 'y is used directly, 
instead of a reduced block where the value of y at the given time 
would be inserted into the block.
amacleod
28-Aug-2007
[7157x2]
How do I get y value to reduce before append
and for that mater my dat values
Henrik
28-Aug-2007
[7159]
see my example above. it does exactly that.
amacleod
28-Aug-2007
[7160]
Bingo! I had to compose too: b: compose [at (to-pair reduce [80 y]) 
text bold font-size 15 (reduce dat/1)]
Henrik
28-Aug-2007
[7161]
strictly you don't need reduce inside the compose block. you can 
settle for: compose [at (to-pair 80 y) text bold font-size 15 (dat/1)]
amacleod
28-Aug-2007
[7162]
thanks a lot Henrik
Henrik
3-Sep-2007
[7163]
Anton, did you make a fix for editing center and right aligned fields? 
Could I be allowed to work this into my own set of patches for FIELD?
eFishAnt
15-Sep-2007
[7164]
Where can I find the simplest example of an image player, like playing 
GIF anims in REBOL?  There has to be some very simple ones that just 
flip at some "frame rate" (rather than Drawing)
Graham
15-Sep-2007
[7165]
ask Chris