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

World: r3wp

[!RebGUI] A lightweight alternative to VID

btiffin
9-Jun-2007
[6625x3]
Yeah, it's not reacting.  I've tried forcing focal-face, no effect. 
 ??
I've tried a custom widget with an  action: make default-action [ 
 but I might be missing
something simple but critical...
From what I can understand from other widget code, say area...the 
on-scroll is sent to

the area...I need it to go right to the slider for the scheme I'm 
attempting...  Umm, I think...
Ashley
9-Jun-2007
[6628]
You have to do it indirectly, as in:

display "" [
	p: panel data [slider] on-scroll [
		var: face/pane/1
		var/data: var/data + either negative? scroll/y [-.1][.1]
		show var
	]
	do [system/view/focal-face: p]
]
btiffin
9-Jun-2007
[6629x2]
Ashley;  Thanks.
Works nicely.  Need to build the boundary fences, but works nicely. 
 Thanks again.
Graham
10-Jun-2007
[6631]
New error for me ..


An error has occurred.  If this occurred with an upgrade, please 
revert to the older version for the meantime, and report the error 
message as documented below.

make object! [
    code: 501
    type: 'access
    id: 'not-open
    arg1: "Port"
    arg2: none
    arg3: none
    near: [repeat i p/cols [
            line/pane/:i/offset/x: col-offset 
            line/pane/:i/size/x: p/widths/:i - sizes/cell 
            all [
                p/pane/2/show? 
                i = p/cols 

                line/pane/:i/size/x: line/pane/:i/size/x + (p/size/x - p/pane/2/size/x 
                - (line/pane/:i/offset/x + line/pane/:i/size/x))
            ] 

            line/pane/:i/text: replace/all form pick p/data index - 1 * cols 
            + i "^/" "¶" 

            line/pane/:i/font/color: either find p/options 'no-action [
                black
            ] [
                either find picked index [white] [black]
            ] 
            col-offset: col-offset + pick widths i
        ]]
    where: 'confirm
]
Ashley
10-Jun-2007
[6632]
Well, that looks like the face-iterator logic (used by table and 
text-list) ... any idea what was being done at the time (i.e. table 
just about to be displayed, row double-clicked on, etc)?
Graham
10-Jun-2007
[6633]
None of those as I recall.
Ashley
10-Jun-2007
[6634]
Build#95 uploaded to SVN. Contains new 'on keyword and request-char 
function. 'on is used to specify multiple action handlers at once, 
as in:

	display "" [
		field
		field on [
			scroll [print scroll/y]
			focus [print "Got here!"]
		]
	]

%tour.r updated to demonstrate new request-char function.
btiffin
12-Jun-2007
[6635]
Ashley;  How hard would it be to allow set-path! for widget variables? 
 Or am I missing

something that would allow widget variables to be held in an object!? 
 I'm fairly prone
to missing things  :)
Ashley
12-Jun-2007
[6636]
You mean something like:

	b: "Bob"
	display "" [a: field b]

which is already supported, or something else?
btiffin
12-Jun-2007
[6637]
No I mean something like

fields: make object! [
   a: b: c: none
]

display "Test" [fields/a: field  fields/b: field  fields/c: field]
Ashley
13-Jun-2007
[6638x2]
No [to supporting that]. The preferred approach would be:

	obj: make object! [
		a: "Bob"
		f: does [display "" [field b]]
	]
	obj/f
typo "field b" -> "field a"
btiffin
13-Jun-2007
[6640]
Thanks Ashley.
Volker
13-Jun-2007
[6641]
Would pathes help? I think the change to support that could be small.
btiffin
13-Jun-2007
[6642]
I was looking at (and don't grasp all the implications of) the parsing 
 set-word!  occurances and how a set-path! may be inserted.  But...it 
looked too simple, so it had to be wrong.  :)  And again, I don't 
get all the implications, so I'm completely accepting of Ashley's 
nice short no.
Graham
13-Jun-2007
[6643]
make object! [
    code: 501
    type: 'access
    id: 'not-open
    arg1: "Port"
    arg2: none
    arg3: none

    near: [line/pane/:i/font/color: either find p/options 'no-action]
    where: 'confirm
]
Ashley
13-Jun-2007
[6644]
face-iterator init func as it tries to create a table ... now that 
one should be reproducable?
Graham
13-Jun-2007
[6645x2]
I'm just logging errors here as they occur!
so I can add traps around them and then log them to the rebgui.log
Ashley
14-Jun-2007
[6647]
Are these errors you're generating or your users are generating? 
I've got a dozen or so users who've been pounding away at a large 
RebGUI app for almost 2 years now, and the rebgui.log files on their 
PC's are pretty much empty. Might just be a case of YMMV ;)
Graham
14-Jun-2007
[6648]
these are ones I am generating :(
Anton
14-Jun-2007
[6649]
btiffin, maybe this works:
fields: context [a: b: c: none]

display "test" compose [(to-set-word in fields 'a) field (to-set-word 
in fields 'b) field]
btiffin
14-Jun-2007
[6650]
Hey...that should get rid of a few more globals, cool.  Thanks Ashley. 
 First tests worked great. :)
Ashley
14-Jun-2007
[6651]
Anton, very cool. I'll think I'll add that trick to the [RebGUI] 
cookbook.
btiffin
15-Jun-2007
[6652]
Anton;  Yep, thanks.  This has opened up all kinds of RebGUI goodness.
Pekr
15-Jun-2007
[6653]
well, but will it bind those variables to those one in 'fields object?
Anton
15-Jun-2007
[6654x2]
Ah it works, good :) I couldn't remember if the binding was kept 
or not.
Pekr, do you know what   in fields 'a   means ?
Pekr
15-Jun-2007
[6656x2]
yes, from the help ....
I am just not sure, if the 'a in the 'display is the same as in the 
'fields ....
Anton
15-Jun-2007
[6658]
Check this out:
>> o1: context [a: 1]
>> o2: context [a: 200]
>> print probe compose [(in o1 'a) (in o2 'a)]
[a a]
1 200
Pekr
15-Jun-2007
[6659]
I mean - does it create global 'a, referencing fields/a?
Anton
15-Jun-2007
[6660]
The only concern for me was if to-set-word kept the binding. (I guess, 
possibly, long ago it did not.)
Pekr
15-Jun-2007
[6661x2]
yes, but you are creating global var anyway, no? via the set-word?
sorry ... not good at those topics :-)
Anton
15-Jun-2007
[6663x2]
No,   in object 'word   actually refers to the word that is in that 
object. :)
Try the above example, then see if 'a has a value globally.
Pekr
15-Jun-2007
[6665x2]
eh .... can't believe it :-) it should translate into: display "text" 
[a: field b: field]
your above example does not use setword
Anton
15-Jun-2007
[6667]
No, to-set-word keeps the binding of the word (thankfully).
Pekr
15-Jun-2007
[6668x3]
shit, it works :-)
o: context [a: 1]
print o/a
reduce compose [(to-set-word in o 'a) 5]    
print o/a
value? 'a

results:
1
5
false
it is just not clear, how to-set-word could bind it to o's 'a
Anton
15-Jun-2007
[6671x3]
>> blk: compose [(to-set-word in o1 'a) (to-set-word in o2 'a)]
== [a: a:]
>> get blk/1
== 1
>> get blk/2
== 200
to-set-word is not doing any binding. The word retains its binding. 
Each word knows to which context it is bound.
So, as the word travels around the place, it knows in which object 
its associated value can be found.
Pekr
15-Jun-2007
[6674]
ah, that is like sucking 'a from object to upper context, while 'a 
still remembers, where it belongs ;-)