Discussion:
Help with Rendering GUIs from Lisp
Matthew Swank
2011-05-16 13:55:15 UTC
Permalink
Content preview: I am porting the Morphic GUI tool kit, Or more specifically
the subset that is implemented in morphic.js: http://www.chirp.scratchr.org/blog/?p=34.
I am a little overwhelmed by the options for rendering the GUI to screen.
The JS implementation uses html5 canvas elements where Canvases, Images,
and Contexts are rolled into or are part of the same object. [...]

Content analysis details: (-0.7 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
0.0 FREEMAIL_FROM Sender email is freemail
(akopa.gmane.poster[at]gmail.com)
-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low
trust
[209.85.210.179 listed in list.dnswl.org]
-0.0 SPF_PASS SPF: sender matches SPF record
0.0 RFC_ABUSE_POST Both abuse and postmaster missing on sender domain
0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid
0.0 T_TO_NO_BRKTS_FREEMAIL T_TO_NO_BRKTS_FREEMAIL
Archived-At: <http://permalink.gmane.org/gmane.lisp.cl-pro/376>

I am porting the Morphic GUI tool kit, Or more specifically the subset
that is implemented in morphic.js:
http://www.chirp.scratchr.org/blog/?p=34.

I am a little overwhelmed by the options for rendering the GUI to screen.
The JS implementation uses html5 canvas elements where Canvases,
Images, and Contexts are rolled into or are part of the same object.

In am a relative novice in graphics programming, so it's hard for me
to differentiate among the merits of the various bindings available to
common lisp to do this. However, using the html canvas code as
guide, I am gravitating towards some sort of high level canvas that
writes to a lower level back end (vecto -> lispbuilder-sdl, cl-cairo).

Does anyone have guidance on the best way to approach this? Should I
consider "raw" SDL surfaces, perhaps with SDL_ttf for font rendering?
Is OpenGL a reasonable option for what is essentially a 2d
environment?

Matt
Ken Tilton
2011-05-16 14:01:37 UTC
Permalink
Content preview: On 5/16/2011 9:55 AM, Matthew Swank wrote: > I am porting
the Morphic GUI tool kit, Or more specifically the subset > that is implemented
in morphic.js: > http://www.chirp.scratchr.org/blog/?p=34. > > I am a little
overwhelmed by the options for rendering the GUI to screen. > The JS implementation
uses html5 canvas elements where Canvases, > Images, and Contexts are rolled
into or are part of the same object. > > In am a relative novice in graphics
programming, so it's hard for me > to differentiate among the merits of the
various bindings available to > common lisp to do this. However, using the
html canvas code as > guide, I am gravitating towards some sort of high level
canvas that > writes to a lower level back end (vecto -> lispbuilder-sdl,
cl-cairo). > > Does anyone have guidance on the best way to approach this?
Should I > consider "raw" SDL surfaces, perhaps with SDL_ttf for font rendering?
Is OpenGL a reasonable option for what is essentially a 2d > environment?
Yes on the OpenGL. I used that (with FTGL for nice fonts) to execute my Cello
GUI. Whether or not you want to do 3-D OpenGL is still fast, portable, powerful,
and pretty. [...]

Content analysis details: (-0.7 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
0.0 SINGLE_HEADER_2K A single header contains 2K-3K characters
0.0 FREEMAIL_FROM Sender email is freemail (kentilton[at]gmail.com)
-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low
trust
[209.85.160.179 listed in list.dnswl.org]
-0.0 SPF_PASS SPF: sender matches SPF record
0.0 RFC_ABUSE_POST Both abuse and postmaster missing on sender domain
0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid
0.0 T_TO_NO_BRKTS_FREEMAIL T_TO_NO_BRKTS_FREEMAIL
Archived-At: <http://permalink.gmane.org/gmane.lisp.cl-pro/377>
I am porting the Morphic GUI tool kit, Or more specifically the subset
http://www.chirp.scratchr.org/blog/?p=34.
I am a little overwhelmed by the options for rendering the GUI to screen.
The JS implementation uses html5 canvas elements where Canvases,
Images, and Contexts are rolled into or are part of the same object.
In am a relative novice in graphics programming, so it's hard for me
to differentiate among the merits of the various bindings available to
common lisp to do this. However, using the html canvas code as
guide, I am gravitating towards some sort of high level canvas that
writes to a lower level back end (vecto -> lispbuilder-sdl, cl-cairo).
Does anyone have guidance on the best way to approach this? Should I
consider "raw" SDL surfaces, perhaps with SDL_ttf for font rendering?
Is OpenGL a reasonable option for what is essentially a 2d
environment?
Yes on the OpenGL. I used that (with FTGL for nice fonts) to execute my
Cello GUI. Whether or not you want to do 3-D OpenGL is still fast,
portable, powerful, and pretty.

hth, kt

ps. To avoid being overhelmed, just concentrate on "Hello world"

k
Alexander Repenning
2011-05-18 15:58:32 UTC
Permalink
Post by Matthew Swank
I am porting the Morphic GUI tool kit, Or more specifically the subset
http://www.chirp.scratchr.org/blog/?p=34.
I am a little overwhelmed by the options for rendering the GUI to screen.
The JS implementation uses html5 canvas elements where Canvases,
Images, and Contexts are rolled into or are part of the same object.
In am a relative novice in graphics programming, so it's hard for me
to differentiate among the merits of the various bindings available to
common lisp to do this. However, using the html canvas code as
guide, I am gravitating towards some sort of high level canvas that
writes to a lower level back end (vecto -> lispbuilder-sdl, cl-cairo).
Does anyone have guidance on the best way to approach this? Should I
consider "raw" SDL surfaces, perhaps with SDL_ttf for font rendering?
Is OpenGL a reasonable option for what is essentially a 2d
environment?
Matt
Not completely sure I understand what you need. The XMLisp approach (http://code.google.com/p/xmlisp/) is to create GUIs as DOM-like structures of 2D (Cocoa controls) and 3D (OpenGL views). The controls are platform native (OS X, Windows). Control actions are written in Lisp in a way to make it quite simple to mix 2D and 3D content.

Alex


Prof. Alexander Repenning

University of Colorado
Computer Science Department
Boulder, CO 80309-430

vCard: http://www.cs.colorado.edu/~ralex/AlexanderRepenning.vcf
Matthew D. Swank
2011-05-18 20:08:58 UTC
Permalink
Content preview: On 05/16/2011 09:01 AM, Ken Tilton wrote: > Yes on the OpenGL.
I used that (with FTGL for nice fonts) to execute > my Cello GUI. > On 05/18/2011
10:58 AM, Alexander Repenning wrote: > Not completely sure I understand what
you need ... Control actions [in > XMLisp] are written in Lisp in a way to
make it quite simple to mix 2D > and 3D content. [...]

Content analysis details: (0.5 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
0.0 FREEMAIL_FROM Sender email is freemail
(akopa.gmane.poster[at]gmail.com)
-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low
trust
[209.85.214.179 listed in list.dnswl.org]
-0.0 SPF_PASS SPF: sender matches SPF record
1.2 MISSING_HEADERS Missing To: header
0.0 RFC_ABUSE_POST Both abuse and postmaster missing on sender domain
0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid
0.0 T_TO_NO_BRKTS_FREEMAIL T_TO_NO_BRKTS_FREEMAIL
Archived-At: <http://permalink.gmane.org/gmane.lisp.cl-pro/380>
Post by Ken Tilton
Yes on the OpenGL. I used that (with FTGL for nice fonts) to execute
my Cello GUI.
Not completely sure I understand what you need ... Control actions [in
XMLisp] are written in Lisp in a way to make it quite simple to mix 2D
and 3D content.
Well, this is a mostly a learning exercise. GUI's seem frustratingly
complex. One contributing factor is that most modern toolkits
effectively use a low level implementation language to embed a higher
level UI language. There are various additional high level tools to
simplify this process, but my eyes tend to glaze over at the amount of
glue needed to make UI programming palatable to novices like me.

When I wanted to learn about programming, I implemented programming
languages, so I am trying my hand at a toy version of the most direct,
interactive and intuitive GUI I've found: Morphic.

I need just enough graphics programming to associate images with Morphs,
and composite them onto their parents, a process that finally bottoms
out on the WorldMorph.

Matt
Matthew Swank
2011-05-19 18:01:56 UTC
Permalink
Content preview: On Mon, May 16, 2011 at 8:55 AM, Matthew Swank wrote: > I
am porting the Morphic GUI tool kit, Or more specifically the subset > that
is implemented in morphic.js: > http://www.chirp.scratchr.org/blog/?p=34.
Post by Matthew Swank
Post by Matthew Swank
I am a little overwhelmed by the options for rendering the GUI to screen.
.. > > Does anyone have guidance on the best way to approach this? [...]

Content analysis details: (-0.7 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
0.0 FREEMAIL_FROM Sender email is freemail
(akopa.gmane.poster[at]gmail.com)
-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low
trust
[209.85.214.179 listed in list.dnswl.org]
-0.0 SPF_PASS SPF: sender matches SPF record
0.0 RFC_ABUSE_POST Both abuse and postmaster missing on sender domain
0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid
0.0 T_TO_NO_BRKTS_FREEMAIL T_TO_NO_BRKTS_FREEMAIL
Archived-At: <http://permalink.gmane.org/gmane.lisp.cl-pro/385>

On Mon, May 16, 2011 at 8:55 AM, Matthew Swank
Post by Matthew Swank
I am porting the Morphic GUI tool kit, Or more specifically the subset
http://www.chirp.scratchr.org/blog/?p=34.
I am a little overwhelmed by the options for rendering the GUI to screen.
..
Post by Matthew Swank
Does anyone have guidance on the best way to approach this?
For future reference, Woolly http://nklein.com/software/woolly/
explores this issues on a small enough scale to be quite educational.

Matt
Vladimir Sedach
2011-05-19 20:33:08 UTC
Permalink
Content preview: I recommend going with Cairo. It has an interface very similar
to <canvas>, and is really convenient for 2d graphics. I've used SDL before
and am not a fan. If you want to support multiple OSes, you can save some
time by delegating cross-platform window and input handling to GTK and just
using the Cairo canvas it gives you (that's how the McCLIM GTK backend works).
[...]

Content analysis details: (-100.7 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
-100 USER_IN_WHITELIST From: address is in the user's white-list
0.0 FREEMAIL_FROM Sender email is freemail (vsedach[at]gmail.com)
-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low
trust
[209.85.216.179 listed in list.dnswl.org]
-0.0 SPF_PASS SPF: sender matches SPF record
0.0 RFC_ABUSE_POST Both abuse and postmaster missing on sender domain
0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid
Archived-At: <http://permalink.gmane.org/gmane.lisp.cl-pro/386>

I recommend going with Cairo. It has an interface very similar to
<canvas>, and is really convenient for 2d graphics. I've used SDL
before and am not a fan. If you want to support multiple OSes, you can
save some time by delegating cross-platform window and input handling
to GTK and just using the Cairo canvas it gives you (that's how the
McCLIM GTK backend works).

http://cliki.net/cl-cairo2 is the library to use, the original
cl-cairo seems to have disappeared

http://www.cliki.net/cl-gtk2 has GTK and Cairo bindings

There's other GTK bindings listed at http://www.cliki.net/GTK%20binding

Also, it appears someone has tried implementing a Morphic UI in CL
before: http://www.cliki.net/MorphiCL

Vladimir

PS - Sorry for breaking threading with this reply; I've switched off
digest mode and this shouldn't happen in the future.
a***@public.gmane.org
2011-05-20 00:26:47 UTC
Permalink
Content preview: On Thu, May 19, 2011 at 3:33 PM, Vladimir Sedach wrote: >
http://www.cliki.net/MorphiCL > Yeah, i saw that. It's kind of old and based
on Squeak. The nice thing about mophic.js is that (for now at least) it's
simpler than Squeak Morphic, but has enough functionality to be useful. [...]


Content analysis details: (-0.0 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, low
trust
[209.225.8.24 listed in list.dnswl.org]
-0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay
domain
-0.0 SPF_PASS SPF: sender matches SPF record
0.0 RFC_ABUSE_POST Both abuse and postmaster missing on sender domain
Archived-At: <http://permalink.gmane.org/gmane.lisp.cl-pro/387>
Post by Vladimir Sedach
Also, it appears someone has tried implementing a Morphic UI in CL
before: http://www.cliki.net/MorphiCL
Yeah, i saw that. It's kind of old and based on Squeak. The nice thing
about mophic.js is that (for now at least) it's simpler than Squeak
Morphic, but has enough functionality to be useful.

Matt

Loading...