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

World: r3wp

[View] discuss view related issues

Volker
8-Sep-2005
[2552x7]
so this works:
view layout [field "0" [if error? err: try [probe to-integer face/text] 
[set-face face "0"]]]
because ctx-text/edit-text uses /data, not /text.
not updated because of error.
                if flag-face? face return [
                    if flag-face? face hide swap-text 

                    if flag-face? face tabbed [focus next-field face] 
                    action face face/data 
                    exit
                ]
so setting /data by hand works too:
view layout [field "0" [probe face/text if error? err: try [to-integer 
value] [probe disarm err set-face face "0"]]]
pasted wrong version
view layout [field "0" [if error? try [ probe to-integer value] [set-face 
face "0" face/data: face/text ]]]
Geomol
8-Sep-2005
[2559]
Thanks Volker!
Volker
8-Sep-2005
[2560]
(dont forget to met rambo ;)
Geomol
8-Sep-2005
[2561]
Sent it to RAMBO.
Anton
8-Sep-2005
[2562]
Kru, you need to maintain external state data just like the SELECTED 
index in the example.
Here are my diffs from the original example:

over-index: 0

	;edge: none

		over: func [face action position][
			print ["Over" action]
			over-index: all [action face/data]
			show main-face
		]

			aface/edge/color: either over-index = index [sky][coal]
MikeL
13-Sep-2005
[2563]
Can someone point me to the syntax for radio-line?  and check-line?
Geomol
13-Sep-2005
[2564]
Mike, a bit here: http://home.tiscali.dk/john.niclasen/vid-styles.html#section-5
If you do e.g.: 
layout [mycheck: radio-check "something"]

