Sorry to bother folks with what seems a silly question, but my mind is going in
circles trying to figure out what I'm doing wrong here. I have a wxFrame.
This contains a wxPanel. The panel contains a wxGLcanvas. I want the
wxGLCanvas to resize with the frame, and to always fill it. As it is, it ends
up being a puny 10x10 pixels in the upper left.
If I plop the wxGLCanvas directly into the wxFrame, everything works
splendidly. The reason I want the wxPanel is along the lines of the last Q on
the Gtk FAQ... so I can bind keys to all of the contents of the frame (the
frame in Gtk does not receive key events).
I tried using a wxGridSizer for the Panel, and placed the wxEXPAND style
wherever I could think of, but nothing I do seems to get the wxGLCanvas to
budge and resize. Argh! Any help would be most appreciated.
···
--
Hanlon's Razor:
Never attribute to malice that which is adequately explained by stupidity.
Where self would be your wxPanel. (You can just use panel.SetSizer( sizer) and the like if you don't feel like sub-classing the wxPanel class). For safety, calling self.Layout() at the end is a good idea (it avoids problems if/when your code is transfered to a dialog).
HTH,
Mike
Maciej Kalisiak wrote:
···
Sorry to bother folks with what seems a silly question, but my mind is going in
circles trying to figure out what I'm doing wrong here. I have a wxFrame.
This contains a wxPanel. The panel contains a wxGLcanvas. I want the
wxGLCanvas to resize with the frame, and to always fill it. As it is, it ends
up being a puny 10x10 pixels in the upper left.
If I plop the wxGLCanvas directly into the wxFrame, everything works
splendidly. The reason I want the wxPanel is along the lines of the last Q on
the Gtk FAQ... so I can bind keys to all of the contents of the frame (the
frame in Gtk does not receive key events).
I tried using a wxGridSizer for the Panel, and placed the wxEXPAND style
wherever I could think of, but nothing I do seems to get the wxGLCanvas to
budge and resize. Argh! Any help would be most appreciated.