Dear List,
I've been developing an application that requires openGL. I've had some
difficulties with macOS.
I've solved some, but there is still something I cannot fix.
Here is a small example I'm using: it is an openGL panel reacting on left-
click by drawing a circle.
The example has two functionalities: on right click, the widget goes full
screen.
Another event (here a button click), trigger a change of proportion between a
left and a right panel.
Besides asking if my script can be imporved and how, I have a problem: the
openGL panel is included into a sizer with the function SHAPED activated.
The change of the proportion functionality works fine if the change of the
panel also causes a change in the size of the openGl panel; if this does not
occur (i.e. when the frame is larger than higher, and beacuse of the shaped
option the size of the openGL panel does not change...but the position should
change!) the functionality is broken. This does not occur if I use a normal wx.
widget, like a wx.Panel.
Any help would be appreiciated!
I build a small application with an aui manager. I insert one pane to the aui manager's center area. After that I prepare to add two panes to the aui manager's bottom area. The minimum/maximum/best size is set for both of the panes. Thus one pane is bigger than the other. After adding the two panes to the aui manager's bottom area the panes are equally sized. Even worse the content of one pane is cut off. Is there any way to get uneven sized panes?
CODE:
// center pane
wxWindow* m_pInteractor = new wxWindow(this, wxID_ANY);
// two panes for bottom area of auimanager
CSpectrumAnalyzerPanel* pSpectrumAnalyzerPanel = new CSpectrumAnalyzerPanel(this);
CStagePanel* pStagePanel = new CStagePanel(this);
I'm sorry but I'm having troubles understanding your statement of the problem above. Can you try explaining it a little more?
···
On 11/18/10 6:18 AM, tinauser@libero.it wrote:
Dear List,
I've been developing an application that requires openGL. I've had some
difficulties with macOS.
I've solved some, but there is still something I cannot fix.
Here is a small example I'm using: it is an openGL panel reacting on left-
click by drawing a circle.
The example has two functionalities: on right click, the widget goes full
screen.
Another event (here a button click), trigger a change of proportion between a
left and a right panel.
Besides asking if my script can be imporved and how, I have a problem: the
openGL panel is included into a sizer with the function SHAPED activated.
The change of the proportion functionality works fine if the change of the
panel also causes a change in the size of the openGl panel; if this does not
occur (i.e. when the frame is larger than higher, and beacuse of the shaped
option the size of the openGL panel does not change...but the position should
change!) the functionality is broken. This does not occur if I use a normal wx.
widget, like a wx.Panel.
Any help would be appreiciated!
Sure, and sorry for my bad english.
I have a frame which is made of two panels added in one horizontal
sizer. In one panel there is a button whose press trigger a change in
the proportion between the two panels (a change in the proportion of
the widget in the sizer).
This works fine, unless I don't place in the "expandible" panel also a
GLcanvas that has to keep its proportion during resize (the GLcanvas
is hold in a sizer with the wx.SIZED option). In particular, the error
occurs only when the change in size of the sizer holding the GLcanvas
would not trigger any change in canvas' size itself: this can happen
when the GLcanvas has reached the limits in one dimension (hight) and
the press of the button would trigger a further stretch of the other
directon(width). Because changes in the shape are not allowed (the
proportion has to remain constant), the widget should just shift
horizontally.
I have this condition when the frame is maximized: depeding on the
screen one might have to reduce the hight of the frame(or increase its
width) to reproduce this bad behaviour.
I would add this consideration:
-When the GLcanvas is in a bad position, resizing the frame brings the
widget in the correct place.I tried to evoke a size event in the
OnSize of the widget but unsucessfully.
-It actually seems that in this condition (change only of the
position), the GLcanvas does not sense any Size event. i tryed to bind
the size event of its parent instead, but did not help.
-If the button is pressed more times, the GLcanvas is always in the
position it should be before the press of the button.I have the
impression that the problem could be that the GLcanvas handles the
size event before the sizer has changed its position.
-This script works on windows, problems are with macOS. I have
experienced this several time, and I always found some programmatical
errors that somehow did not impeared the functionality in windows, but
that were not tolerated in macOS. That is why I'm asking, if someone
has time, to have a look to the program: to see if there are some part
(expecially in the event handling) that are badly designed.
Thanks
···
On Nov 18, 11:26 pm, Robin Dunn <ro...@alldunn.com> wrote:
On 11/18/10 6:18 AM, tinau...@libero.it wrote:
> Dear List,
> I've been developing an application that requires openGL. I've had some
> difficulties with macOS.
> I've solved some, but there is still something I cannot fix.
> Here is a small example I'm using: it is an openGL panel reacting on left-
> click by drawing a circle.
> The example has two functionalities: on right click, the widget goes full
> screen.
> Another event (here a button click), trigger a change of proportion between a
> left and a right panel.
> Besides asking if my script can be imporved and how, I have a problem: the
> openGL panel is included into a sizer with the function SHAPED activated.
> The change of the proportion functionality works fine if the change of the
> panel also causes a change in the size of the openGl panel; if this does not
> occur (i.e. when the frame is larger than higher, and beacuse of the shaped
> option the size of the openGL panel does not change...but the position should
> change!) the functionality is broken. This does not occur if I use a normal wx.
> widget, like a wx.Panel.
> Any help would be appreiciated!
I'm sorry but I'm having troubles understanding your statement of the
problem above. Can you try explaining it a little more?
--
Robin Dunn
Software Craftsmanhttp://wxPython.org
I think it's actually a little worse than this. The canvas window reports that it is in the right place, but the native GL viewport is still visible in the old position. So this seems to be a bug in wxMac. Please create a ticket for it at trac.wxwidgets.org.
···
On 11/19/10 1:10 AM, tinauser wrote:
Sure, and sorry for my bad english.
I have a frame which is made of two panels added in one horizontal
sizer. In one panel there is a button whose press trigger a change in
the proportion between the two panels (a change in the proportion of
the widget in the sizer).
This works fine, unless I don't place in the "expandible" panel also a
GLcanvas that has to keep its proportion during resize (the GLcanvas
is hold in a sizer with the wx.SIZED option). In particular, the error
occurs only when the change in size of the sizer holding the GLcanvas
would not trigger any change in canvas' size itself: this can happen
when the GLcanvas has reached the limits in one dimension (hight) and
the press of the button would trigger a further stretch of the other
directon(width). Because changes in the shape are not allowed (the
proportion has to remain constant), the widget should just shift
horizontally.
I have this condition when the frame is maximized: depeding on the
screen one might have to reduce the hight of the frame(or increase its
width) to reproduce this bad behaviour.
I would add this consideration:
-When the GLcanvas is in a bad position, resizing the frame brings the
widget in the correct place.I tried to evoke a size event in the
OnSize of the widget but unsucessfully.
I posted the ticket. I copied/paste the last message, so I'm sure the
English is not too bad.
Thanks for the interest, I'll try to find a work around.
···
On Nov 19, 7:10 pm, Robin Dunn <ro...@alldunn.com> wrote:
On 11/19/10 1:10 AM, tinauser wrote:
> Sure, and sorry for my bad english.
> I have a frame which is made of two panels added in one horizontal
> sizer. In one panel there is a button whose press trigger a change in
> the proportion between the two panels (a change in the proportion of
> the widget in the sizer).
> This works fine, unless I don't place in the "expandible" panel also a
> GLcanvas that has to keep its proportion during resize (the GLcanvas
> is hold in a sizer with the wx.SIZED option). In particular, the error
> occurs only when the change in size of the sizer holding the GLcanvas
> would not trigger any change in canvas' size itself: this can happen
> when the GLcanvas has reached the limits in one dimension (hight) and
> the press of the button would trigger a further stretch of the other
> directon(width). Because changes in the shape are not allowed (the
> proportion has to remain constant), the widget should just shift
> horizontally.
> I have this condition when the frame is maximized: depeding on the
> screen one might have to reduce the hight of the frame(or increase its
> width) to reproduce this bad behaviour.
> I would add this consideration:
> -When the GLcanvas is in a bad position, resizing the frame brings the
> widget in the correct place.I tried to evoke a size event in the
> OnSize of the widget but unsucessfully.
I think it's actually a little worse than this. The canvas window
reports that it is in the right place, but the native GL viewport is
still visible in the old position. So this seems to be a bug in wxMac.
Please create a ticket for it at trac.wxwidgets.org.
--
Robin Dunn
Software Craftsmanhttp://wxPython.org