Size of Wizards

Hi!

I am working on a simple wizard for importing stuff into our
application. The thing is that the size of a grid in a later page is
dependent on what the user selects up front.

Using the usual page sizer stuff of wx breaks down miserably. I get a
miniscule wizard with a huge grid (the wizard is some 160x160 pixels,
the content could use 800x500).

First workaround: Let the user resize the wizard by passing
wx.RESIZE_BORDER as style flag. This gives the following exception
whenever the window is resized and the grid updated:

wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed
at ../src/generic/wizard.cpp(252) in GetMaxChildSize(): Size changed in
wxWizard::GetPageAreaSizer()after RunWizard().
Did you forget to call GetSizer()->Fit(this) for some page?

This is thrown from _core_.Window.IsEnabled() which I query inside the
cell renderer of the grid to find out the background colour to use
(copied from the original wxGridCellRenderer::Draw, which is not
available for derived classes from wxPython as it seems).

Still it seems to work mostly, but the bottom right cell of the grid is
not drawn after resize. wtf!?

Second attempt: I disabled resizing and instead tried to assign a fixed
size to the wizard (60% of the screen in w, h for testing). I failed
miserably: The SetSize() method on the Wizard has not effect whatsoever.

Any idea how to get around this?

Thanks and Greetings, Torsten

···

--
DYNAmore Gesellschaft fuer Ingenieurdienstleistungen mbH
Torsten Landschoff

Office Dresden
Tel: +49-(0)351-4519587
Fax: +49-(0)351-4519561

mailto:torsten.landschoff@dynamore.de
http://www.dynamore.de

Registration court: Mannheim, HRB: 109659, based in Karlsruhe,
Managing director: Prof. Dr. K. Schweizerhof, Dipl.-Math. U. Franz

Found a way (thanks for a colleague): Just use the SetPageSize method on
the Wizard, while it is officially obsolete.

  This method is obsolete, use GetPageAreaSizer instead.

Anyway, I now have a nice wizard size. However, I don't like setting the
inner size of the window and would like setting the outer size instead.

Greetings, Torsten

···

Am Dienstag, den 10.08.2010, 12:09 +0200 schrieb Torsten Landschoff:

Second attempt: I disabled resizing and instead tried to assign a fixed
size to the wizard (60% of the screen in w, h for testing). I failed
miserably: The SetSize() method on the Wizard has not effect whatsoever.

Any idea how to get around this?

--
DYNAmore Gesellschaft fuer Ingenieurdienstleistungen mbH
Torsten Landschoff

Office Dresden
Tel: +49-(0)351-4519587
Fax: +49-(0)351-4519561

mailto:torsten.landschoff@dynamore.de
http://www.dynamore.de

Registration court: Mannheim, HRB: 109659, based in Karlsruhe,
Managing director: Prof. Dr. K. Schweizerhof, Dipl.-Math. U. Franz

I had an issue like this and used:

wx.CallAfter(wizard.SetSize,(w,h))

this helps?

···

On Tue, Aug 10, 2010 at 1:09 PM, Torsten Landschoff torsten.landschoff@dynamore.de wrote:

Hi!

I am working on a simple wizard for importing stuff into our

application. The thing is that the size of a grid in a later page is

dependent on what the user selects up front.

Using the usual page sizer stuff of wx breaks down miserably. I get a

miniscule wizard with a huge grid (the wizard is some 160x160 pixels,

the content could use 800x500).

First workaround: Let the user resize the wizard by passing

wx.RESIZE_BORDER as style flag. This gives the following exception

whenever the window is resized and the grid updated:

wx._core.PyAssertionError: C++ assertion “wxAssertFailure” failed

at …/src/generic/wizard.cpp(252) in GetMaxChildSize(): Size changed in

wxWizard::GetPageAreaSizer()after RunWizard().

Did you forget to call GetSizer()->Fit(this) for some page?

This is thrown from core.Window.IsEnabled() which I query inside the

cell renderer of the grid to find out the background colour to use

(copied from the original wxGridCellRenderer::Draw, which is not

available for derived classes from wxPython as it seems).

Still it seems to work mostly, but the bottom right cell of the grid is

not drawn after resize. wtf!?

Second attempt: I disabled resizing and instead tried to assign a fixed

size to the wizard (60% of the screen in w, h for testing). I failed

miserably: The SetSize() method on the Wizard has not effect whatsoever.

Kind of works but messes up the bitmap displayed to the left on subsequent pages after the first eon