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

AltME groups: search

Help · search scripts · search articles · search mailing list

results summary

worldhits
r4wp239
r3wp2252
total:2491

results window for this page: [start: 1301 end: 1400]

world-name: r3wp

Group: Core ... Discuss core issues [web-public]
Gabriele:
8-May-2008
random/secure - it has been explained already, instead of using the 
libc rand() call, a crypto-safe random algo is used.
Geomol:
8-May-2008
So a way to get good random numbers over a long period of time, is 
to start such a routine (like the Mersenne twister) only once. The 
routine should then work with a high number of bits, the more the 
better and store the state, it has come to, to disk. Every time the 
computer is turned on, it can pick the state from disk, and start 
from where it left off. A password generator should use this routine 
and call it between each character in the password. If the routine 
has high enough resolution, it should be possible to produce 60 ** 
8 different passwords.
Geomol:
9-May-2008
I'm not fair using the word "ignorance". I don't think, you are. 
I base my conclusion on the following:


See the password generator as a black box, that you feed with an 
integer, and out come a password. The integer input has 2 ** 32 different 
combinations and is used for the random/seed. Out come a password, 
and there can only be 2 ** 32 different passwords coming out at most. 
It doesn't matter, how the algorithm is constructed, if you put time 
delay in, call random or random/seed more than once, etc, as long 
as you don't get other input as the first integer. This is basic 
in information theory. And it's related to the determinism in digital 
computing.
BrianH:
16-Jun-2008
This may be one of those use-another-tool-through-call or use-R3's-64-bit-integers 
situations.
Claude:
11-Oct-2008
hi, i would like to know how to open a port with rebol in FTP to 
connect a ISERIES or IBM I or AS400 and execute commande like this 
on  "quote namemft 1" or "cd /" or "quote syscmd call a PGM"
Davide:
15-Oct-2008
hi, I need your help with bind:
- I have an object h

h: make object! [
    q: []
]
append h/q make object! [
	f1: func [a][print ["f1" a]]
	f2: func [b][f1 join "f2 " b]
]

if I call f1 and f2 the results are correct:

>> h/q/1/f1 "hi"
f1 hi
>> h/q/1/f2 "hi"
f1 f2 hi

---------------------


Now, I want to make the code of f2 dynamic, so I add a second param 
"code" to f2:

h/q/1/f2: func [b code][do code]

of course this doesn't work, f1 and b aren't bound:

>> h/q/1/f2 "hi" [f1 join "f2 " b]
** Script Error: f1 has no value
** Where: f2
** Near: f1 join "f2 " b

I've tried with no luck the followings:
h/q/1/f2: func [b code][do bind code 'f2]
h/q/1/f2: func [b code][do bind code in h/q/1 'f2]

What is the magic word: "do bind code ******* " ?
Dockimbel:
18-Oct-2008
Here's my attempt with a caching and fully recursive version :

fibonacci: func [n /local f][
	f: [0.0 1.0]
	either f/(n + 1) [copy/part f n + 1][
		fibonacci n - 1
		append f f/:n + f/(n - 1)
	]
]

probe fibonacci 3	
probe fibonacci 46
probe fibonacci 8

Note that :


1) The last call with 8 value is just an extraction of the pre-computed 
cached sequence (cached values up to 46th by the previous call), 
so it executes in 0(1).


2) References to 'n (except fibonacci n - 1) are incremented by 1 
to account for REBOL series 1-based indexes. If we could switch to 
0-based indexes, the function source would be more readable (closer 
to the pure algorithm).
PeterWood:
7-Nov-2008
If you're not looking for further return values, you could approximate 
this behaviour by using call or launch.
Nicolas:
29-Nov-2008
files: read %/c/

l: layout [
	origin 0 space 0x0	
	f: field 600 [call to-file t/data/1] 
	t: text-list 600x400 data copy files [call to-file t/picked/1]
]

append second get in ctx-text 'edit-text [
	t/data: copy files 
	blk: load f/text
	attempt [remove-each file t/data :blk]
	show t

]

