Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Starting Jedi on Windows 7, what are the relevant environment variables?

67 views
Skip to first unread message

Antti Karttunen

unread,
Apr 25, 2013, 4:07:43 AM4/25/13
to jazzs...@googlegroups.com


Cheers,

(the "Clone in Windows" button), and eventually unzipped it and moved to a directory named:

C:\Users\karttu\jedi\2.8\

When I start jedi.exe in the same directory (or when going into another directory, after having added
/c/Users/karttu/jedi/2.8 to PATH).
it says: "Welcome to Jedi, Please enter the profile that will be used for this session.", but after clicking Login, says:

"The following error occurred while loading the profile:
Unable to find unit: jazz
Press Continue (to bypass this problem using a generic profile class), Exit to exit immediately".

I see the problem is that it cannot find the stuff under C:\Users\karttu\jedi\2.8\lib\jazz\
(because I can reproduce the same error under the Linux version, by moving the corresponding directory temporarily somewhere else).

So, how I can tell jedi.exe where to find that unit? I tried setting environment variable LIBRARY_PATH, but to no avail.

(This probably should be in the FAQ?)


Yours,

Antti Karttunen

Guillaume Cartier

unread,
May 21, 2013, 12:47:58 PM5/21/13
to jazzs...@googlegroups.com, antti.k...@gmail.com
Hi Antti,


It includes all the latest Jazz / Jedi improvements and bug fixes and should fix the problem you encountered.

PS: Don't hesitate to report any problems or improvement ideas. Improving Jedi is a very high priority!

PPS: Adding the directory containing jedi.exe to PATH should not be necessary.

Guillaume


--
You received this message because you are subscribed to the Google Groups "Jazz Scheme" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jazzscheme+...@googlegroups.com.
To post to this group, send email to jazzs...@googlegroups.com.
Visit this group at http://groups.google.com/group/jazzscheme?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Antti Karttunen

unread,
May 25, 2013, 4:04:11 PM5/25/13
to Guillaume Cartier, jazzs...@googlegroups.com
On Tue, May 21, 2013 at 7:47 PM, Guillaume Cartier
<gcar...@jazzscheme.org> wrote:
> Hi Antti,
>
> I just pushed a new version to
> https://github.com/jazzscheme/jedi-windows-mingw.git.
>
> It includes all the latest Jazz / Jedi improvements and bug fixes and should
> fix the problem you encountered.
>
> PS: Don't hesitate to report any problems or improvement ideas. Improving
> Jedi is a very high priority!
>
> PPS: Adding the directory containing jedi.exe to PATH should not be
> necessary.

Thanks, it works better now. Merci beacoup!

Now, I would like to do some drawing with cairo-routines, directly to
some "canvas-window" on my screen. (Later also to a PNG/SVG-file).
What I should give as an argument to cairo_win32_surface_create ?
(or its platform-independent wrapper create-cairo-image-surface ?)
What it expects as that argument called "compatibility", and how do I
obtain one?

Especially if I don't want to use class Memory-Surface, but instead
write as standard Scheme as possible. Or if I have to, then I have to,
but please tell me how...


Yours,

Antti Karttunen

Guillaume Cartier

unread,
May 26, 2013, 4:58:47 PM5/26/13
to jazzs...@googlegroups.com, antti.k...@gmail.com
Here's an example drawing a red line from 0,0 to 100,100 using 2 savors of cairo: Jazzish and Schemish.

First, create an application project :

File / New Project...
Select "Application" on the left
Give it a Name: lets say "app"
Click OK

Open app / src/ app / application.jazz

Add the following code after the (import ...) form :


;; extra imports
(import (jazz.graphic)
        (jazz.platform.cairo)
        (jazz.ui.view))


;;;
;;;; Jazzish
;;;


(class Jazzish-View extends View
  
  
  (method override (draw surface context)
    (set-color~ surface {Color Red})
    (set-line-width~ surface 1)
    (move-to~ surface 0 0)
    (line-to~ surface 100 100)))


;;;
;;;; Schemish
;;;


(class Schemish-View extends View
  
  
  (method override (draw surface context)
    (let ((context (get-context~ surface)))
      (cairo_set_source_rgba context 255. 0. 0. 1.)
      (cairo_set_line_width context 1.)
      (cairo_move_to context 0. 0.)
      (cairo_line_to context 100. 100.)
      (cairo_stroke context))))


Now add the following method inside the App-Application class. It will create the view and make it cover the whole window :


(method override (finish-process)
    (nextmethod)
    (maximize~ (current-stage))
    @comment
    (new-frame Jazzish-View)
    (new-frame Schemish-View))


To run the code under the debugger, simply press F5 (Project / Debug). You should have a standalone application with a red line from 0,0 to 100,100.


Guillaume


--
You received this message because you are subscribed to the Google Groups "Jazz Scheme" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jazzscheme+...@googlegroups.com.
To post to this group, send email to jazzs...@googlegroups.com.

Antti Karttunen

unread,
May 30, 2013, 10:20:33 PM5/30/13
to Guillaume Cartier, jazzs...@googlegroups.com
Merci. It did just that, and it works fine like you say.

Next, I would like to do some animation with Cairo-routines, so I wrote a little
loop inside (class Schemish-View extends View
(method override (draw surface context)
... etc.
It works as long as I call (cairo_stroke context) after each line-drawing,
and then get a new context with (get-context~ surface)
and as long the _loop eventually terminates_
However, if I write it as never-ending loop, which keeps on drawing
(and taking care that the coordinates stay inside the window), nothing
is drawn
to the opened frame, and it goes "Not responding" when trying to move
focus into it. I tried also to call cairo_surface_flush, but it
doesn't help.
Any suggestions? Is there some post-processing in method finish-process
that I am missing?

Antti

Guillaume Cartier

unread,
May 31, 2013, 12:55:40 PM5/31/13
to Antti Karttunen, jazzs...@googlegroups.com
As Jazz implements the Windows message loop in the primordial thread, your infinite loop is stopping message processing.

The best solution is to run the animation in a thread and communicate with the primordial thread with execute-event for the actual drawing (calling execute-event will execute the lambda it is passed in the primordial thread).

For a simple example, replace your application code with the attached file. Note that the attached code assumes you called your project "app" so that your application class is "App-Application", else simply change the application class name.

PS: As you are using Jazz on Windows you could also try OpenGL which is really nice for animations. And when you're ready you can also move on to 3d animations :-)

Guillaume
application.jazz
Reply all
Reply to author
Forward
0 new messages