Hi,
I have a proposal for several problems related with the GLCanvas initializer.
1/ the current 3 forms of constructors / initializers does not allow a
simple support for keyword arguments :
GLCanvas.new(Window parent, Integer id = -1,
Point pos = DEFAULT_POSITION,
Size size = DEFAULT_SIZE,
Integer style=0,
String name="GLCanvas",
Integer attribList = 0,
Palette palette = NullPalette)
GLCanvas.new(Window parent, GLContext sharedContext,
Integer id = -1,
Point pos = DEFAULT_POSITION,
Size size = DEFAULT_SIZE,
Integer style=0,
String name="GLCanvas",
Integer attribList = 0,
Palette palette = NullPalette)
GLCanvas.new(Window parent, GLCanvas sharedCanvas,
Integer id = -1,
Point pos = DEFAULT_POSITION,
Size size = DEFAULT_SIZE,
Integer style=0,
String name="GLCanvas",
Integer attribList = 0,
Palette palette = NullPalette)
The additional sharedContext and sharedCanvas of the 2nd and 3rd form
makes it difficult to use the facilities from keyword_ctrs.rb and
keyword_defs.rb
2/ These 3 forms implicitly creates a GLContext (see the wxWidgets
documentation).
Currently, there is no way to create a GLCanvas without creating
implicitly a GLContext at the wxRuby level.
In wxWidgets, this is supported by the fourth form of constructor with
the following C++ signature (see the location of attribList) :
wxGLCanvas (wxWindow *parent, wxWindowID id=wxID_ANY, const int
*attribList=NULL, const wxPoint &pos=wxDefaultPosition, const wxSize
&size=wxDefaultSize, long style=0, const wxString
&name="GLCanvas",
const wxPalette &palette=wxNullPalette)
As indicated in the documentation for wxWidgets 2.8.x, this fourth
form is the preferred way.
In wxWidgets 2.9.x, this is the correct way, the first 3 forms are
deprecated and will be removed in the future.
=> My proposal :
a) Add the 4th form at the wxRuby level : this will correct a missing feature
b) Support keyword args only for this 4th form of constructor : this
can be supported easily
c) The first 3 forms are kept for compatibility but are made deprecated.
Cheers.
Chauk-Mean.