Hmmm...
I've tried both explicitly sending the initial size in any of the following
ways:

1) widget.gl = wx.wxGLCanvas(widgets.test, wx.wxID_ANY,
wx.wxDefaultPosition, wx.wxSize(200, 200), wx.wxFULL_REPAINT_ON_RESIZE)
2) widget.gl = wx.wxGLCanvas(widgets.test, wx.wxID_ANY,
wx.wxDefaultPosition, wx.wxDefaultSize, 3) wx.wxFULL_REPAINT_ON_RESIZE)
3) widget.gl:SetClientSize(wx.wxSize(200, 200))

1 and 3 report the correct size with widget:GetClientSize(), while 2 reports
(0, 0).

How none of these have any visual effect - the widget remains invisible.

- Tyson

On Tue, Aug 25, 2009 at 3:13 AM, John Labenski <jlaben...@gmail.com> wrote:

> On Mon, Aug 24, 2009 at 11:57 AM, Tyson Roberts<wx...@cabbits.net> wrote:
> > Hello, thanks for the feedback.  I discovered something as part of going
> > through the example, notably that I was forgetting to setup the viewport
> in
> > GL before trying to display.  I took the following lines from the cube
> demo
> > and tried to use them:
> >
> > const wxSize ClientSize = GetClientSize();
> > glViewport(0, 0, ClientSize.x, ClientSize.y);
> >
> > However, when implementing these in wxLua, I found that ClientSize ends
> up
> > being (0, 0)!  I'm not sure what to make of this - it seems like the
> canvas
> > is creating itself with a zero width/height.  But is this a direct
> problem,
> > or a symptom of something else awry?  Any suggestions?
>
> http://wxlua.sourceforge.net/docs/wxluaref.html#wxGLCanvas
>
> The wxGLCanvas constructor takes a wxSize as an input. You probably
> have to specify it, though if it is the first and only child of the
> wxFrame it should take the client size of the frame and you should use
> wxDefaultSize. However, sometimes you need to call
> wxFrame::SendSizeEvent() before wxFrame::Show() to have it correctly
> lay itself out. Either that or slightly resize the frame by hand while
> printing wxGLCanvas::GetSize() in your wxEVT_PAINT handler to test
> what the size is.
>
> Hope this helps,
>     John
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> wxlua-users mailing list
> wxlua-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wxlua-users
>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to