focus f  view l
[unknown: 5]:
1-Dec-2008
best way might be to use 'call and use the ping command since REBOL 
doesn't support ICMP
Graham:
1-Dec-2008
or did he just call ping asynchronously
[unknown: 5]:
1-Dec-2008
He wrote an async call that called the ping command.
Geomol:
20-Dec-2008
Hard to read that setting-to-none line, and I haven't found a way 
to do it by a function call (like a clear-locals function).
BrianH:
21-Dec-2008
Note that his solution requires the known word parameter, but not 
the function context parameter. This means that it is more easy to 
call from "inside" the function where you can specify a known word 
instead of having to find one. The no-parameter solution is still 
up in the air :)
BrianH:
21-Jan-2009
*TARD indeed, because such a function wouldn't be able to call external 
functions, not even DO :)
Will:
25-Jan-2009
I'm not sure I understand what call/show introduced in 2.7.6 does?
Oldes:
25-Jan-2009
When you did call, the black cmd window was always visible. Now you 
must do call/show to see the window (which you mostly don't want 
to see) And  I think this was just Windows change. I'm not sure how 
it worls on Linux or in other OSes.
Oldes:
25-Jan-2009
Because call is asking security question if you don't run rebol with 
at least -s switch
Will:
25-Jan-2009
not even sure the problem is with call, what is sure is cpu goes 
full, the dns help process quit ok, ktrace on that process return 
nothing
Oldes:
25-Jan-2009
I'm testing it now with cheyenne and it seems not to be working... 
even if I do:
	print "Content-type: text/html^/"
	tmp: copy ""
	call/output/wait "dir" tmp
	probe tmp
Will:
25-Jan-2009
sorry I may have been more clear, the code is in uni-engine.r, this 
line:

call/show join form to-local-file system/options/boot [" -qs " cmd]
not in a RSP, and not sure at all the problem is with call... 8/
Will:
27-Jan-2009
about my problem (a couple of messages above) I can confirm that 
the problem doesn't exist with 2.7.5.

2.7.6, supposedly fixed [call] but did it introduce a new bug? has 
it maybe to do with hevy cpu, timing, rebol dns helper process?
Will:
27-Jan-2009
I'm having a hard time producing code that reproduce the bug, if 
anyone can provide a piece of code that could stresstest [call] I'd 
be gratefull! 8)
Dockimbel:
1-Feb-2009
I've just hit a serious issue in 2.7.6 on UNIX platforms today.


Briefly: CLOSE on TCP ports doesn't work anymore if CALL is used 
before CLOSE, in a AWAKE handler.

To reproduce this bug, get the tests scripts here :

write %server.r read http://softinnov.org/tmp/server.r
write %client.r read http://softinnov.org/tmp/client.r
write %foo.r read http://softinnov.org/tmp/foo.r


Then, read the comment section in %server.r and launch it to see 
by yourself : do %server.r

Notes:
     o Windows is not affected by this issue.

     o I consider this a major issue for all REBOL server applications 
     working in async mode and spawning processes.

     o I'm posting first here before RAMBO, so that people can test and 
     point out any possible bad interpretation from me.
Dockimbel:
1-Feb-2009
Using LAUNCH instead of CALL shows the same issue.
Maarten:
1-Feb-2009
Doc, iirc there was a same sort of isseu with system ports in pre-2.7.6 
and TCP and Gabriele got around it in the Detetcive project. He also 
wrapped up the async-call and made it available for linux then. I 
have it, he has it, but I suspect Gabriele can fill you in on the 
details. Let me know if (and how) you want it.
Dockimbel:
1-Feb-2009
Well, thanks for the offer, having Gab's Call script would save me 
some useful time. Anyway, I would rather prefer Carl to fix this 
issue. Carl maybe forgot, but all RT's customers are running on R2, 
not R3. The priority should be clear.
Maarten:
1-Feb-2009
Yes, but not sure what it was anymore. I know Gabriele ran into something. 
Anyway, we have an async-call - basically the working linux version 
of your libv
Anton:
2-Feb-2009
After 5 seconds, client.r and foo.r are present:

$ ps aux | grep reb[v]iew

