Maximize on __init__ Frame

Hello,

I have the same issue as:
<http://lists.wxwidgets.org/pipermail/wxpython-users/2008-April/074400.html>

If I use Maximize() in the __init__ process the internal widgets are not resized properly. A little margin is showned at Right and Bottom Frame.

If i call Maximize() with CallAfter, or after Show(), the frame maximize well, but makes a flick effect because the frame is displayed first in normal state and then is maximized.

Is there any solution to it?

Thanks.

···

--
*****************************************
Oswaldo Hernández
oswaldo (@) soft-com (.) es
*****************************************
PD:
Antes de imprimir este mensaje, asegúrese de que es necesario.
El medio ambiente está en nuestra mano.

Hi,

calling Layout(), as Robin suggested in the mentioned thread, fixed the problem for me:

···

2008/11/25 Oswaldo Hernández listas@soft-com.es

Hello,

I have the same issue as:

<http://lists.wxwidgets.org/pipermail/wxpython-users/2008-April/074400.html>

If I use Maximize() in the init process the internal widgets are not resized properly. A little margin is showned at Right and Bottom Frame.

If i call Maximize() with CallAfter, or after Show(), the frame maximize well, but makes a flick effect because the frame is displayed first in normal state and then is maximized.

Is there any solution to it?

Thanks.


Oswaldo Hernández

oswaldo (@) soft-com (.) es


PD:

Antes de imprimir este mensaje, asegúrese de que es necesario.

El medio ambiente está en nuestra mano.


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

======================

#! Python

-- coding: utf-8 --

import wx
appl = wx.App()
frm = wx.Frame(None, -1, “test wx.TextCtrl”) #, style=wx.DEFAULT_FRAME_STYLE | wx.MAXIMIZE
testTxtCtrl = wx.TextCtrl(frm, -1, style=wx.TE_MULTILINE | wx.TE_RICH2) #
sizerFrm = wx.BoxSizer(wx.HORIZONTAL)

sizerFrm.Add(testTxtCtrl, 1, wx.EXPAND)
frm.SetSizer(sizerFrm)

frm.Maximize()
frm.Show()
frm.Layout()
appl.MainLoop()

======================

I belive, an equivalent code using a class could be the following

======================

#! Python

-- coding: utf-8 --

import wx

class MyFrame(wx.Frame):
def init(self, parent, *args, **kwargs):
wx.Frame.init(self, parent, *args, **kwargs)

self.testTxtCtrl = wx.TextCtrl(self, -1, style=wx.TE_MULTILINE | wx.TE_RICH2)
self.sizerFrm = wx.BoxSizer(wx.HORIZONTAL)
self.sizerFrm.Add(self.testTxtCtrl, 1, wx.EXPAND)
self.SetSizer(self.sizerFrm)

self.Maximize()
self.Show()
self.Layout()

if name==“main”:
appl = wx.App(redirect=False)
frm = MyFrame(None, -1, “test wx.TextCtrl - class”)

appl.MainLoop()

======================

which seems to work identicaly for me.

(I hope the indentation remains somehow functional …)

hth,

Vlasta