"Katjana T." <
[hidden email]> wrote in message
news:
[hidden email]...
> I've a problem
> with generating a bitmap from the open window.
> How does it work?
See the code bellow for one way, there may be better ways. I did this
quickly.
==============
"Create and open a view."
v := (ListPresenter show) view.
v model: (ListModel on: #('aaa' 'bbb' 'ccc')).
pv := v topShell.
pv extent: 100 @ 100.
"Evaluate this separately after the view is opened."
canvas := pv canvas.
bitmap := Bitmap compatible: canvas extent: pv clientExtent.
bmCanvas := bitmap canvas.
bmCanvas backcolor: Color white.
bmCanvas erase.
bmCanvas bitBlt: pv canvas rectangle: pv clientRectangle
to: 0@0 rop: (Integer fromString: '16rCC0020').
bitmap inspect.
==============
> And how can I print it then?
Instead of a Canvas as used above I imagine you could use a PrinterCanvas.
> I also have to deposit the function 'print' in my DefaultView,
> how can I invoke this?
Add a command to the menu, and then add a similarly named method to the
presenter class. Visit the Education Center (
http://www.object-arts.com/EducationCentre/Education.htm ) to learn more and
look at some tutorials.
Chris