anton     9006  0.0  0.4  13268  9656 pts/1    SNs+ 00:33   0:00 
/rebol/rebview2.7.006.4.2 -s -- do-anton-user?: true

anton     9007  0.0  0.0   6084   536 pts/1    SN+  00:33   0:00 
/rebol/rebview2.7.006.4.2 -s -- do-anton-user?: true

anton     9008  0.0  0.0   6084   464 pts/1    SN+  00:33   0:00 
/rebol/rebview2.7.006.4.2 -s -- do-anton-user?: true

anton     9072  0.3  0.3  11952  8228 pts/1    SN+  00:35   0:00 
/rebol/rebview2.7.006.4.2 -qws client.r

anton     9073  0.0  0.0   6128  1084 pts/1    SN+  00:35   0:00 
/rebol/rebview2.7.006.4.2 -qws client.r

anton     9074  0.0  0.0   6084   468 pts/1    SN+  00:35   0:00 
/rebol/rebview2.7.006.4.2 -qws client.r

anton     9079  0.5  0.3  11828  8068 pts/1    SN+  00:35   0:00 
/rebol/rebview2.7.006.4.2 -qws foo.r

anton     9080  0.0  0.0   6084   536 pts/1    SN+  00:35   0:00 
/rebol/rebview2.7.006.4.2 -qws foo.r

anton     9081  0.0  0.0   6084   464 pts/1    SN+  00:35   0:00 
/rebol/rebview2.7.006.4.2 -qws foo.r

After foo.r finishes waiting:

$ ps aux | grep reb[v]iew

anton     9006  0.0  0.4  13268  9656 pts/1    SNs+ 00:33   0:00 
/rebol/rebview2.7.006.4.2 -s -- do-anton-user?: true

anton     9007  0.0  0.0   6084   536 pts/1    SN+  00:33   0:00 
/rebol/rebview2.7.006.4.2 -s -- do-anton-user?: true

anton     9008  0.0  0.0   6084   464 pts/1    SN+  00:33   0:00 
/rebol/rebview2.7.006.4.2 -s -- do-anton-user?: true

anton     9072  0.4  0.0      0     0 pts/1    ZN+  00:35   0:00 
[rebview2.7.006.] <defunct>

anton     9079  0.4  0.0      0     0 pts/1    ZN+  00:35   0:00 
[rebview2.7.006.] <defunct>


