Hi Stewart,
yes - I borrowed the code from one of the class example methods for the Printer class in the Smalltalk Goodies. Really, I would just like the widget to draw itself on a medium which is the printer. Not quite sure how to do that though..
David
On Fri, 2008-07-11 at 00:12 +1200, Stewart MacLean wrote:
Hi David,
It’s been sometime since I’ve visited printing tables in VW, and the details are lost in mists of time. The approach I took was to drive it using the underlying data - I suspect the approach you are taking will only display what is rendered on the display.
As stab in the dark, I’m wondering if
mainWindow
component: cmp;
extentEvent: mainWindow bounds extent;
flushCaches.
Could be causing your problems, as you are assigning a “subwidget” as the component of the window?
Cheers,
Stewart
-----Original Message-----
From: david [mailto:david.long@...]
Sent: 10 July 2008 8:22 p.m.
To: Stewart MacLean
Cc: vwnc@...
Subject: Re: [vwnc] MockMedium and Printing Problem
Hi Stewart,
I have a table that I have done in VW. I attached a picture of the UI. Basically, when you hit the print button, it should have the table widget print itself out on the graphics medium - which is the printer. It started working when I got a new image, although I think the borders are getting clipped.
Here's the code:
print
| ps cmp mainWindow mainCmp |
mainWindow := Window currentWindow.
mainCmp := mainWindow component.
self builder window.
cmp := self builder componentAt: #tableAspect.
ps := Printer startPrintJobNamed: 'temp.postscript'.
[(MockMedium
on: ((ScalingWrapper on: cmp copy) scale: 0.50)
in: (0 @ 0 extent: mainWindow bounds extent)
for: ps)
newGraphicsDevice: ps graphicsDevice;
display]
ensure:
[mainWindow
component: cmp;
extentEvent: mainWindow bounds extent;
flushCaches.
ps print.
mainWindow
component: mainCmp;
extentEvent: mainWindow bounds extent;
flushCaches.
].
On Tue, 2008-07-08 at 14:35 +1200, Stewart MacLean wrote:
Hi David,
Can you please provide a bit more background to your problem. I.e. what version of VW you are using, your platform, whether the error occurs when printing examples or in your own code, and also attach the walkback log of the doesNotUnderstand:.
Cheers,
Stewart
-----Original Message-----
From: vwnc-bounces@... [mailto:vwnc-bounces@...] On Behalf Of david
Sent: 7 July 2008 11:50 p.m.
To: vwnc@...
Subject: [vwnc] MockMedium and Printing Problem
Hello,
I was wondering if anyone had encountered a problem with MockMedium and Printing. This class is used in the Printer examples.
I've found I get a #doesNotUnderstand: message which then closes the main window. The print job runs ok, but for some reason the MockMedium
is being set as the main window, and it does not understand how to handle mouse events - or so it seems.
Anyone seen anything like this? Or know of a working method for printing a widget out to a file?
thanks,
David
Your business, your way.
http://sageteagroup.com
|
_______________________________________________
vwnc mailing list
vwnc@...
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Your business, your way.
http://sageteagroup.com
|
Your business, your way.
http://sageteagroup.com
|
_______________________________________________
vwnc mailing list
vwnc@...
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc