[wxPython] wxGLcanvas on Panel

I am just played around with wxGLCanvas. It doesn't seem to be
possible to display OGL content on a Panel!? What I want is to mix
wxGLCanvas, Panels, Buttons and Grid in one single Frame. Is that
possible?

On the other hand I found out a way to do just that. But it seems to
be not the correct way and I would like ask if it is okay to do so.

At first I generate an Canvas inside a frame and draw some GL stuff.
AFTER I showed the frame, I add a panel and increase the dimension of
the frame. The panel gets visible, and the Canvas still gets updated.

Any comments appreciated.

Lucian

Here is the code:

...

frame=wxFrame(pos = wxPoint(100, 100), size = wxSize(400, 400) ,....)
canvas=CubeCanvas(frame) #taken from the wxGLCanvas Demo
        
frame.Show(true)
frame.panel = wxPanel(...,pos=wxPoint(400,400),size=wxSize(200,200), ...)
frame.SetSize(wxSize(1200,900))

...

I have a wxCheckBoxList where I dynamically add/remove items. I wan't to
keep it sorted, but I found out that style=wxLB_SORT made it misbehave (as
previously reported in this list). Now I sort things manually as items are
Append()ed, and I'd like to be able to Check(1|0) items without actually
emitting an EVT_CHECKLISTBOX, just like you can SetValue in wxCheckBoxes.

How do I do that?

Regards

···

__
Audun Nordal

I am just played around with wxGLCanvas. It doesn't seem to be
possible to display OGL content on a Panel!? What I want is to mix
wxGLCanvas, Panels, Buttons and Grid in one single Frame. Is that
possible?

Yep. Make a panel as the child of the frame, and the canvas buttons, grid,
etc. as children of the panel.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

I have a wxCheckBoxList where I dynamically add/remove items. I wan't to
keep it sorted, but I found out that style=wxLB_SORT made it misbehave (as
previously reported in this list). Now I sort things manually as items are
Append()ed, and I'd like to be able to Check(1|0) items without actually
emitting an EVT_CHECKLISTBOX, just like you can SetValue in wxCheckBoxes.

How do I do that?

If it's sending an event when you call Check, then please enter a bug report
about it. In the meantime you can get around it by setting a flag before
calling Check and checking the flag in your event handler.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

Yeah, but the problem is, that if I am put GLCanvas and a panel inside
a frame and show the frame afterwards, the GL content will not be
vissible.

···

I am just played around with wxGLCanvas. It doesn't seem to be
possible to display OGL content on a Panel!? What I want is to mix
wxGLCanvas, Panels, Buttons and Grid in one single Frame. Is that
possible?

Yep. Make a panel as the child of the frame, and the canvas buttons, grid,
etc. as children of the panel.

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

--
Best regards,
gemes mailto:gemes@gmx.at

Yeah, but the problem is, that if I am put GLCanvas and a panel inside
a frame and show the frame afterwards, the GL content will not be
vissible.

It works for me. Possibly a stupid question, but do you set the size of the
cavnas to be something other than the default (0,0)?

I just checked in a new wxGLCanvas with some (currently disabled code) that
shows and example of doing it. See

http://cvs.wxwindows.org/cgi-bin/viewcvs.cgi/wxPython/demo/wxGLCanvas.py?rev
=1.8&content-type=text/vnd.viewcvs-markup

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

Hello Robin,

thanks, it works with your 'new' example. I just tried to use the
frame or the panel directly as parent for the GLCanvas. It works now with

box.Add(..).

Thanks,
Lucian

Thursday, June 13, 2002, 7:23:31 PM, you wrote:

···

Yeah, but the problem is, that if I am put GLCanvas and a panel inside
a frame and show the frame afterwards, the GL content will not be
vissible.

It works for me. Possibly a stupid question, but do you set the size of the
cavnas to be something other than the default (0,0)?

I just checked in a new wxGLCanvas with some (currently disabled code) that
shows and example of doing it. See

http://cvs.wxwindows.org/cgi-bin/viewcvs.cgi/wxPython/demo/wxGLCanvas.py?rev
=1.8&content-type=text/vnd.viewcvs-markup

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

--
Best regards,
Lucian mailto:gemes@gmx.at