then mycheck/data will be true or false. Is that, what you needed?
Anton
14-Sep-2005
[2565]
view layout [radio-line "one" radio-line "two" radio-line "a" with 
[related: 'my-alphabet-radios] radio-line "b" with [relate
d: 'my-alphabet-radios]]
MikeL
14-Sep-2005
[2566]
Thanks Anton and John.
Chris
14-Sep-2005
[2567]
Shorthand for "with [related: 'group]" -- radio-line "one" of 'group
DideC
14-Sep-2005
[2568]
Anybody here with already done notes on text-list internals (lc, 
sn, cnt...) ???
Graham
14-Sep-2005
[2569x2]
do you mean like this http://www.compkarori.com/vanilla/display/textlist
posted over 2 years ago!
DideC
14-Sep-2005
[2571]
Graham: smack ;-)
Geomol
14-Sep-2005
[2572x4]
Is it possible in the VID style "key" to check, if SHIFT is pressed 
too?
sorry, lol confusing
I want to check, if e.g. '1' is pressed on the numeric keyboard together 
with SHIFT.
hmm it's probably not, because those keys then send HOME, END, and 
so on.
MikeL
15-Sep-2005
[2576]
I put a VID screen on some mySQL data (using the Doc's protocol) 
and allowed paging through it using the left and right arrows. Worked 
fine for a small database; very fast refresh of the page. 

When I used the same approach on a larger DB with some TEXT fields, 
it started to hang at the same record when going '"right".   


After much trial and error and guessing, I think it is because the 
database is not quite fast enough to refresh the screen to keep up 
with holding the key down.   


I put it sub-second wait in before the screen reshows its values 
and the problem went away.   	ie wait 00:00:00.005   


I don't think it is a database problem because it could happen with 
slower devices such as files. 


Is this consistent with what others have seen or am I 'fixing' the 
wrong problem?
Pekr
15-Sep-2005
[2577x4]
hmm, I would like to know Mike, what actually were you doing? Because 
- in old DBF x-Base days it worked like that - you simply had "cursor" 
at some db position and you moved by using 'skip command .... of 
course even then, it was wise to use indices and to limit the scope 
of data you work with ...
now SQLs are different kind of beasts -  there is NO live connection 
to sql database (on cursors later :-), you simply send a query, SQL 
server prepares results for you and sends it back to you. So, I wonder, 
how could actually SQL server slow your recordset browsing? And IF 
you were sending new requests after a key-press and wanted to stay 
real-time, then it is quite heroic aproach :-) Within our SAP system, 
you are glad if you receive your query result in few secs.
So, mostly, if you work with SQL, you try to find the right context 
of data, limiting your query as much as possible. Then you do a query, 
receive result and browse it. In that case, you already have all 
your data in rebol block already (unless you are reading them from 
port continuously), and it has nothing to do with SQL database anymore 
...
Now on cursors - of course, old x-base aproach is possible with SQL 
too, it is called "live cursor" or something like that. But with 
larger systems, adming don't allow or don't like to see it, as it 
consumes additional resources. Some of databases even don't have 
it. IIRC mySQL will introduce it from version 5.0, or maybe I am 
wrong ....
MikeL
15-Sep-2005
[2581]
Not using a cursor. Right key action  increments current-record-key. 
Retrieves single row for current-record-key, Displays page with data 
for row retrieved.  The database is local and only has (so far) 120 
rows but I have another with three hundred shorter records (no BLOBs) 
on it and it works well without any wait.  i.e. I can hold down the 
right key and it will flash each page by.  MySQL protocol has always 
seemed very fast to me.  Is it possible that View is stacking up 
the key actions and hanging after it gets too many?  p.s. I don't 
want to read the whole database content into memory because then 
I have to worry about locking when I allow HTML updates to it by 
others.  Single row updates with the last update 'winning' in the 
unlikely event of a collision works well for what I need to do.
james_nak
15-Sep-2005
[2582x3]
Hello, anyone have any ideas how I might improve on the integrity 
of a program that sends email to a list of people. I just realized 
I should be using '/only' but I have to check its behavior as I don't 
want each person to get a list of the other recipients. My problem 
is I often get a time out and I want to trap that. Yesterday during 
my first test it got halfway through the list and errored out which 
then caused the program to exit. I figured I should at least keep 
a running log so I can go back.
Again, I check but I wonder how the header will behave with an '/only' 
Will the "to:" address be altered?
I guess it has to be a generic address in the header. It doesn't 
change it. Oh, well, that'll work as well.
Pekr
15-Sep-2005
[2585x3]
/only is not good - then ppl will see one each other ...
there is also bcc field available - meaning blind-copy ... in such 
case, you send it with all adresses just once to the server, server 
sends it to each recipient, but they will not see one each other, 
just some "recipient" string or something like that ...
what about putting your send function in an attempt block?
james_nak
15-Sep-2005
[2588]
Pekr, it actually didn't do a list. Instead it sent individual emails. 
Also I probed send and there is a '/show'' option that will replace 
the to: address. checking...
Pekr
15-Sep-2005
[2589]
how to obey timesouts in general, try following:


either none? attempt [conn: open http://www.rebol.au][print "not 
connected"][print "connected"]
james_nak
15-Sep-2005
[2590]
OK, thanks.
Pekr
15-Sep-2005
[2591x3]
alhough I am used to use if not error? try [ .....]
... as 'attempt is functions available from some older core versions 
...
but there were cases , where I failed even inside of 'try block, 
maybe if function contains other functions, dunno ... I am really 
not an expert in all that throwing errors principles ... Ladislav 
or other folks here will do much better service to you :-)
james_nak
15-Sep-2005
[2594]
OK, I can't seem to get the show to shove the to: address in but 
I'll keep at it.
Pekr
15-Sep-2005
[2595]
then use /header refinement and construct header yourself ...
james_nak
15-Sep-2005
[2596x3]
Well I'm doing each mail individually and it seems to slow that way.
Anyway, setting header/to: none works but it puts the entire list 
there as you mentioned. Hmmm, maybe I have to do it individually.
thanks.
Graham
15-Sep-2005
[2599x2]
Just wondering how one matches a GUI like VID to an asynchronous 
data source. I am thinking of building a mulit tab panel application 
with an asynchronous backend.  If the user requests some data on 
one screen, and then changes their mind by switching to another screen, 
what does one do with the data when it arrives?  Does one refresh 
the original screen request and move focus from where the user switched 
to ?
Or,  say there is a chat window as part of the application.  How 
does one refresh the chat window without losing the focus on whatever 
the user is currently doing?
Volker
15-Sep-2005
[2601]
maybe some kind of feedback? requester would be to heavy, some blinking 
light "new data"? think of the red in altme-groups