From: Sungwoo, Lim
Subject: [Q] Automatic view update in MCL
Date: 
Message-ID: <130320011206182186%sungwoo@cad.strath.ac.uk>
Hello,

Fianlly I am back from a miserable writing papers. =)

How can I automatically update a view in a drawing window in MCL?
With the below codes, the contents of drawing is erased when the window
is shaded or resized.

;--------------------------------------------------------------
(require 'quickdraw)
(defclass simple-drawing-item (dialog-item) ())
(defmethod dialog-item-action ((view simple-drawing-item))
   ; drawing a free line function  
) 

(defparameter *w1* 
  (make-instance 'window
    :window-title "SketchPad"
    :view-nick-name 'sketchpad
    :view-size ·@(600 400)
    :color-p t
    :view-subviews (list
                    (make-instance 'simple-drawing-item
                      :view-size ·@(600 400)))))
;---------------------------------------------------------------

Thanks for your help.

Sungwoo

From: Glen Foy
Subject: Re: [Q] Automatic view update in MCL
Date: 
Message-ID: <B6D38F80.11D1%onion7@bellsouth.net>
in article ··························@cad.strath.ac.uk, Sungwoo, Lim at
·······@cad.strath.ac.uk wrote on 3/13/01 7:06 AM:

> Hello,
> 
> Fianlly I am back from a miserable writing papers. =)
> 
> How can I automatically update a view in a drawing window in MCL?
> With the below codes, the contents of drawing is erased when the window
> is shaded or resized.
> 
> ;--------------------------------------------------------------
> (require 'quickdraw)
> (defclass simple-drawing-item (dialog-item) ())
> (defmethod dialog-item-action ((view simple-drawing-item))
> ; drawing a free line function
> ) 
> 
> (defparameter *w1*
> (make-instance 'window
> :window-title "SketchPad"
> :view-nick-name 'sketchpad
> :view-size ·@(600 400)
> :color-p t
> :view-subviews (list
> (make-instance 'simple-drawing-item
> :view-size ·@(600 400)))))
> ;---------------------------------------------------------------
> 
> Thanks for your help.
> 
> Sungwoo


Hi Sungwoo,

You need to subscribe to the MCL mailing list.  Go to www.digitool.com where
you will find instructions for signing up.

Once you subscribe, post your question to that list.  There are some very
friendly and knowledgable folks there, who I'm sure will help you out.

Cheers,
Glen
From: Sungwoo, Lim
Subject: Re: [Q] Automatic view update in MCL
Date: 
Message-ID: <130320011401510938%sungwoo@cad.strath.ac.uk>
In article <····················@bellsouth.net>, Glen Foy
<······@bellsouth.net> wrote:

> Hi Sungwoo,
> 
> You need to subscribe to the MCL mailing list.  Go to www.digitool.com where
> you will find instructions for signing up.
> 
> Once you subscribe, post your question to that list.  There are some very
> friendly and knowledgable folks there, who I'm sure will help you out.
> 
> Cheers,
> Glen

Thanks,
And sorry about the posing in the wrong place. =)

Sungwoo
From: Dave Seaman
Subject: Re: [Q] Automatic view update in MCL
Date: 
Message-ID: <98lpm2$8aj@seaman.cc.purdue.edu>
In article <··························@cad.strath.ac.uk>,
Sungwoo, Lim <·······@cad.strath.ac.uk> wrote:

>How can I automatically update a view in a drawing window in MCL?
>With the below codes, the contents of drawing is erased when the window
>is shaded or resized.

>;--------------------------------------------------------------
>(require 'quickdraw)
>(defclass simple-drawing-item (dialog-item) ())
>(defmethod dialog-item-action ((view simple-drawing-item))
>   ; drawing a free line function  
>) 

>(defparameter *w1* 
>  (make-instance 'window
>    :window-title "SketchPad"
>    :view-nick-name 'sketchpad
>    :view-size ·@(600 400)
>    :color-p t
>    :view-subviews (list
>                    (make-instance 'simple-drawing-item
>                      :view-size ·@(600 400)))))
>;---------------------------------------------------------------

>Thanks for your help.

You probably want to make your class simple-drawing-item a subclass of
simple-view, rather than a subclass of dialog-item.  Note that
dialog-item already inherits from simple-view, but it has some
functionality that you are not using here.  If you want to accept clicks
in the drawing window and have them do something, you can define a
view-click-event-handler for your view.

In any case, you need to define a view-draw-contents method for your
class simple-drawing-item.  The default method does nothing.

You can read about view-draw-contents in Chapter 4, "Views and Windows",
in the MCL Reference Manual, which is available in PDF form on the
CD-ROM.

-- 
Dave Seaman			·······@purdue.edu
Amnesty International calls for new trial for Mumia Abu-Jamal
<http://www.amnestyusa.org/abolish/reports/mumia/>
From: Sungwoo, Lim
Subject: Re: [Q] Automatic view update in MCL
Date: 
Message-ID: <150320011553077721%sungwoo@cad.strath.ac.uk>
In article <··········@seaman.cc.purdue.edu>, Dave Seaman
<···@seaman.cc.purdue.edu> wrote:


> You probably want to make your class simple-drawing-item a subclass of
> simple-view, rather than a subclass of dialog-item.  Note that
> dialog-item already inherits from simple-view, but it has some
> functionality that you are not using here.  If you want to accept clicks
> in the drawing window and have them do something, you can define a
> view-click-event-handler for your view.
> 
> In any case, you need to define a view-draw-contents method for your
> class simple-drawing-item.  The default method does nothing.
> 
> You can read about view-draw-contents in Chapter 4, "Views and Windows",
> in the MCL Reference Manual, which is available in PDF form on the
> CD-ROM.

Thanks, =)

Sungwoo