From tkpapp at gmail.com Fri May 7 12:16:35 2010 From: tkpapp at gmail.com (Tamas Papp) Date: Fri, 7 May 2010 14:16:35 +0200 Subject: [cl-gtk2-devel] how to send messages to a window? In-Reply-To: <201004212205.04390.Kalyanov.Dmitry@gmail.com> References: <20100421085047.GA14132@daedalus> <201004212205.04390.Kalyanov.Dmitry@gmail.com> Message-ID: <20100507121635.GA18004@daedalus> On Wed, 21 Apr 2010, Kalyanov Dmitry wrote: > On Wednesday 21 April 2010 12:50:47, Tamas Papp wrote: > > Hi, > > > > How can I send an "expose" message to a window from _outside_ the main > > loop? > > Basically, you can't. You should call queue-widget-draw function inside main > loop by means of within-main-loop-and-wait (this macro will wait until your > code actually completes in the main loop and returns its return value) or > within-main-loop (this macro will not wait until your code finishes or even > starts executing and returns immediately). Call to this function marks the > widget area as invalidated and at the next occasion (at the next iteration of > gtk+ event loop) Gtk+ will repaint the widget. > > > But when I call sync, sometimes I get "unmapped memory area" errors > > for GObject callbacks. The whole code is available here: > > http://github.com/tpapp/cl-cairo2/tree/master/src/gtk2/ > > Could you provide more information, a stack trace? Where does this message > comes from - is it a Lisp exception or cairo error message or gtk error > message? Does it occur randomly or deterministically? > > The code looks fine except for several issues: > 1) in create-gtk2-xlib-context you can use within-main-loop-and-wait instead > of within-main-loop > 2) (incf (sync-counter-object)) is not atomic - you should use a real lock > (bordeaux-threads provides portable locking API) I am still chasing this bug. I did the changes you suggested, and it worked. Once. Then I made other changes, and they seemed to fix the problem - but only once. So I figured that this must have something to do with compile-time and runtime: my guess is that something (a memory address, etc) is determined at compile time, and next time ASDF just loads the file without recompiling and some assumption proves to be incorrect. This is confirmed by the following: if I delete the *.fasl files -- even if only in cl-cairo2's src/gtk2/ subdirectory -- everything works just fine. To reproduce bug, one only has to do a restart-inferior-lisp and reload the libraries. I get these warnings when compiling src/gtk2/gtk2.lisp, I don't know if they are relevant: WARNING: GType GdkWindow is not known to GObject WARNING: GType GdkWindow is not known to GObject WARNING: Declared GType name 'GdkWindow' for class 'GDK-WINDOW' is invalid (g_type_name returned 0) WARNING: GType GtkFileChooserEmbed is not known to GObject WARNING: GType GtkFileChooserEmbed is not known to GObject WARNING: Declared GType name 'GtkFileChooserEmbed' for class 'FILE-CHOOSER-EMBED' is invalid (g_type_name returned 0) WARNING: GType LispArrayListStore is not known to GObject WARNING: GType LispArrayListStore is not known to GObject WARNING: Declared GType name 'LispArrayListStore' for class 'ARRAY-LIST-STORE' is invalid (g_type_name returned 0) WARNING: GType LispTreeStore is not known to GObject WARNING: GType LispTreeStore is not known to GObject WARNING: Declared GType name 'LispTreeStore' for class 'TREE-LISP-STORE' is invalid (g_type_name returned 0) As before, the source is at http://github.com/tpapp/cl-cairo2/tree/master/src/gtk2/. Any help would be appreciated. Best, Tamas From jmhdassen at yahoo.com Tue May 11 13:06:21 2010 From: jmhdassen at yahoo.com (Jos Dassen) Date: Tue, 11 May 2010 06:06:21 -0700 (PDT) Subject: [cl-gtk2-devel] Various issues with using CL-GTK2 as Lisp UI Message-ID: <118298.27472.qm@web55007.mail.re4.yahoo.com> Hi, I want to use Common Lisp for an application I want to build and I need a good GUI. I looked at CLIM, CL-GTK2 and Cells-GTK. All of them have issues and for the moment I have decided to try to continue with CL-GTK2. But right now I am stuck. I need a menubar with menus and a graphics pane, but I have not found a way yet to get them both. 1. When I make the GUI with Glade-3 and use cl-gtk2 builder, I get the basic GUI right. But I have not managed to create a Cairo surface which would allow me to use Cairo for my graphics. My GUI has a GtkDrawingArea widget, but using 'builder-get-object' I do not know how convert this to a Cairo surface. I have seen the cairo.demo.lisp, but this does not give me a clue on how to proceed. Anybody can help me with this ?? 2. When I try to make the GUI without Builder I get stuck with the menus. There is no example available on how to build a menubar with menus and menu items. The cl-gtk2 menu commands by themselves do not give me enough of a clue. Ideally I would like to use UI-Manager, but here again the example is for toolbars and not for menubars. Can anyone provide me with an example of building a menubar with CL-GTK2 ?? Cheers, Jos Dassen -------------- next part -------------- An HTML attachment was scrubbed... URL: From kalyanov.dmitry at gmail.com Tue May 11 18:05:31 2010 From: kalyanov.dmitry at gmail.com (Kalyanov Dmitry) Date: Tue, 11 May 2010 22:05:31 +0400 Subject: [cl-gtk2-devel] how to send messages to a window? In-Reply-To: <20100422151321.GA1755@daedalus> References: <20100421085047.GA14132@daedalus> <201004212205.04390.Kalyanov.Dmitry@gmail.com> <20100422151321.GA1755@daedalus> Message-ID: <201005112205.37100.Kalyanov.Dmitry@gmail.com> On Thursday 22 April 2010 19:13:21, Tamas Papp wrote: > On Wed, 21 Apr 2010, Kalyanov Dmitry wrote: > > On Wednesday 21 April 2010 12:50:47, Tamas Papp wrote: > > > Hi, > > > > > > How can I send an "expose" message to a window from _outside_ the main > > > loop? > > > > Basically, you can't. You should call queue-widget-draw function inside > > main loop by means of within-main-loop-and-wait (this macro will wait > > until your code actually completes in the main loop and returns its > > return value) or within-main-loop (this macro will not wait until your > > code finishes or even starts executing and returns immediately). Call to > > this function marks the widget area as invalidated and at the next > > occasion (at the next iteration of gtk+ event loop) Gtk+ will repaint > > the widget. > > Thanks, that's what I am doing now. > > > > But when I call sync, sometimes I get "unmapped memory area" errors > > > for GObject callbacks. The whole code is available here: > > > http://github.com/tpapp/cl-cairo2/tree/master/src/gtk2/ > > > > Could you provide more information, a stack trace? Where does this > > message comes from - is it a Lisp exception or cairo error message or > > gtk error message? Does it occur randomly or deterministically? > > This is a Lisp exception, occurring randomly. Backtrace is here: > I'm sorry for the long delay - I'll try to look into the issue soon. ---- ???????? ??????? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From kalyanov.dmitry at gmail.com Tue May 11 18:33:05 2010 From: kalyanov.dmitry at gmail.com (Kalyanov Dmitry) Date: Tue, 11 May 2010 22:33:05 +0400 Subject: [cl-gtk2-devel] Various issues with using CL-GTK2 as Lisp UI In-Reply-To: <118298.27472.qm@web55007.mail.re4.yahoo.com> References: <118298.27472.qm@web55007.mail.re4.yahoo.com> Message-ID: <201005112233.15950.Kalyanov.Dmitry@gmail.com> On Tuesday 11 May 2010 17:06:21, Jos Dassen wrote: > Hi, > > 1. When I make the GUI with Glade-3 and use cl-gtk2 builder, I get the > basic GUI right. But I have not managed to create a Cairo surface which > would allow me to use Cairo for my graphics. My GUI has a GtkDrawingArea > widget, but using 'builder-get-object' I do not know how convert this to a > Cairo surface. I have seen the cairo.demo.lisp, but this does not give me > a clue on how to proceed. Anybody can help me with this ?? By using builder-get-object you can get the GtkDrawingArea widget. You should subscribe to its 'expose' signal; in the signal handler, you create the cairo context for GtkDrawingArea's GdkWindow (macro CL-GTK2-CAIRO:WITH-GDK-CONTEXT does this), then bind it to cl-cairo2:*context* (macro CL-CAIRO2:WITH-CONTEXT does this) and use functions from cl-cairo2 to draw on it. ---- ???????? ??????? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From akopa at charter.net Sun May 16 04:25:49 2010 From: akopa at charter.net (Matthew D Swank) Date: Sat, 15 May 2010 23:25:49 -0500 Subject: [cl-gtk2-devel] patch to begin support of power arch. Message-ID: <1273983949.17275.2.camel@blodwyn> -------------- next part -------------- A non-text attachment was scrubbed... Name: ppc.patch Type: text/x-patch Size: 628 bytes Desc: not available URL: From kalyanov.dmitry at gmail.com Sun May 16 09:19:14 2010 From: kalyanov.dmitry at gmail.com (Kalyanov Dmitry) Date: Sun, 16 May 2010 13:19:14 +0400 Subject: [cl-gtk2-devel] patch to begin support of power arch. In-Reply-To: <1273983949.17275.2.camel@blodwyn> References: <1273983949.17275.2.camel@blodwyn> Message-ID: <201005161319.17810.Kalyanov.Dmitry@gmail.com> On Sunday 16 May 2010 08:25:49, Matthew D Swank wrote: > ppc.patch Thanks, I'll apply it. ---- ???????? ??????? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: