Re: python frame not the same size as the preview

Carsten Grohmann <[email protected]>
Newsgroups gmane.comp.python.wxglade
Message-ID <[email protected]>
Hi Dennis,

I spend some time to reproduce the described size behaviour and I can't. The attached simple example shows, that frames can easily set to an fixed size. I've attached this example.

Maybe you can remove the size settings / size hints from your design and test it again.

HTH,
Carsten

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF

_______________________________________________
wxGlade-general mailing list
wxGlade-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/wxglade-general
sizetest.wxg (application/octet-stream, 1.6 KB) - not displayed
sizetest.py (text/x-python, 1.9 KB)
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# generated by wxGlade 8aca18141318 on Thu Apr 16 20:23:04 2015
#

import wx

# begin wxGlade: dependencies
import gettext
# end wxGlade

# begin wxGlade: extracode
# end wxGlade


class SizeTestFrame(wx.Frame):
    def __init__(self, *args, **kwds):
        # begin wxGlade: SizeTestFrame.__init__
        wx.Frame.__init__(self, *args, **kwds)
        
        # Menu Bar
        self.size_frame_menubar = wx.MenuBar()
        wxglade_tmp_menu = wx.Menu()
        self.size_frame_menubar.Append(wxglade_tmp_menu, _("File"))
        self.SetMenuBar(self.size_frame_menubar)
        # Menu Bar end
        self.size_frame_statusbar = self.CreateStatusBar(1)
        self.label_1 = wx.StaticText(self, wx.ID_ANY, _("Centred"), style=wx.ALIGN_CENTER)

        self.__set_properties()
        self.__do_layout()
        # end wxGlade

    def __set_properties(self):
        # begin wxGlade: SizeTestFrame.__set_properties
        self.SetTitle(_("frame_1"))
        self.SetSize((200, 200))
        self.size_frame_statusbar.SetStatusWidths([-1])

        # statusbar fields
        size_frame_statusbar_fields = [_("size_frame_statusbar")]
        for i in range(len(size_frame_statusbar_fields)):
            self.size_frame_statusbar.SetStatusText(size_frame_statusbar_fields[i], i)
        # end wxGlade

    def __do_layout(self):
        # begin wxGlade: SizeTestFrame.__do_layout
        sizer_1 = wx.BoxSizer(wx.VERTICAL)
        sizer_1.Add(self.label_1, 1, wx.ALL | wx.EXPAND, 5)
        self.SetSizer(sizer_1)
        self.Layout()
        # end wxGlade

# end of class SizeTestFrame
class MyApp(wx.App):
    def OnInit(self):
        size_frame = SizeTestFrame(None, wx.ID_ANY, "")
        self.SetTopWindow(size_frame)
        size_frame.Show()
        return 1

# end of class MyApp

if __name__ == "__main__":
    gettext.install("app") # replace with the appropriate catalog name

    app = MyApp(0)
    app.MainLoop()
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.