• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r4wp

[Rebol School] REBOL School

Sunanda
31-Oct-2012
[1423]
Why can't  a button hide itself? Looks like /SHOW? is always set 
TRUE on exit from an action facet:
    view layout [b: button "hide me" [hide b print b/show?]]
   (esc)

   print b/show?   ;; expect FALSE if button clicked, but always get 
   TRUE


My ungainly work-around is to move the button well out of the visible 
area:

   view layout [b: button "hide me" [b/offset: -100x-100 - abs b/offset 
   show b]]

(the abs and -100s allow me to reverse the action to put it back 
where it was)
Henrik
31-Oct-2012
[1424]
AFAIK, it's because the action is run on mouse down, and the mouse 
up event causes a redraw, which will then show the button again.
Maxim
31-Oct-2012
[1425]
action is run on mouse up.  I can't figure out why face won't stay 
hidden... but its probably because Carl used redraw.   first thing 
I do when I build new styles is to clear the redraw.
Henrik
31-Oct-2012
[1426]
you are right. the problem is probably that the action is run before 
the redraw takes place. but it's been a few years now since I worked 
on this problem.
Maxim
31-Oct-2012
[1427x3]
IIRC feel/redraw does a show on a face which forces it back on.
just about every time I've had to fix something with VID it was related 
to the fact that redraw is being used.  its a very bad design... 
redraw should never have been put into the feel.   its also a big 
slowdow, since it forces every face to redraw itself when you show 
a pane.
slowdown
MaxV
31-Oct-2012
[1430x2]
A button can remove itself: lokk here:
a: layout [b: button [remove find a/pane b show a]]
view a
Did you understand how it works?
Maxim
1-Nov-2012
[1432]
but here you removed the button...  hiding it , leaves it there.
Sunanda
2-Nov-2012
[1433x4]
Thanks guys...MaxV that's the overkill solution :-)
Another question ... I'vd like a field action facet to be triggered 
on field exit.
But I can find two cases (under windows) when it isn't:
1. ctrl+tab out of the field, rather than tab
2. right click another face, eg a button


   view layout [field 100x100 [print "field was exited"] button "click 
   me" [print 'left] [print 'right]]


Any ideas for making the field action trigger in all cases? Please!


(Right now my workaround is to do a bulk check on all fields when 
the user clicks a main action button like SAVE, but that means they 
may see multiple field-exit messages all at once, and later than 
they'd expected).
(oops new VIEW/VID group now open for such questions).
Any good reason why DEHEX won't touch %00 ?  It's the only one of 
the 256-single-byte values it leaves hexed rather than dehexed
   dehex "%00 %6f%64%64%3f"
Maxim
2-Nov-2012
[1437]
that is a strange bug
Sunanda
2-Nov-2012
[1438]
Yes, it is thanks. I stumbled across a case where I had to run DEHEX 
twice because it skipped a few values the first time.

Sadly, not been able to replicate that in a one-liner, so it may 
have been something stupid I did.
BrianH
2-Nov-2012
[1439]
Works in R3.
Maxim
2-Nov-2012
[1440x2]
it is a bug in R2 2.7.8
nice that its fixed in R3
BrianH
2-Nov-2012
[1442]
Just 2.7.8? Not earlier versions?
Maxim
2-Nov-2012
[1443]
probably in all versions... I meant its still there in 2.7.8  didn't 
check earlier versions.
BrianH
2-Nov-2012
[1444]
I checked back to 2.6.2, bug still there.
Maxim
2-Nov-2012
[1445]
it may in fact refer to some part of the RFC which prohibits character 
0 from URLs (which I am guessing is the case, haven't read that RFC 
for a time).


 in this context, it makes sense to leave it there, but if using dehex 
 for other purposes its annoying.
Endo
2-Nov-2012
[1446]
Note, however, that the 

%00" percent-encoding (NUL) may require special handling and should 
be rejected if the application is not expecting to receive raw data 
within a component." -RFC 3986
BrianH
2-Nov-2012
[1447]
Skipping is not rejecting, and Rebol doesn't require special handling 
of NUL in a string. DEHEX made the wrong choice.
Nicolas
2-Nov-2012
[1448x2]
I made a program that embeds a dll to generate a cellular automaton 
image. Could someone test it for me?     http://pastebin.com/raw.php?i=67KtcSK3
windows only
Maxim
2-Nov-2012
[1450]
seems to work here  (a big triangle filled with some recursive inverse 
triangles)
Nicolas
2-Nov-2012
[1451x3]
yay!
Thanks.
I'm curious. Is there anyway to access a binary function like this 
without writing it to a dll or shared object I wonder?
Endo
2-Nov-2012
[1454]
works here too, xp/pro 32bit.
Nicolas
2-Nov-2012
[1455x3]
I'm mostly worried about big endian machines
The triangle is a cellular automaton. This one is a good source of 
randomness according to Stephen Wolfram.
Thank you Endo, Maxim
Marco
2-Nov-2012
[1458]
Works the same for me on W7 64bit.
Arnold
5-Nov-2012
[1459]
I need to save some stack space for my evaluation routine runs out 
of stack with the search-depth on 2 (I had expected this but than 
on depth 5 or so)

can unset help? Is there a method to keep track of the stack? To 
see how much you have and use up?
Sujoy
5-Nov-2012
[1460x2]
hi all
am trying to use Kaj's 0mq bindings on an aws micro instance.
i have rebol-core 2.7.8.4.3 installed
when i do %ZeroMQ-binding.r2, i get:

Script: "ZeroMQ Binding" (none)
** Script Error: Feature not available in this REBOL
** Where: context
** Near: binary: make struct! [value [binary!]] none
Any ideas?
this works fine on windows7 with rebol-view 2.7.8
PeterWood
5-Nov-2012
[1462]
REBOL/core does not include the ability to call shared libraries. 
REBOL/View does.
Sujoy
5-Nov-2012
[1463x10]
rats
trying rebol-view
now getting this:


./rebol: error while loading shared libraries: libX11.so.6: cannot 
open shared object file: No such file or directory


any experience running rebol-view on aws? looks like some libs/headers 
are missing...
libX11 and libX11-devel are loaded on the instance...
linX11.so.6 is located in /usr/lib64, and i'm guessing that rebol 
is looking in usr/lib
loaded all i686 extensions to the 64bit instance
now get:

$ ./rebol -v
** User error: Bad face in screen pane!
** Near size text self
shouldn't ./rebol -v open the console on linux directly?
note: this is happening with MaxV's http://www.maxvessi.net/rebsite/Linux/
2.7.8 as well
just saw this:
http://www.rebol.org/aga-display-posts.r?post=r3wp226x4139
trying a reboot
no luck with rebooting...