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

World: r3wp

[Red] Red language group

Kaj
10-Sep-2011
[3271x4]
I've added the PeterPaint example, with some more comments
It demoes mouse events, drawing, program arguments and loading a 
bitmap file
I've added a sample.bmp file from SDL for easy access
SDL can be demoed on Linux. I haven't tested on Windows yet, although 
it should at least almost work
Dockimbel
10-Sep-2011
[3275]
Great, thanks!
Kaj
10-Sep-2011
[3276]
You can put GTK and SDL on the website now, if you want
Dockimbel
10-Sep-2011
[3277]
Sure, I will.
GrahamC
10-Sep-2011
[3278]
Is there an idiots guide for new users and developers?
PeterWood
10-Sep-2011
[3279]
Have you looked at the webiste - http://www.red-lang.org/- ?
GrahamC
10-Sep-2011
[3280x2]
I don't think there's a quide guide on getting started for people 
new to red and/or rebol ...
guide2 = quick guide
jocko
10-Sep-2011
[3282]
Red-SDL , and the PeterPaint example works under Windows XP apart 
from the name of the dll which is SDL.dll instead of libSDL-1.2.dll
Kaj
10-Sep-2011
[3283x2]
Ah, that's a weird transformation. I'll add it. Thanks for testing!
Where did you get the Windows SDL binaries?
GrahamC
10-Sep-2011
[3285]
this isn't it ? http://www.libsdl.org/download-1.2.php
Kaj
10-Sep-2011
[3286x2]
Oh, I thought they didn't have ready made binaries :-)
I don't seem to have an unpacker for Mac disk images. Could somebody 
tell me the SDL library name in the DMG package?
GrahamC
10-Sep-2011
[3288]
http://en.wikipedia.org/wiki/Apple_Disk_Image
Kaj
10-Sep-2011
[3289]
Yes, but I need information out of the SDL DMG
GrahamC
10-Sep-2011
[3290]
The page there refers to a number of "free" utils for unpacking dmg 
files .. though for windows
Kaj
10-Sep-2011
[3291]
I tried Linux loop mounting and 7-Zip, but my versions don't seem 
to support DMG. It's just much easier if someone with a Mac has a 
quick look
GrahamC
10-Sep-2011
[3292]
I have a mac but daughter has password protected it .. and she no 
longer lives here!
Dockimbel
11-Sep-2011
[3293x2]
Kaj: the lib name is SDL but when properly installed, it should be 
referenced as: /Library/Frameworks/SDL.framework/Versions/A/SDL
Graham: there's no such guide yet. You have a few basic instructions 
for installing Red/System and compiling the Hello script here: https://github.com/dockimbel/Red
Henrik
11-Sep-2011
[3295]
Graham, use the password utility on the installation disk to reset 
it.
Kaj
11-Sep-2011
[3296]
Doc, is that with .dylib or not?
Dockimbel
11-Sep-2011
[3297]
No extension.
Kaj
11-Sep-2011
[3298x2]
Weird, but thanks, I've changed the binding
I fear the other bindings will also need full paths on Mac
Dockimbel
11-Sep-2011
[3300]
I haven't had the time yet to test them all on Mac.
Kaj
11-Sep-2011
[3301x2]
I've added an example to the cURL binding, for reading a web page
It should run on Linux and Windows
jocko
11-Sep-2011
[3303]
problem with the cURL example  on windows XP: 
Runtime Error 1: access violation 
at 00000F16h.
Dockimbel
11-Sep-2011
[3304]
jocko: try to compile it with the -g command line option, you should 
get the error location in sources.
jocko
12-Sep-2011
[3305x2]
Runtime Error 1: access violation
in file:

that's all.  No filename
Kaj: the error seems to come at the line 
status: curl-do session url
Kaj
12-Sep-2011
[3307]
Are you using the latest Red?
MagnussonC
15-Sep-2011
[3308]
Can someone explain how arrays work in red. I've seen an example 
where you progress through an array args with  args: args + 1. I 
would have understood better if it were the index that were increased 
for each loop, like item: item +1 in args/item ...
PeterWood
15-Sep-2011
[3309x2]
There are no "standard" arrays in Red/System though I'm sure that 
there will be, or something which provides the same functionality 
in Red (when it becomes available).


args is not a standard array and is navigated through pointer arithmetic 
just like  a c-string. I suspect that args points to a list of pointers 
each of which contains the address of a command-line argument.


So the first entry in Args holds the memory address of the first 
command-line entry, the second the second command line entry, etc.


The syntax args/item gets you to the data pointed at by the relevant 
entry in args.
So the compiler doesn't treat item as an index but as a command to 
derefence the pointer heid in the current position of args.
MagnussonC
15-Sep-2011
[3311]
OK, I see. Thanks for explaining!
Kaj
15-Sep-2011
[3312]
You can also do it with an index, but indexes are one-based. With 
pointer advancement you usually get the same effect as zero-based 
indexes
MagnussonC
15-Sep-2011
[3313]
I thought I'd try the GTK+ examples. Is there somewhere I can get 
C-library.reds?
Andreas
15-Sep-2011
[3314]
http://red.esperconsultancy.nl/Red-C-library/
MagnussonC
16-Sep-2011
[3315x3]
Thank you Andreas!
*** Compilation Error: a variable is already using the same name: 
window
*** in file: %tests/hello-GTK-world.reds
Where is the recommended dir to place GTK.reds, C-library.reds & 
SDL.reds? I put them in red-system. BTW. I'm using Win 7 (x64) and 
compile with do/args %rsc.r "-v 5 %tests/hello-GTK-world.reds".
Dockimbel
16-Sep-2011
[3318x3]
You can put all the bindings source code in %/tests directory.
You shouldn't need to use the verbose option, unless you want to 
have a closer look at what the compiler is doing internally, or to 
more easily locate a compiler internal error.
BTW, I had a great time at Software Freedom Day and met very interesting 
peoples. Thanks to Bas & Kaj for organizing it and inviting me.