[Wxruby-users] [DEVEL] Defining Pure Virtual Functions

Kevin Smith wxruby at qualitycode.com
Wed Nov 24 13:55:40 EST 2004

Zach Dennis wrote:
> In the wxWindows source, the file "prntbase.h" defines the class 
> "wxPrintout". When wrapping this for wxRuby I am trying the call:
> cppResult = new wxPrintout( cppParm0 ); //where cppParm0 is a wxString
> If I do this it complains that I need to override the abstract class 
> wxPrintout, and define the method "bool OnPrintPage( int )".

I believe you can pattern this class after dataobject.t. It seems that 
wxpp supports an "abstract" keyword for methods, along with an ABSTRACT 
keyword for the class declaration. I believe these will allow you to 
solve the problem you are seeing. You will need to implement stubs of 
the virtual methods, and it will be up to the ruby developer to override 
those implementations with their own "real" implementations in ruby.

Hope this helps.


More information about the wxruby-users mailing list