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

World: r3wp

[!REBOL3-OLD1]

Geomol
13-Mar-2009
[12023x2]
sx: sy: 1
lw: 10
clip-tl: 20x20
clip-br: 380x380
sz: 400x400
color0: orange
color1: 0.0.228
color2: gold
icon: make image! sz

image: [
    transform 0 sx sy 0x0 0x0
    pen none
    fill-pen color0
    box 0x0 400x400 50
    fill-pen color1
    box 20x20 380x380 30

    clip clip-tl clip-br
	pen black
    fill-pen color2
    line-width lw
	arc 65x335 305x305 180.0 360.0
    fill-pen color1
	arc 65x335 148x148 180.0 360.0
    fill-pen color2
	arc 65x335 56x56 180.0 340.0
    clip 0x0 sz
    pen black fill-pen white
    line-width lw
	line-join round
	push [
	scale 0.9 0.9
	translate 20x20
	shape [
		move 221x60
		line 85x60 85x349 187x349 187x255 230x349 340x349 264x238
		curve 264x238 323x218 323x152
		curve 323x152 323x60 221x60
		move 204x187
		line 187x187 187x137 204x137
		curve 204x137 225x137 225x162
		curve 225x162 225x187 204x187
	]
	]

    fill-pen none
	pen color0
    box 10x10 389x389 44
	pen black
    box 15x15 384x384 40

    pen none line-width 0
    fill-pen linear 0x0 0.0 110.0 90.0 1.0 1.0
		255.255.255.40 255.255.255.120 255.255.255.200

    shape [move 400x80 arc 0x80 400.0 300.0 line 0x0 400x0 400x80]
    fill-pen linear 0x290 30.0 110.0 90.0 1.0 1.0
		255.255.255.255 255.255.255.192 255.255.255.128

    shape [move 0x300 arc 400x300 600.0 200.0 line 400x400 0x400 0x300]
]
view center-face layout [
	origin 0
	across

	b: box 400x400 black effect [draw image][
		file: request-file/only/save/file %rebol-icon.png
		if not file [exit]
		if not find file ".png" [append file ".png"]
        img: make image! b/size
        img2: make image! b/size
        img2/alpha: 255
		draw img2 [pen none fill-pen black box 0x0 400x400 50]
		draw img image
		img/alpha: img2/alpha
		save/png file img
	] return
	btn "Color 0" [color0: request-color/color color0 show b]
	btn "Color 1" [color1: request-color/color color1 show b]
	btn "Color 2" [color2: request-color/color color2 show b]
]
Something like that.
Steeve
13-Mar-2009
[12025]
thx
Geomol
13-Mar-2009
[12026]
welcome
Allen
17-Mar-2009
[12027x2]
Is SSL/https going to be supported in R3 core? I don't think the 
old "only available in pro version" will stand up any more, it is 
 essential for most web api's now.
I've got so many things I'd like to try R3 on (even in alpha state), 
unfortunately all require https
BrianH
17-Mar-2009
[12029x2]
It seems reasonable, especially since the host code can add SSL if 
it likes anyways. Ask in R3 chat and you can get an official answer.
Have you tried stunnel?
Allen
17-Mar-2009
[12031x2]
stunnel not really an option since the tools will end up in the hands 
of sales people on window machines... I don't think I need to explain 
that. :-)
But I should try for my own testing. thanks for the idea.
BrianH
17-Mar-2009
[12033]
sales people
, got it :) Otherwise you could use stunnel on Windows machines.
Maarten
18-Mar-2009
[12034]
ssl:// updated and working 100% correctly. My vote too!
Pekr
19-Mar-2009
[12035]
Those wanting to influence VID resizing model  - http://www.rebol.net/wiki/GUI_Face_Sizing
Ammon
19-Mar-2009
[12036]
----  Cross-posting from DevBase -----

window: view [t: text ""]


