Forum: wxRuby Printing.rb run time error.

Posted by Ann M. (ann_m)
on 2011-05-27 00:50
Attachment: printing.rb (14,1 KB)
(Received via mailing list)
I have attached a copy of printing.rb for reference.

When running this program which I got from the samples is that it gets 
an
error under the following scenario.

1.0   Run the program.
2.0  Select the File/PageSet up menu
3.0  Hit ok on the page set up dialog.
4.0  Run your mouse over the window that exists after the dialog closes
5.0  The program dies.

a.  My best guess is that the dc shown in MyCanvas class (line 196 in 
the
attachment) has been somehow lost during the page set up dialog 
processing.
I am such a Ruby newbie that I don't know if this could be correct.

b.  It appears that the on_draw(dc) at line 196 is called from Windows. 
If
my hypothesis about the dc being lost is correct, how could I capture, 
save,
and restore it.   All my attempts have failed.

c.  I am digging through the printing.rb sample and putting in comments 
as I
understand it better.  My plan is to send the commented version 
somewhere
when I finish it so that it will be easier for other Ruby newbies  to
understand.

* Where would I send it when I finish adding comments?*
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.