And when close port is done before call in the awake function, then 
client.r becomes defunct while foo is still waiting.
[unknown: 5]:
21-Feb-2009
Seems to me that the assignment aspect is still buggy.  i would expect 
to get lit-word? true on the first call in that example.
[unknown: 5]:
21-Feb-2009
But 'test is a value - not a function.  It is the end value as I 
call it.  In other words it doesn't evaluate.
BrianH:
21-Feb-2009
The difference is between your data:
>> ['a]
== ['a]
and the data of the DO function:
>> 'a
== a


Just because your code is data, doesn't mean your code is *your* 
data. It is actually DO's data, and DO interprets its data as what 
we think of as the REBOL syntax. I didn't see you complain that the 
set-word! in your code was treated as an assignment, or that the 
word! print is treated as a function call. The treatment of lit-word! 
values *in code* is no different from those.
BrianH:
22-Feb-2009
Paul, in REBOL 'test is a lit-word!. The problem is that you are 
getting datatypes and evaluation rules mixed up. When you are evaluating 
your own data, you can treat lit-words any way you like. When DO 
is evaluating *its* data (what you would call normal REBOL code), 
it treats lit-words as active values. Active values are normally 
evaluated when DO encounters them - the only exception is when they 
are just retrieved from some word they are assigned to, either using 
GET, or DO's shortcut for GET: get-words. All of DO's active values 
work this way.


And there is a good reason DO treats lit-words as active values: 
If there were no active lit-words, DO wouldn't be able to refer to 
word values without breaking words as variables, and normal REBOL 
code would cease to function.


When I say that it is not a bug that lit-words are active values, 
I am understating things. What is really the case is that lit-words 
being active values is the *entire reason for their existence* - 
if they weren't active values, there would be no point to them at 
all. Oh, and REBOL code wouldn't be able to work with its current 
syntax.
[unknown: 5]:
23-Feb-2009
gotta call in for unemployment be back in awhile depending on when 
i get thru on the phone.
BrianH:
23-Feb-2009
FYI: R2-Forward is currently usable from a DO call, prebol (the SDK 
preprocessot) or Gabriele's R2 module system.
Graham:
3-Mar-2009
Anyone have an idea of what might be causing this problem?

make object! [
   code: 331
   type: 'script
   id: 'call-fail
   arg1: "The system cannot find the path specified.^M^/"
   arg2: none
   arg3: none
   near: [browse/only join http://127.0.0.1:8002/ url]
   where: 'browse-local
]
Graham:
3-Mar-2009
call-fail means what??  That rebol can't find the browser?
Dockimbel:
4-Mar-2009
>> help system/error/script/call-fail

SYSTEM/ERROR/SCRIPT/CALL-FAIL is a block of value: ["External process 
failed:" :arg1]
Maxim:
7-Mar-2009
I can see it being used properly for well documented call-backs.
BrianH:
13-Mar-2009
As for nforeach, you didn't catch that the first thing I would change 
would be to have the words and data in separate blocks, to make generation 
of the data and pipelining easier. The words are an artifact of the 
call to nforeach, not part of the data. You need DO/next to implement 
the old version, not a version that I was talking about. Any REDUCE 
would be outside the function.
Oldes:
24-Mar-2009
how zou would call it?
Geomol:
30-Mar-2009
Hm, a SWAP command could be a good idea, maybe. Or just do:
set [a b] reduce [b a]


About freeing local variables, why would you do that? Don't you call 
your function several times? You give garbage collector more to do 
this way. If it's often the case, that locals should be freed, then 
maybe we need a new function type, that does that?


(I'm asking all this, because I never understood the reason for having 
ALSO.)
Geomol:
30-Mar-2009
If I have a simple local in a language like C, I wouldn't allocate 
and free it every time, I call my function.
Geomol:
30-Mar-2009
As I see it, it's the garbage collectors job. When I use large series, 
I declare them like this in my functions:
some-series: clear []

Then I reuse the same memory, every time I call my function. I have 
never used ALSO.
eFishAnt:
30-Mar-2009
wow, thanks Paul.  I think I freaked momenarily.  If I have to do 
it through Windoze I figure I could do a call (as a backup plan)
Geomol:
31-Mar-2009
What happens, where you call process-port? Don't you have a variable 
there?
Geomol:
31-Mar-2009
What is the overhead for calling a function compared to not call 
it? And by having the close down in a function mean, it may not be 
on the same level as the open, which may be seen as bad programming 
style.
Geomol:
31-Mar-2009
If you want to load more MP3s, it would be a good idea to reuse the 
same memory area. An example:

>> f: func [/local blk] [blk: []]   
>> a: f
== []
>> insert a 42
== []
>> a
== [42]
>> source f
f: func [/local blk][blk: [42]]
>> clear a
== []
>> source f
f: func [/local blk][blk: []]


You see, A and BLK inside F points to the same memory. Next time 
you call F, you can put some more stuff in BLK (read another MP3).

If you want to be able to completely remove BLK, I would do that 
using an object. Build the MP3 player as an object, instead of just 
a function. Makes sense?
Geomol:
31-Mar-2009
Yes, I understand that. What I don't understand, is how you call 
these functions, and what does on with the data, you get returned 
from your function. Do you have code examples online, I can look 
at?
Anton:
31-Mar-2009
That was more likely some external library call problem.
BrianH:
31-Mar-2009
Closures are different though - a whole new context is created with 
each call, words and values both.
Geomol:
1-Apr-2009
Gabriele, I wasn't very clear with my port example. I didn't mean 
a local word. I'll use your TAKE example. Let's say, we have this 
code:

take: func [block] [also last block remove back tail block]
...
item: take my-block


Have TAKE makes the code smaller, but is it more readable? You have 
to know exactly, what take does, but you have to with many words. 
And is it worth the overhead? Let's compare it to this code, that 
does the same:

item: last my-block
remove back tail my-block


The first version has the overhead of a function call and use of 
ALSO. The last version produce more code, if TAKE is used many times 
through the program. Let's look at a version of TAKE without use 
of ALSO:


take: [block /local item] [item: last block remove back tail block 
item]


This last version has a local word, item. To me, it seems like a 
tricky way to just save a local word. But maybe it's just me, that 
need to see this some more.
BrianH:
1-Apr-2009
Native code can call REBOL functions, but I don't know how it does 
so, just that it isn't a standard function call.
amacleod:
21-Apr-2009
I'm trying to auto update an exe.

My code worked for script version buy with the encapped version it 
seems to buzz through without executing some statements...

write/binary %NEW.exe read/binary http://website/client.exe
delete %captain.exe
rename %NEW.exe %client.exe
notify "Update Complete!"
call/show %client.exe


IT seems to start up the client before the new one has been dowmloaded 
and renamed..
Pekr:
21-Apr-2009
I would put small wait before the 'call.  What about call/wait? Hmm, 
that would wait before next function call. This is strange ...
Pekr:
21-Apr-2009
'delete calls 'remove. The question is, if that native really waits 
for the result, or just submits the call to OS layer and returns. 
Then, especially with crappy sloppy Windows FS you might get some 
delay ...
Graham:
21-Apr-2009
Then do a call/quit to the update.cmd script.
Group: View ... discuss view related issues [web-public]
Pekr:
6-Oct-2006
fuctnion words remember their values? g 2 results in 1, which is 
there because there was first call to f 1
Louis:
16-Oct-2006
It would be logical to call the refinement /except:

/except "Block of fields not to clear."
Maxim:
20-Oct-2006
or more specifically the call to make-face/spec
Maxim:
20-Oct-2006
I want to make sure that I don't try to call show on a face before 
its been initialised...
Maxim:
1-Nov-2006
the window's feel is different and accepts 'close events (in feel/detect).

it not very easy to deal with this because when you call 'view on 
a window, its feel is replaced automatically by view.  so you must 
explicitely replace the feel AFTER calling view on a layout or a 
face.


alternatively, you can also use an input even handler, which is probably 
a better solution:

this is one way to handle the close for all windows: 
   http://www.rebol.com/docs/view-system.html#section-5.13
Henrik:
6-Dec-2006
(I don't know what's involved, so I just call it "new and faster 
SHOW" :-))
Maxim:
19-Dec-2006
so you could implement your hpane directly within GLayout, but you'd 
have an automatic way to call the resizing, for example...
Pekr:
16-Jan-2007
for the VID 2 (or better let's call it VID 3.0?), we should count 
with things like space for hilite and visual focus representation 
....
Jerry:
23-Jan-2007
We have a software product. The version one used .NET, which made 
our software 10 MB in size. The version two uses C/C++ and some third 
party GUI components, it's 6 MB. but that's still too large for us. 
Few days ago, my boss asked me  whether I could redesign the GUI 
part of our software using REBOL. and I said ... maybe, if I could 
make my REBOL code call GetGlyphOutline successfully. Our product 
needs Chinese character support.
Ingo:
24-Jan-2007
Pekr ... I may be wrong here, but doesn' t .Net call Windows libs, 
too?
Gabriele:
3-Feb-2007
however, since this depends on the application etc., i think the 
best solution is to call the action on enter, and just call face/refocus 
on tab / shift-tab. then you can make refocus do the same as the 
action, or not.
Maxim:
12-Feb-2007
hum... a yellow green blue gradient  give me a ring of BLACK right 
in the middle... not what I call very precise... maybe cyphre could 
explain the maths behind the gradients so we can understand  what 
we are doing?
Maxim:
9-Mar-2007
I can use a face and call to-image on it, but I'd think that creating 
the image directly is faster, especially since I wanted to use the 
draw command directly on the bitmap too.
btiffin:
3-Apr-2007
Hi,


   Anyone know the inner workings of the  browse  native under Linux? 
    I lost a working browse with 2.7.5, and had to put in the old hack 
   using call.   I was hoping I could just configure my Linux to help 
   the native browse find a browser.
Gabriele:
3-Apr-2007
i haven't checked the recent versions... but browse used to just 
call /usr/bin/netscape (or variants of that) on unix.
btiffin:
3-Apr-2007
I'm lucky and have a fire-and-forget brain.  I solved this problem 
(with the help of others) on an older Debian 3.1 box.  And I forget 
how it was done.  If we are patient, one of the guru's will give 
us that little tidbit that gets the problem solved.   For what it 
is worth this is the hack I've been using.

linux?: equal? fourth system/version 4
if linux? [
    attempt [unprotect 'browse]
    browse: func [value [any-string!] /only] [
	    call reform ["konqueror " rejoin [{"} value {"}]]
    ]
]
Maxim:
20-Apr-2007
I just discovered that a face with a rate, once shown, will trigger 
time events even if its not within any face, and even calling hide 
on it does not seem to stop its events!  you need to set its rate 
to none and call show on it (even though its not visible in anyway, 
since its not within any window !)
Robert:
12-May-2007
I use async-call from Doc but it fails with: CreatProcess failed!
Robert:
12-May-2007
I really can't believe that the current Rebol has problems with supporting 
native requestors (didn't used them yet) and getting call done right...
Gregg:
12-May-2007
My old issue was with making it print automatically. I used both 
CALL and ShellExecute with it, but I also had logic to find the actual 
Acrobat EXE.
Pekr:
8-Jul-2007
How do I do following?

copy-screen: center-face layout [screen code here]


forever [ if new disk is found .... start screen, call copy routine]


And now I have a problem - if I do view copy-screen, call of copy 
routine is not performed. So I tried to put the copy routine into 
do [call copy routine] into the layout code, but those variables 
are not known yet ...


I would like to have some "delayed" run of 'do section. (view/new 
and do-events is not possible, as my copy routine is recursive and 
do-events would be callled multiple-times. Is there any trick? Timer 
probably? Well, but trouble is, that script sits in the background, 
and copy screen should apper only if new disk with appropriate content 
is found, then it should disapper and go to wait mode into background 
....
Pekr:
8-Jul-2007
simply put I need following - 1) define layout 2) run main loop. 
If device detected, start screen 3) call copy function from the screen 
4) unview screen, back to main loop
Pekr:
8-Jul-2007
where should I call my copy-dir function from?
Pekr:
8-Jul-2007
Graham - I used one trick, I defined new style in VID, called init, 
set rate to 1and defined engage block. After first call, I removed 
timer, but it worked in a bit weird way. In my copy routine I used 
little wait, but it did not work properly ...
Gabriele:
8-Jul-2007
petr, while you are busy copying, you are not handling events, so 
no do-events there. you can call wait 0 every iteration if you want 
to respond to events while copying.
Pekr:
8-Jul-2007
Gabriele - how could I do it with view/new? I can't start copying 
after it, because I want to update screen. I can show some elements, 
but e.g. buttons will not be active, unless do-events is being run. 
That is why I complicated my script by implementing "delayed" copying 
= view copy-screen, there is an 'init style with rate 1 and engage 
defined. I check if it is a first run, and if so, I set rate to none, 
call show, and that is the place from  where I call my copy-dir function 
.....
Gabriele:
8-Jul-2007
you have to do view/new, then inside copy-dir you need to call wait 
0 every now and then (eg. every file you copy) if you need your buttons 
to work.
Gabriele:
8-Jul-2007
even if you call copy-dir from engage, events are not processed while 
inside copy-dir unless you call wait
Pekr:
17-Jul-2007
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 ...
james_nak:
27-Sep-2007
For those kinds of things I end up usinga thing call list-view : 
) or just the text-list when I can go lo-tech.
btiffin:
3-Oct-2007
James; Depending on the version you have (I can never remember what's 
what anymore in terms of SDK features amd if you need keys if running 
2.7.5 vs 1.3.2 etc) try looking into  launch  and  call.  do will 
work if there are no quits or halts; falling through the end of a 
script returns the value of the last expression, but halt will halt 
the caller, and quit just bails.  If you are willing to recode a 
little bit, change all the quits and halts to  throw  and wrap the 
do in  catch [do ...]  (along with the unviews)  Best is launch, 
it spawns off a brand new process.
Gregg:
3-Oct-2007
James, yes, you can. You can use do/args and pass info, along with 
a callback func in the main app, that the launched app should call.
Gabriele:
2-Nov-2007
i don't think launch will pass any arguments. you could try using 
call with system/options/boot
Gregg:
2-Apr-2008
That's Carl's call, and he has strong ideas about how to do things. 
:-)
Anton:
18-Apr-2008
What should I call the function that does this?
auto-trim-bitmap-text
 ?
Henrik:
14-Oct-2008
each to-postscript call produces one single page.
Henrik:
14-Oct-2008
that means if you have 4 pages, you create 4 separate layouts and 
call to-postscript 4 times.
Nicolas:
21-Nov-2008
REBOL []

index: func [dir list /local files] [
	files: sort load dir
	foreach file files [append list join dir file]

 foreach file files [attempt [if find file "/" [index dir/:file list]]]
] index %/c/ files: []

l: layout [
	f: field 600 [call t/picked]
	t: text-list 600x400 data copy files] 

search: func [f-string] [
	t/data: copy files  

 foreach s parse f-string none [remove-each f t/data [not find f s]]
	show t]


append blk: select select second get in f/feel 'engage [switch act][key] 
bind [search f/text] blk/2

focus f view l



if I type something into the field, then I click the slider, it calls 
t/picked. Why? i can't figure it out.
Nicolas:
21-Nov-2008
index: func [dir list /local files] [
	files: sort load dir
	foreach file files [append list join dir file]

 foreach file files [attempt [if find file "/" [index dir/:file list]]]
] index %/c/ files: []

l: layout [
	f: field 600 [call t/picked]
	t: text-list 600x400 data copy files] 

search: func [f-string] [
	t/data: copy files  

 foreach s parse f-string none [remove-each f t/data [not find f s]]
	append clear t/picked t/data/1
	show t]


append blk: select select second get in f/feel 'engage [switch act][key] 
bind [search f/text] blk/2

append clear t/picked t/data/1
focus f view l



if I type something into the field, then I click the slider, it calls 
t/picked.
Anton:
21-Nov-2008
This is just the same as:
	view layout [
		field [call t/picked]
		t: text-list
	]
Anton:
21-Nov-2008
It calls t/picked because [call t/picked] is the action block specified 
after FIELD.
Are you confused about action blocks in VID ?
Oldes:
3-Mar-2009
You don't need wrapper, but you cannot do: save-image %test.jpg to-image 
layout [button "hello world"]

Also IM can be used as a command line tool, which I was doing quite 
a long time. But finally I'm working on wrapper as it's faster than 
doing many calls to external app. Of course.. if you want to resize 
100 photos per year, you don't care if it's call or by using wrapper.
Gregg:
4-May-2009
REBOL []

; r/3 = 'activate = left-click
; r/3 = 'activate = rt-click+menu-item-sel

hex: func [
    {Returns the base-10 value of a hexadecimal number.}
    value [integer! string! issue!] "A hexadecimal number"
][

    ; Convert to an issue first, so integers can also be translated.
    to integer! to issue! value
]

make-elements: func [name count type /local result][
    if not word? type [type: type?/word type]
    result: copy "^/"
    repeat i count [
        append result join name [i " [" type "]" newline]
    ]
    to block! result
]

NOTIFYICONDATA: make struct! compose [
    cbSize  [integer!]
    hwnd    [integer!]
    uId     [integer!]
    uFlags  [integer!]
    uCallBackMessage [integer!]
    hIcon   [integer!]
    (make-elements 'szTip 64 #"@")  ; CHAR
] none
NOTIFYICONDATA/cbSize: length? third NOTIFYICONDATA

;change at third NOTIFYICONDATA 25 "New ToolTip!"
;probe NOTIFYICONDATA
;halt

;constants required by Shell_NotifyIcon API call:
NIM_ADD:     hex 0
NIM_MODIFY:  hex 1
NIM_DELETE:  hex 2
NIF_MESSAGE: hex 1
NIF_ICON:    hex 2
NIF_TIP:     hex 4
WM_MOUSEMOVE:       hex 200
WM_LBUTTONDOWN:     hex 201  ;   'Button down
WM_LBUTTONUP:       hex 202  ;     'Button up
WM_LBUTTONDBLCLK:   hex 203  ; 'Double-click
WM_RBUTTONDOWN:     hex 204  ;   'Button down
WM_RBUTTONUP:       hex 205  ;     'Button up
WM_RBUTTONDBLCLK:   hex 206  ; 'Double-click


;Public Declare Function SetForegroundWindow Lib "user32" (ByVal 
hwnd As Long) As Long

lib: load/library %shell32.dll

Shell_NotifyIcon: make routine! compose/deep [
    dwMessage [integer!]
    pnid      [struct! [(NOTIFYICONDATA)]]
    return:   [integer!]
] lib "Shell_NotifyIconA"


my-hwnd?: does [second get-modes system/ports/system [window]]

set-tray-tooltip: func [struct string] [
    change at third struct 25 string
    struct
]



system-awake: func [port /local evt][
    if all [evt: pick port 1  (evt/1 = 'tray)] [
        status/text: mold evt
        show status
;         if any [
;             (evt/3 = 'activate)
;             all [(evt/3 = 'menu)  (evt/4 = 'desktop)]
;         ] [
;             if not desktop-loaded [
;                 link-exec-start-desktop/force
;             ]
;         ]
;         if all [(evt/3 = 'menu)  (evt/4 = 'quit)] [quit]
    ]
    false
]

system/ports/system/awake: :system-awake
append system/ports/wait-list system/ports/system

view layout [
    style button button 200
    button "Add Tray Menus" [
        set-modes system/ports/system compose/deep [
            tray: [
                add main [

                    help: (rejoin ["REBOL/Link" any [""]]) ; tooltip

                    menu: [test: "Test" desktop: "Start Desktop" bar quit: "Quit"]
                ]
                add other [
                    ;help: (rejoin ["REBOL/Link" any [""]])
                    menu: [test-2: "Test-2" bar quit-2: "Quit-2"]
                ]
            ]
        ]
    ]
    button "Remove Tray Main Menu" [
        set-modes system/ports/system [
            tray: [remove main]
        ]
    ]
    button "Remove Tray Other Menu" [
        set-modes system/ports/system [
            tray: [remove other]
        ]
    ]
    ;button "Change Tray Other Menu" [
    ;    set-modes system/ports/system [
    ;        tray: [
    ;            change other [
    ;                help: "New Help!"

    ;                menu: [test-3: "Test-3" bar quit-3: "Quit-3"]
    ;            ]
    ;        ]
    ;    ]
    ;]
    button "Modify Tooltip" [
        nid: make struct! NOTIFYICONDATA none
        nid/hwnd: my-hwnd?
        nid/uid: 1
        nid/cbSize: length? third nid
        nid/uFlags:  NIF_TIP  ; NIF_ICON
        ;nid/hIcon:
        ;nid/szTip:  "New ToolTip!^@"
        set-tray-tooltip nid "New ToolTip A!"
        ;print mold third nid
        res: Shell_NotifyIcon NIM_MODIFY nid
        print [res to logic! res]
    ]
    button "Modify Other Tooltip" [
        nid: make struct! NOTIFYICONDATA none
        nid/hwnd: my-hwnd?
        nid/uid: 2
        nid/cbSize: length? third nid
        nid/uFlags:  NIF_TIP  ; NIF_ICON
        ;nid/hIcon:
        ;nid/szTip:  "New ToolTip!^@"
        set-tray-tooltip nid "New ToolTip B!"
        ;print mold third nid
        res: Shell_NotifyIcon NIM_MODIFY nid
        print [res to logic! res]
    ]
    button "Unview" [unview]
    status: text 200
]



free lib
1301 / 249112345...1213[14] 1516...2122232425