set | 1 Feb 15:28 2009

Allegro 8.0 GUI multithreading

I'm trying to produce a multithreaded GUI in Allegro 8.0.
However, once i try start-win, everything freezes. I traaced it back, and it
appears that it stars freezing in the main-loop function, specifically when
gtk-main is called. In addition, i tried to use the lispworks specific code in
the main-loop function marked with #+lispworks, and it still freezes.

Notice that I am not using the libcellsgtk dll which is necessary for some
aspects. Is this the problem?

Any help would be appreciated!
Thxs!

---- Msg sent via WebMail

Peter Hildebrandt | 1 Feb 16:29 2009
Picon

Re: Allegro 8.0 GUI multithreading

Hi,

Unfortunately I only have SBCL over here (linux), so here's a few
comments off the top of my head:

To understand your problem better, which platform are you on, linux or windows?

Have you tried using libcellsgtk?  When you're on linux, compiling it
is pretty straight forward, and for windows there are downloadable
versions.  Someone here might be able to provide a compiled version if
you give us specifics on your set up.

Have you activated cells-gtk's tracing?  Have a look at gtk-app.lisp
(I believe -- currently I am on an office machine with Win XP and no
development tools), there's a feature like "debug" or something which
you can use to activate tracing.  That might help, too.

Furthermore, how's bordeaux-threads with allegro on your platform?  Is
that all cleared (check the bordeaux-threads homepage).

If you send a trace (preferably the cells-gtk debug output) and some
more info on your environment, I might be able to give better advice.

Thanks,

Peter

On Sun, Feb 1, 2009 at 3:28 PM,  <set <at> tewebs.com> wrote:
> I'm trying to produce a multithreaded GUI in Allegro 8.0.
> However, once i try start-win, everything freezes. I traaced it back, and it
(Continue reading)

set | 3 Feb 02:58 2009

Re: Allegro 8.0 GUI multithreading

Hi!
First, I'm actually using Allegro 8.1, not 8.0, under windows xp. I'm using
cells-gtk3.
For a summary, i believe the code stalls in the main-loop function in the file
gtk-app when
(gtk-main) is called. I believe gtk-main directly calls a foreign function.

For reference, my test code is as follows:
(defpackage :test (:use :cl  :cells :cells-gtk))
(in-package :test)

(defvar *width* 300)
(defvar *height* 300)

(defmodel click-button (vbox)
  ()
  (:default-initargs

    :kids (c? (the-kids
               (mk-button 
                :width *width*
                :height *height*
                :on-clicked
                (callback (widget event data)))))))