window is set to a gob which is useless to me.  t is totally lost 
and I can't modify it.  What to do?!?
Henrik
19-Mar-2009
[12037]
you can't modify 't outside the layout. binding stuff.
Ammon
19-Mar-2009
[12038]
That doesn't make sense.  Code that is not specifically *in* the 
layout can't modify faces/gobs/etc???
Anton
19-Mar-2009
[12039]
Don't be ridiculous. 't exists somewhere - so find out where.
Henrik
19-Mar-2009
[12040]
Ammon, you can pass 't to a function used inside the layout, if you 
want. I'm genuinely not sure where in the system the face would be 
stored as I've not encountered a situation yet where that would be 
needed.
Anton
19-Mar-2009
[12041x3]
Oh yes, looks like Ammon's right, actually. Each Face has a reference 
to its associated Gob, but the Gob does not have a reference to the 
Face. So if you only have the gob, you can't get to the face, where 
the variables like 't can be found.
Just reading the source - correct me if I'm wrong.
Yep, I remember I came across this before, and I didn't like this 
behaviour either.
It makes debugging and learning the system more difficult.
Henrik
19-Mar-2009
[12044]
I'm not sure it does. It's not meant to be poked and hacked like 
VID can be. You go through proper channels, because the proper channels 
are actually there now. :-) Also the built in debugging functions 
can provide a lot of information.
Anton
19-Mar-2009
[12045]
not meant to be poked and hacked
 ===> yeah right !   :-)
Henrik
19-Mar-2009
[12046]
Anton, the style actors, reactors SET-FACE, GET-FACE, SET-FACET and 
GET-FACET are there to affect the given face in the way it is intended 
to be, encapsulating the functionality in the right places, so no 
hacking is needed. You just create a new style with altered functionality, 
if you need it.
Anton
19-Mar-2009
[12047]
no hacking is needed
 - this just seems naiive.
Henrik
19-Mar-2009
[12048]
I guess you haven't tried working with VID3.4 then.
Anton
19-Mar-2009
[12049x2]
You've obviously worked with it much more than me.
(It's obvious to me, anyway. I haven't done that much except a few 
experiments and reading here and there.)
Henrik
19-Mar-2009
[12051]
I have, and the actors provide everything you need and you can be 
as elaborate as you need to be, process any events anywhere you like. 
There are even specific functions to override actors, in case you 
need to make a small addition to a big actor, when creating a derivative 
style. You can also create new actors. This is not much different 
from what VID3 had, except it's easier to program.
Anton
19-Mar-2009
[12052]
Ok, so how would you modify Ammon's example so the text facet/gob 
can be inspected ?
Henrik
19-Mar-2009
[12053x2]
the question is why he wants to inspect it.
(in that, there may be a different, but just as good a method to 
do it)
Anton
19-Mar-2009
[12055]
Can you do it, or not ?
Henrik
19-Mar-2009
[12056x2]
but other than that, enabling debugging lets you see the inner workings 
of a face
http://rebol.net/wiki/GUI_howto_debug
Anton
19-Mar-2009
[12058]
So Ammon's example could be modified to:

	view [t: text "" debug]
Henrik
19-Mar-2009
[12059]
yes
Anton
19-Mar-2009
[12060]
which dumps the face contents.
Henrik
19-Mar-2009
[12061]
also:

view [t: text do [probe face]]

dumps the gob as well.
Anton
19-Mar-2009
[12062]
No, it doesn't (?)  The gob is usually returned by VIEW and molded 
by the console..
Pekr
19-Mar-2009
[12063]
there is also whole instrumentation for debugging purposes, so ...
Henrik
19-Mar-2009
[12064]
Anton, ah, it can't do that from a text label with nothing in it, 
of course. Try something like BUTTON instead.
Anton
19-Mar-2009
[12065x3]
Custom debugging print outs.

What if you just want to print the size of the TEXT face, for instance?
How would you do that? (Not dump the whole face.)
Say, on init.
Henrik
19-Mar-2009
[12068x4]
Go to the style code and add the print there.
(note that more debug outputs can be added, if some are needed)
I have a style that displays its current size inside the View window 
at all times. Perhaps this can be added as a debugging feature.
http://rebol.hmkdesign.dk/files/r3/gui/061.png
Pekr
19-Mar-2009
[12072]
debug: [style make] ?