StaticText position

All,

The StaticText object does not seem to respond to its position placement. Anyone know why?

David

import wx

from pickle import FALSE

class CentralEurope(wx.Dialog):

def init (self, parent, ID, title):

wx.Dialog.init(self, parent, ID, title, size=(360, 370))

font = wx.Font(14, wx.DEFAULT, wx.NORMAL, wx.BOLD)

heading = wx.StaticText(self, -1, ‘The Central Europe’, pos=(130, 15))

heading.SetFont(font)

self.Center()

self.ShowModal()

self.Destroy()

app = wx.App(FALSE)

CentralEurope(None, -1, ‘Central Europe’)

app.MainLoop()

It works for me. It's in the upper right hand corner.

Josh

···

On Sat, Apr 3, 2010 at 12:19 PM, David Arnold <dwarnold45@suddenlink.net> wrote:

All,
The StaticText object does not seem to respond to its position placement.
Anyone know why?
David
import wx
from pickle import FALSE
class CentralEurope(wx.Dialog):
def __init__ (self, parent, ID, title):
wx.Dialog.__init__(self, parent, ID, title, size=(360, 370))
font = wx.Font(14, wx.DEFAULT, wx.NORMAL, wx.BOLD)
heading = wx.StaticText(self, -1, 'The Central Europe', pos=(130,
15))
heading.SetFont(font)

    self\.Center\(\)
    self\.ShowModal\(\)
    self\.Destroy\(\)

app = wx.App(FALSE)
CentralEurope(None, -1, 'Central Europe')
app.MainLoop()

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

--
Josh English
Joshua.R.English@gmail.com

Hi,

I have no solution but at least I can confirm the observed behaviour. The text is written in the left upper corner. I am using debian testing with wx.version() 2.8.10.1

Ralf

David Arnold wrote:

···

All,

The StaticText object does not seem to respond to its position placement. Anyone know why?

David

import wx
from pickle import FALSE

class CentralEurope(wx.Dialog):
    def __init__ (self, parent, ID, title):
        wx.Dialog.__init__(self, parent, ID, title, size=(360, 370))

        font = wx.Font(14, wx.DEFAULT, wx.NORMAL, wx.BOLD)
        heading = wx.StaticText(self, -1, 'The Central Europe', pos=(130, 15))
        heading.SetFont(font)

        self.Center()
        self.ShowModal()
        self.Destroy()

app = wx.App(FALSE)
CentralEurope(None, -1, 'Central Europe')
app.MainLoop()

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Yes. wx.Dialogs, like wx.Frames, have a feature that when there is just one child widget then it is moved and expanded to fill the client area of the frame/dialog.

Other container windows don't do that, so the attached modification to your sample will help show what is going on. Notice that the panel is not given a size, but it will fill the dialog.

dlgfill.py (599 Bytes)

···

On 4/3/10 12:19 PM, David Arnold wrote:

All,

The StaticText object does not seem to respond to its position
placement. Anyone know why?

--
Robin Dunn
Software Craftsman