<div><br></div><div>Hi Nikolay,<br></div><div><br></div><div>I am not familiar with cl-2d, therefore just a few general suggestions</div><div><br></div><div>(1) Have you tried the cl-cairo2 mailing list? At first glance this looks more like a cl-cairo than like a cells-gtk problem</div>
<div><br></div><div>(2) Try deactivating threading (you might need to recompile the whole thing to make sure everything is up to date). There is a constant in one of the central files (cells-gtk.asd ?). That might give you better debugging output</div>
<div><br></div><div>(3) Have you looked into the 2d drawing functions I included in the drawing-area widget? Of course I don't know what you are trying to do, but possibly the approach there will work for you. Currently it only supports a few basic shapes (circles, arcs, rectangles, lines, arrows), but on the plus side, there is full support for user interaction (mouse-over events, drag and drop support, etc.)</div>
<div><br></div><div>Good luck</div><div>Peter</div><br><div class="gmail_quote">On Fri, Oct 2, 2009 at 6:33 PM, <span dir="ltr"><<a href="mailto:marsijanin@gmail.com">marsijanin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Good ${current_time_of_day}<br>
<br>
I'm trying to use cl-2d plotting library (<a href="http://github.com/tpapp/cl-2d" target="_blank">http://github.com/tpapp/cl-2d</a>)<br>
with cl-cairo2 support in cells-gtk. First I tried to make an<br>
cl-2d:frame from cells-gtk:cairo-context of cells-gtk:cairo-drawing-area:<br>
<br>
<br>
CL-USER> (in-package :cgtk)<br>
#<PACKAGE "CELLS-GTK"><br>
CGTK> (defmodel test-app (gtk-app)<br>
()<br>
(:default-initargs :title "Test"<br>
:position :center<br>
:width 800 :height 600<br>
:kids (c?<br>
(the-kids<br>
(mk-hbox<br>
:kids<br>
(list<br>
(make-instance 'cairo-drawing-area :width 640 :height 480 :fm-parent *parent* :md-name :draw<br>
:expand t :fill t)<br>
(mk-button :label "test"<br>
:on-clicked (callback (w e d)<br>
;; cl-cairo2::with-gtk-context dose not setup<br>
;; width, height & pixel-based-p properties of the context<br>
;; needed by cl-2d:as-frame<br>
(with-accessors ((widget-width width)<br>
(widget-height height)<br>
(context cairo-context)) (find-widget :draw)<br>
(with-slots ((context-width cl-cairo2:width)<br>
(context-height cl-cairo2:height)<br>
(context-pixel-based-p cl-cairo2:pixel-based-p)) context<br>
(setf context-width widget-width context-height widget-height<br>
context-pixel-based-p t))<br>
(print (cl-2d::vertical-interval (cl-2d:as-frame context))))))))))))<br>
<br>
#<STANDARD-CLASS TEST-APP><br>
CGTK> (cells-gtk-init)<br>
<br>
"----------UTILSRESET----------------------------------"<br>
#()<br>
CGTK> (start-win 'test-app)<br>
<br>
"----------UTILSRESET----------------------------------"<br>
0> registering handlers for #.(sb-sys:int-sap #x080d2898)<br>
0> c-link> query link :draw cells-store2 nil<br>
#<CL-2D:INTERVAL left=480 right=0> ;; <--- vertical-interval of the cl-2d:frame, created by calling cl-2d:frame<br>
0> c-link> kick link :draw cells-store2 #<cells::c-link {ba79009}><br>
0> not-to-be cairo-drawing area erasing everything drawTEST-APP6<br>
<br>
And then I tried to call cl-2d:plot-simple on with cl-2d:frame and<br>
got strange error about unknown CAIRO_STATUS_T value:<br>
<br>
<br>
CGTK> (defmodel test-app (gtk-app)<br>
()<br>
(:default-initargs :title "Test"<br>
:position :center<br>
:width 800 :height 600<br>
:kids (c?<br>
(the-kids<br>
(mk-hbox<br>
:kids<br>
(list<br>
(make-instance 'cairo-drawing-area :width 640 :height 480 :fm-parent *parent* :md-name :draw<br>
:expand t :fill t)<br>
(mk-button :label "test"<br>
:on-clicked (callback (w e d)<br>
;; cl-cairo2::with-gtk-context dose not setup<br>
;; width, height & pixel-based-p properties of the context<br>
;; needed by cl-2d:as-frame<br>
(with-accessors ((widget-width width)<br>
(widget-height height)<br>
(context cairo-context)) (find-widget :draw)<br>
(with-slots ((context-width cl-cairo2:width)<br>
(context-height cl-cairo2:height)<br>
(context-pixel-based-p cl-cairo2:pixel-based-p)) context<br>
(setf context-width widget-width context-height widget-height<br>
context-pixel-based-p t))<br>
(cl-2d:plot-simple (cl-2d:as-frame context)<br>
(cl-2d:make-interval 1 2)<br>
(cl-2d:make-interval 3 4)<br>
:x-title "x"<br>
:y-title "y"))))))))))<br>
<br>
<br>
STYLE-WARNING:<br>
redefining SHARED-INITIALIZE :AFTER (#<STANDARD-CLASS TEST-APP><br>
#<BUILT-IN-CLASS T>) in DEFMETHOD<br>
#<STANDARD-CLASS TEST-APP><br>
CGTK> (start-win 'test-app)<br>
1> c-link> kick link :draw cells-store2 #<cells::c-link {d0a3801}><br>
0> registering handlers for #.(sb-sys:int-sap #x0810f8c0)<br>
0> c-link> query link :draw cells-store2 #<cells::c-link {d0a3801}><br>
0> show error message<br>
0> md-awaken :after<br>
1> processing dlg<br>
.2> running dialog<br>
1> showed dialog -9 :no<br>
1> destroying self (not-to-be)<br>
0> >>>> ERROR REPORTING --> #<simple-error {bbfcc79}><br>
<br>
And here is debugger output:<br>
<br>
<br>
-1208503376 is not defined as a value for enum type #<CFFI::FOREIGN-ENUM CL-CAIRO2::CAIRO_STATUS_T>.<br>
[Condition of type SIMPLE-ERROR]<br>
<br>
Restarts:<br>
0: [TERMINATE-THREAD] Terminate this thread (#<THREAD "gtk-main-thread" RUNNING {B0D1409}>)<br>
<br>
Backtrace:<br>
0: ((LAMBDA (CELLS-GTK::C2)) #<SIMPLE-ERROR {BBFCC79}>)<br>
Locals:<br>
CELLS-GTK::C2 = #<SIMPLE-ERROR {BBFCC79}><br>
1: (CELLS-GTK::MAIN-LOOP)<br>
Locals:<br>
SB-KERNEL:*HANDLER-CLUSTERS* = :<NOT-AVAILABLE><br>
SB-KERNEL:*RESTART-CLUSTERS* = :<NOT-AVAILABLE><br>
#:COUNT[MAIN-LOOP]594 = :<NOT-AVAILABLE><br>
#:G600 = (#<SIMPLE-ERROR {BBFCC79}>)<br>
#:NEXT[MAIN-LOOP]592 = :<NOT-AVAILABLE><br>
#:START[MAIN-LOOP]593 = :<NOT-AVAILABLE><br>
2: ((FLET CELLS-GTK::GTK-THREAD))<br>
Locals:<br>
CELLS-GTK::GTK-MAIN-THREAD = #<SB-THREAD:THREAD "gtk-main-thread" RUNNING {B0D1409}><br>
3: ((LAMBDA ()))<br>
Locals:<br>
CELLS-GTK::GTK-MAIN-THREAD = #<SB-THREAD:THREAD "gtk-main-thread" RUNNING {B0D1409}><br>
CELLS-GTK::SO = #<SWANK-BACKEND::SLIME-OUTPUT-STREAM {B71B6A9}><br>
4: ((LAMBDA ()))<br>
[No Locals]<br>
5: ((FLET #:WITHOUT-INTERRUPTS-BODY-[BLOCK375]380))<br>
[No Locals]<br>
6: ((FLET SB-THREAD::WITH-MUTEX-THUNK))<br>
[No Locals]<br>
Catch-tags:<br>
SB-IMPL::%END-OF-THE-WORLD<br>
SB-INT:TOPLEVEL-CATCHER<br>
7: ((FLET #:WITHOUT-INTERRUPTS-BODY-[CALL-WITH-MUTEX]267))<br>
[No Locals]<br>
8: (SB-THREAD::CALL-WITH-MUTEX ..)<br>
Locals:<br>
SB-DEBUG::ARG-0 = #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK) {AF142205}><br>
SB-DEBUG::ARG-1 = #S(SB-THREAD:MUTEX ..)<br>
SB-DEBUG::ARG-2 = #<SB-THREAD:THREAD "gtk-main-thread" RUNNING {B0D1409}><br>
SB-DEBUG::ARG-3 = T<br>
9: ((LAMBDA ()))<br>
[No Locals]<br>
10: ("foreign function: #x8063A3B")<br>
11: ("foreign function: #x80523BD")<br>
12: ("foreign function: #x805BC20")<br>
13: ("foreign function: #xB7FA965C")<br>
<br>
<br>
Can anyone please help to solve this problem?<br>
<br>
Best, Nikolay V. Razbegaev.<br>
<br>
_______________________________________________<br>
cells-gtk-devel site list<br>
<a href="mailto:cells-gtk-devel@common-lisp.net">cells-gtk-devel@common-lisp.net</a><br>
<a href="http://common-lisp.net/mailman/listinfo/cells-gtk-devel" target="_blank">http://common-lisp.net/mailman/listinfo/cells-gtk-devel</a><br>
</blockquote></div><br>