(defmodel stay-awake-gui (gtk-app)
  ()
  (:default-initargs
      :width *width*
    :height *height*
(Continue reading)

Peter Hildebrandt | 3 Feb 10:39 2009
Picon

Re: Allegro 8.0 GUI multithreading

Hi Seth,

thanks a lot for the comprehensive description.  I am quite busy right
now, but I will look into it.  This will entail me installing Allegro
on my win xp office machine, and as I am quite busy right now, it
might take a few days (possibly until the weekend) until I get round
to it.  Sorry about that.

I have a hunch that it is connected to the g_thread_supported func, so
my first shot would be to recompile the dll on windows with the new
functions (since I do not have windows on my development box, I never
did that).  I am not a really a windows person, so I don't even know
which tools to use, but we'll see ...

I also remember reading that there was some issue with gdk/gtk and
threading on windows in general, and that there was something special
to take care of -- but since I was solely on linux and writing a
thesis, I had other things on my mind.

I'll get back to you in a few days.

Cheers,

Peter

Btw, does it work w/o threading?

On Tue, Feb 3, 2009 at 2:58 AM,  <set <at> tewebs.com> wrote:
> Hi!
> First, I'm actually using Allegro 8.1, not 8.0, under windows xp. I'm using
(Continue reading)

Kenneth Tilton | 3 Feb 16:20 2009
Picon

Re: Allegro 8.0 GUI multithreading


Peter Hildebrandt wrote:
> Hi Seth,
> 
> thanks a lot for the comprehensive description.  I am quite busy right
> now, but I will look into it.  This will entail me installing Allegro
> on my win xp office machine, and as I am quite busy right now, it
> might take a few days (possibly until the weekend) until I get round
> to it.  Sorry about that.
> 
> I have a hunch that it is connected to the g_thread_supported func, so
> my first shot would be to recompile the dll on windows with the new
> functions (since I do not have windows on my development box, I never
> did that).  I am not a really a windows person, so I don't even know
> which tools to use, but we'll see ...
> 
> I also remember reading that there was some issue with gdk/gtk and
> threading on windows in general, and that there was something special
> to take care of -- but since I was solely on linux and writing a
> thesis, I had other things on my mind.
> 
> I'll get back to you in a few days.

I can confirm that I could only run a cells-gtk test once under 
ACL/win32 and then I had to kill the Lisp.

As for win32 C/C++ tools:

- The whole cygwin stack for a unix-y experience
- Microsoft VC++ express or whatever they call it now
(Continue reading)

Peter Hildebrandt | 4 Feb 19:43 2009
Picon

Re: Allegro 8.0 GUI multithreading

Hi Seth,

given the low volume and the small number of subscribers here, I think
you can feel free to hit "reply all" and thus cc the list on each of
your posts.  The cells-gtk community is pretty small (optimistic
guess:  you need two hands to count 'em all).

I might say otherwise if there was a bigger audience and 50+ mails a
day, but this way I don't think anyone minds.

If anyone here is seriously upset about deleting an occasional "thank
you" mail, please let me know, before I go on teaching wrong stuff to
people :-)

As to the problem at hand:  I'll install the Bloodshed DevCpp (see
Kenny's link) and some lisp on my office laptop on the weekend and see
how far I get.  I'll keep you posted.

Cheers,
Peter

On Wed, Feb 4, 2009 at 1:55 AM,  <set <at> tewebs.com> wrote:
> Thanks! I'll look forward to hearing from you.
> Yes, it does work if i don't try to use the multithreaded start-win.
>
> Just a quick question. Do I specifically send an email to the person who replied
> to me or
> do I somehow send the email to the cells-gtk-devel? I'm new to this.
>
> Thanks,
(Continue reading)

Qu Yang | 6 Feb 22:17 2009
Picon

Compilation error in cairo-drawing-area.lisp

Hi all,

This is the error I have after (require 'cells-gtk)

or:
;   READ failure in COMPILE-FILE:
;     SB-INT:SIMPLE-READER-PACKAGE-ERROR at 22404 (line 576, column 69) on #<SB-SYS:FD-STREAM for "file /home/yang/.sbcl/site/cells-gtk3/cells-gtk/cairo-drawing-area.lisp" {BD5DAB1}>:
;       Symbol "FONT-SLANT-ITALIC" not found in the CL-CAIRO2 package.
; compilation aborted after 0:00:03

I have installed cl-cairo2.

Can anyone please help to solve this problem?

Regards,
Yang

<div><p>Hi all,<br><br>This is the error I have after (require 'cells-gtk)<br><br>or:<br>;&nbsp;&nbsp; READ failure in COMPILE-FILE:<br>;&nbsp;&nbsp;&nbsp;&nbsp; SB-INT:SIMPLE-READER-PACKAGE-ERROR at 22404 (line 576, column 69) on #&lt;SB-SYS:FD-STREAM for "file /home/yang/.sbcl/site/cells-gtk3/cells-gtk/cairo-drawing-area.lisp" {BD5DAB1}&gt;:<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Symbol "FONT-SLANT-ITALIC" not found in the CL-CAIRO2 package.<br>; compilation aborted after 0:00:03<br><br>I have installed cl-cairo2. <br><br>Can anyone please help to solve this problem?<br><br>Regards,<br>
Yang<br></p></div>
Ramarren | 7 Feb 20:24 2009
Picon

Re: Compilation error in cairo-drawing-area.lisp

> Can anyone please help to solve this problem?

Hm, I never used mailing lists before, so I hope this message doesn't
get lost somewhere... anyway, although I do not need a Lisp-driven GUI
at the moment, I try too keep cells-gtk3 in a state in which at least
test-gtk runs in case I need one. I have published my patched versions
of both cells and cells-gtk3 to github:
http://github.com/Ramarren/cells/tree/master
http://github.com/Ramarren/cells-gtk3/commits/master

Hopefully, I haven't broken anything.

Peter Hildebrandt | 9 Feb 16:54 2009
Picon

Re: Compilation error in cairo-drawing-area.lisp

Thanks for sharing this.  I will check it out and merge it with the
cvs on common-lisp.net

Background for these problems:  cl-cairo2 and cffi have been updated
since I put out the last release of cells-gtk3, and unfortunately
those updates were not quite backwards compatible.

Peter
On Sat, Feb 7, 2009 at 8:24 PM, Ramarren <ramarren <at> gmail.com> wrote:
>> Can anyone please help to solve this problem?
>
> Hm, I never used mailing lists before, so I hope this message doesn't
> get lost somewhere... anyway, although I do not need a Lisp-driven GUI
> at the moment, I try too keep cells-gtk3 in a state in which at least
> test-gtk runs in case I need one. I have published my patched versions
> of both cells and cells-gtk3 to github:
> http://github.com/Ramarren/cells/tree/master
> http://github.com/Ramarren/cells-gtk3/commits/master
>
> Hopefully, I haven't broken anything.
>
> _______________________________________________
> cells-gtk-devel site list
> cells-gtk-devel <at> common-lisp.net
> http://common-lisp.net/mailman/listinfo/cells-gtk-devel
>

Johan Ur Riise | 10 Feb 23:53 2009
Picon

Re: Compilation error in cairo-drawing-area.lisp

On Sat, Feb 07, 2009 at 07:17:20AM +1000, Qu Yang wrote:
> Hi all,
> 
> This is the error I have after (require 'cells-gtk)
> 
> or:
> ;   READ failure in COMPILE-FILE:
> ;     SB-INT:SIMPLE-READER-PACKAGE-ERROR at 22404 (line 576, column 69) on
> #<SB-SYS:FD-STREAM for "file
> /home/yang/.sbcl/site/cells-gtk3/cells-gtk/cairo-drawing-area.lisp"
> {BD5DAB1}>:
> ;       Symbol "FONT-SLANT-ITALIC" not found in the CL-CAIRO2 package.
> ; compilation aborted after 0:00:03
> 
> I have installed cl-cairo2.
> 
> Can anyone please help to solve this problem?
> 
> Regards,
> Yang

> _______________________________________________
> cells-gtk-devel site list
> cells-gtk-devel <at> common-lisp.net
> http://common-lisp.net/mailman/listinfo/cells-gtk-devel

If you have not got round to cloning the git repository, here is what 
you can change in the mean time:

johan <at> perle:~/prg/cells-gtk/cells-gtk$ diff -u cairo-drawing-area.lisp.orig cairo-drawing-area.lisp
--- cairo-drawing-area.lisp.orig        2008-06-03 18:33:44.000000000 +0200
+++ cairo-drawing-area.lisp     2009-01-17 21:49:41.000000000 +0100
 <at>  <at>  -573,8 +573,8  <at>  <at> 
 (defdraw text-label (p text font-face font-size italic bold alignment vertical-alignment rgb alpha)
   (cl-cairo2:set-font-size font-size context)
   (cl-cairo2:select-font-face font-face
-                              (if italic 'cl-cairo2:font-slant-italic 'cl-cairo2:font-slant-normal)
-                              (if bold 'cl-cairo2:font-weight-bold 'cl-cairo2:font-weight-normal)
+                              (if italic :italic :normal)
+                              (if bold :bold :normal)
                               context)
   (multiple-value-bind (x-bearing y-bearing text-width text-height)
       (cl-cairo2:text-extents text context)
johan <at> perle:~/prg/cells-gtk/cells-gtk$ 

--

-- 
Hilsen
Johan Ur Riise


Gmane