Lisp HUG Maillist Archive

capi:print-rich-text-pane trouble

In LWW6, XPSP2, When I try to print a rich text pane, I get the error:

The slot CAPI::PENDING-UPDATE-OPS is missing from
#<TEST-RT-INTERFACE "Print test" 26F5DD87> (of class
#<CAPI::CAPI-CLASS TEST-RT-INTERFACE 268B26F3>), when reading
the value.

I select "Print" from the file menu and click the print button in this 
pane using this print function.

(capi:define-interface test-rt-interface ()
    ()
    (:panes
     (display-window
      capi:rich-text-pane
      :accessor display-window
      :text "Test text"))
    (:menus
     (file-menu
      "File"
       (("Print"
        :callback-type :interface
        :callback 'print-pane))))
     (:layouts
      (main-layout
       capi:column-layout
       '(display-window)))
     (:menu-bar file-menu)
     (:default-initargs
      :layout 'main-layout
      :title "Print test"
      :best-height 100
      :best-width 100))

(defun print-pane (pane)
    (capi:print-rich-text-pane pane))

 > (capi:display (make-instance 'test-rt-interface))

Mitch Berkson


Re: capi:print-rich-text-pane trouble

On Wed, Nov 3, 2010 at 9:50 PM, Mitch Berkson <mitch@bermita.com> wrote:
>      (("Print"
>       :callback-type :interface
>       :callback 'print-pane))))
…
> (defun print-pane (pane)
>   (capi:print-rich-text-pane pane))

According to the docs, capi:print-rich-text-pane "Prints the contents
of a rich-text-pane, on Microsoft Windows," so I can't test and
confirm this, but shouldn't print-pane be called with the actual
rich-text-pane and not the interface?  E.g., the :menus could be
something like:

(:menus
   (file-menu
    "File"
     (("Print"
      :callback-type :interface
      :callback #'(lambda (i)
                    (print-pane display-window))))))

Does this fix the problem?

//JT



-- 
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/


Re: capi:print-rich-text-pane trouble

  You're right, thanks. That was a mistaken simplification I made for 
the example. After including your suggestion, I get the different error:

CAPI-LIBRARY:REPRESENTATION-PRINT-RICH-TEXT-PANE
2137A1C2> is called with unpaired keyword in (#<CAPI::PRINTER "HP
LaserJet 1200 Series PCL"  27131507> :JOBNAME NIL :SELECTION
NIL).

The define-interface with the change:

(capi:define-interface test-rt-interface ()
    ()
    (:panes
     (display-window
      capi:rich-text-pane
      :text "Test text"))
    (:menus
     (file-menu
      "File"
       (("Print"
        :callback-type :interface
        :callback #'(lambda (i) (print-pane display-window))))))
     (:layouts
      (main-layout
       capi:column-layout
       '(display-window)))
     (:menu-bar file-menu)
     (:default-initargs
      :layout 'main-layout
      :title "Print test"
      :best-height 100
      :best-width 100))

Mitch

On 11/3/2010 11:09 PM, Joshua TAYLOR wrote:
> On Wed, Nov 3, 2010 at 9:50 PM, Mitch Berkson<mitch@bermita.com>  wrote:
>>       (("Print"
>>        :callback-type :interface
>>        :callback 'print-pane))))
> …
>> (defun print-pane (pane)
>>    (capi:print-rich-text-pane pane))
> According to the docs, capi:print-rich-text-pane "Prints the contents
> of a rich-text-pane, on Microsoft Windows," so I can't test and
> confirm this, but shouldn't print-pane be called with the actual
> rich-text-pane and not the interface?  E.g., the :menus could be
> something like:
>
> (:menus
>     (file-menu
>      "File"
>       (("Print"
>        :callback-type :interface
>        :callback #'(lambda (i)
>                      (print-pane display-window))))))
>
> Does this fix the problem?
>
> //JT
>
>
>


Re: capi:print-rich-text-pane trouble

  On 11/4/2010 10:58 AM, Martin Simmons wrote:
>>>>>> On Thu, 4 Nov 2010 10:19:10 -0400, Paul Tarvydas said:
>> There are still some typos in the code.  After fixing them, and explicitly
>> setting every keyword argument, I get the same error message that you get.
>>
>> Unless we're both mis-reading the documentation, this should be reported
>> this as a bug.
> No need -- it is a bug and we will fix it.

Might there be a workaround? I'm pretty sure this worked in LW5.

Mitch Berkson


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