Lisp HUG Maillist Archive

display-dialog: draw-image on output-pane

Hello!

I'm new to Lisp and Lispworks and I have the task to edit a
display-dialog. I should add a output-pane with an image on it to a
display-dialog. The problem is that all my attempts to achieve that
ends up with the "Error No color-user found for #<CAPI:OUTPUT-PANE
222833FF>".

So I think I understand why this error is happen. So I have to put the
image on the output pane after the window is created. But how is that
possible with an display-dialog?

I tried combinations with these code pieces:

(capi:display-dialog
 (capi:make-container
  (setq image-pane
        (make-instance 'capi:output-pane))))

(capi:apply-in-pane-process image-pane 'gp:draw-image image-pane
(gp:load-image image-pane image-path) 0 0)

Is there someone with a good advice what I'm doing wrong?

Thank you,
Phil

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: display-dialog: draw-image on output-pane

Hi Phil,

Just guessing here...  Have you tried creating a specific CAPI interface for your dialog and define a :CREATE-CALLBACK function?


Best,
Cam


On 12 mai 2013, at 12:43, Philipp Bach <philipp.wilfried.bach@gmail.com> wrote:


Hello!

I'm new to Lisp and Lispworks and I have the task to edit a
display-dialog. I should add a output-pane with an image on it to a
display-dialog. The problem is that all my attempts to achieve that
ends up with the "Error No color-user found for #<CAPI:OUTPUT-PANE
222833FF>".

So I think I understand why this error is happen. So I have to put the
image on the output pane after the window is created. But how is that
possible with an display-dialog?

I tried combinations with these code pieces:

(capi:display-dialog
(capi:make-container
 (setq image-pane
       (make-instance 'capi:output-pane))))

(capi:apply-in-pane-process image-pane 'gp:draw-image image-pane
(gp:load-image image-pane image-path) 0 0)

Is there someone with a good advice what I'm doing wrong?

Thank you,
Phil

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: display-dialog: draw-image on output-pane

Read the capi reference manual pages for "output-pane" and "interface".

I think you want to create an interface which has one pane (the 
output-pane).

The output-pane should be declared with a :display-callback function 
(which draws the image into itself).  You need to supply that function 
because in a windowing system, windows can be dragged over each other - 
the O/S needs to know how to restore the window once it has been 
re-exposed.  The O/S calls the :display-callback to repaint the window...

You'll also need to read the manual page for "callback".  This describes 
the options you can set for the various function signatures when a 
callback function is called.  For example, if you declare a callback 
style of :interface, then your callback function will be called with the 
interface as the sole argument.  You will have to "reach" into the 
interface to grab the output-pane.  In this case, you need to declare 
the output-pane with an :accessor function (that's "standard" CL / CLOS, 
so look in whatever book you're reading), when you declare the 
output-pane field within the interface.

I forget which is which, but :data and :element callback styles can give 
the actual output-pane...

Remember:

1.  The CAPI classes are OO classes.  Functionality you may want, may be 
supplied in superclasses (so follow the hyperlinks in the docs).

2.  The run-time structure of an interface is a hierarchical tree. (You 
can use the interface-builder tool to help you build a first cut, but 
your example is quite simple).  You can reach up and down using various 
accessor functions described in the docs.

ask again, if still unclear

pt

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: display-dialog: draw-image on output-pane

Hello everyone!

I've solved my problem! Thank you a lot for your help.

best regards,
Phil

On Mon, May 13, 2013 at 7:02 PM, Paul Tarvydas <paultarvydas@gmail.com> wrote:
> Read the capi reference manual pages for "output-pane" and "interface".
>
> I think you want to create an interface which has one pane (the
> output-pane).
>
> The output-pane should be declared with a :display-callback function (which
> draws the image into itself).  You need to supply that function because in a
> windowing system, windows can be dragged over each other - the O/S needs to
> know how to restore the window once it has been re-exposed.  The O/S calls
> the :display-callback to repaint the window...
>
> You'll also need to read the manual page for "callback".  This describes the
> options you can set for the various function signatures when a callback
> function is called.  For example, if you declare a callback style of
> :interface, then your callback function will be called with the interface as
> the sole argument.  You will have to "reach" into the interface to grab the
> output-pane.  In this case, you need to declare the output-pane with an
> :accessor function (that's "standard" CL / CLOS, so look in whatever book
> you're reading), when you declare the output-pane field within the
> interface.
>
> I forget which is which, but :data and :element callback styles can give the
> actual output-pane...
>
> Remember:
>
> 1.  The CAPI classes are OO classes.  Functionality you may want, may be
> supplied in superclasses (so follow the hyperlinks in the docs).
>
> 2.  The run-time structure of an interface is a hierarchical tree. (You can
> use the interface-builder tool to help you build a first cut, but your
> example is quite simple).  You can reach up and down using various accessor
> functions described in the docs.
>
> ask again, if still unclear
>
> pt
>

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Updated at: 2020-12-10 08:35 UTC