Multiline static text

Dear list,

I have a problem with a multliline wx.StaticText in a Panel: the second line
gets truncated (in the sense of height).
Sorry if this is a stupid question but i'm pretty new to wx.
Here's my code:

···

############################

class userPwd(wx.Panel):
    def __init__(self, parent):
         
        wx.Panel.__init__(self, parent, -1)
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.AddSpacer(30)

        #OLD password
        box = wx.BoxSizer(wx.HORIZONTAL)
        box.AddSpacer(10)
        label = wx.StaticText(self, -1, "Old Password")
        label.SetHelpText("This is the help text for the label")
        box.Add(label, 1, wx.EXPAND)
        box.AddSpacer(5)
        self.opassword = wx.TextCtrl(self, -1, "",
size=(80,-1),style=wx.TE_PASSWORD)
        self.opassword.SetHelpText("Here's some help text for field #2")
        box.Add(self.opassword, 2, wx.EXPAND)
        box.AddSpacer(10)
        sizer.Add(box, 0, wx.EXPAND)

        #new password
        box = wx.BoxSizer(wx.HORIZONTAL)
        box.AddSpacer(10)
        label = wx.StaticText(self, -1, "New password")
        label.SetHelpText("This is the help text for the label")
        box.Add(label, 1, wx.EXPAND)
        box.AddSpacer(5)
        self.npassword = wx.TextCtrl(self, -1, "",
size=(80,-1),style=wx.TE_PASSWORD)
        self.npassword.SetHelpText("Here's some help text for field #2")
        box.Add(self.npassword, 2,wx.EXPAND)
        box.AddSpacer(10)
        sizer.Add(box, 0, wx.EXPAND)

        #new password again
        box = wx.BoxSizer(wx.HORIZONTAL)
        box.AddSpacer(10)
        label = wx.StaticText(self, -1, "Retype new password")
        label.SetHelpText("This is the help text for the label")
        box.Add(label, 1, wx.EXPAND)
        box.AddSpacer(5)
        self.rnpassword = wx.TextCtrl(self, -1, "", style=wx.TE_PASSWORD)
        self.rnpassword.SetHelpText("Here's some help text for field #2")
        box.Add(self.rnpassword, 2,wx.EXPAND|wx.GROW)
        box.AddSpacer(10)
        sizer.Add(box, 0, wx.EXPAND)

        self.SetSizer(sizer)

#########################

Any help would be greatly appreciated

Thanks
Mauro

--
View this message in context: http://www.nabble.com/Multiline-static-text-tp23702686p23702686.html
Sent from the wxPython-users mailing list archive at Nabble.com.

Hi,

Dear list,

I have a problem with a multliline wx.StaticText in a Panel: the second line
gets truncated (in the sense of height).
Sorry if this is a stupid question but i'm pretty new to wx.
Here's my code:

############################

class userPwd(wx.Panel):
    def __init__(self, parent):
                 wx.Panel.__init__(self, parent, -1)
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.AddSpacer(30)

                   #OLD password box = wx.BoxSizer(wx.HORIZONTAL)
        box.AddSpacer(10) label = wx.StaticText(self, -1, "Old Password")
        label.SetHelpText("This is the help text for the label")
        box.Add(label, 1, wx.EXPAND)
        box.AddSpacer(5)
        self.opassword = wx.TextCtrl(self, -1, "",
size=(80,-1),style=wx.TE_PASSWORD)
        self.opassword.SetHelpText("Here's some help text for field #2")
        box.Add(self.opassword, 2, wx.EXPAND)
        box.AddSpacer(10)
        sizer.Add(box, 0, wx.EXPAND)

                   #new password box = wx.BoxSizer(wx.HORIZONTAL)
        box.AddSpacer(10)
        label = wx.StaticText(self, -1, "New password")
        label.SetHelpText("This is the help text for the label")
        box.Add(label, 1, wx.EXPAND)
        box.AddSpacer(5)
        self.npassword = wx.TextCtrl(self, -1, "",
size=(80,-1),style=wx.TE_PASSWORD)
        self.npassword.SetHelpText("Here's some help text for field #2")
        box.Add(self.npassword, 2,wx.EXPAND)
        box.AddSpacer(10)
        sizer.Add(box, 0, wx.EXPAND)

        #new password again
        box = wx.BoxSizer(wx.HORIZONTAL)
        box.AddSpacer(10)
        label = wx.StaticText(self, -1, "Retype new password")
        label.SetHelpText("This is the help text for the label")
        box.Add(label, 1, wx.EXPAND)
        box.AddSpacer(5)
        self.rnpassword = wx.TextCtrl(self, -1, "", style=wx.TE_PASSWORD)
        self.rnpassword.SetHelpText("Here's some help text for field #2")
        box.Add(self.rnpassword, 2,wx.EXPAND|wx.GROW)
        box.AddSpacer(10)
        sizer.Add(box, 0, wx.EXPAND)

        self.SetSizer(sizer)

#########################

Any help would be greatly appreciated

Thanks
Mauro

Maybe I'm blind, but I don't see any references to multiline anything in this code. I ran it on Windows XP under wxPython 2.8.9.1 and Python 2.5 and it worked just fine. The StaticText is up a little too far, but that's its default. I don't see any help text either when I mouse over stuff, but then again I think you're supposed to use SetToolTip for that.

What wxPython and OS are you using?

···

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4101 (20090525) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

Hi Mike

I'm running wx 2.8.9.2 and Python 2.5 on Vista
Thanks for your help

Mauro

Mike Driscoll-2 wrote:

···

Hi,

Dear list,

I have a problem with a multliline wx.StaticText in a Panel: the second
line
gets truncated (in the sense of height).
Sorry if this is a stupid question but i'm pretty new to wx.
Here's my code:

############################

class userPwd(wx.Panel):
    def __init__(self, parent):
         
        wx.Panel.__init__(self, parent, -1)
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.AddSpacer(30)

        #OLD password
        box = wx.BoxSizer(wx.HORIZONTAL)
        box.AddSpacer(10)
        label = wx.StaticText(self, -1, "Old Password")
        label.SetHelpText("This is the help text for the label")
        box.Add(label, 1, wx.EXPAND)
        box.AddSpacer(5)
        self.opassword = wx.TextCtrl(self, -1, "",
size=(80,-1),style=wx.TE_PASSWORD)
        self.opassword.SetHelpText("Here's some help text for field #2")
        box.Add(self.opassword, 2, wx.EXPAND)
        box.AddSpacer(10)
        sizer.Add(box, 0, wx.EXPAND)

        #new password
        box = wx.BoxSizer(wx.HORIZONTAL)
        box.AddSpacer(10)
        label = wx.StaticText(self, -1, "New password")
        label.SetHelpText("This is the help text for the label")
        box.Add(label, 1, wx.EXPAND)
        box.AddSpacer(5)
        self.npassword = wx.TextCtrl(self, -1, "",
size=(80,-1),style=wx.TE_PASSWORD)
        self.npassword.SetHelpText("Here's some help text for field #2")
        box.Add(self.npassword, 2,wx.EXPAND)
        box.AddSpacer(10)
        sizer.Add(box, 0, wx.EXPAND)

        #new password again
        box = wx.BoxSizer(wx.HORIZONTAL)
        box.AddSpacer(10)
        label = wx.StaticText(self, -1, "Retype new password")
        label.SetHelpText("This is the help text for the label")
        box.Add(label, 1, wx.EXPAND)
        box.AddSpacer(5)
        self.rnpassword = wx.TextCtrl(self, -1, "", style=wx.TE_PASSWORD)
        self.rnpassword.SetHelpText("Here's some help text for field #2")
        box.Add(self.rnpassword, 2,wx.EXPAND|wx.GROW)
        box.AddSpacer(10)
        sizer.Add(box, 0, wx.EXPAND)

        self.SetSizer(sizer)

#########################

Any help would be greatly appreciated

Thanks
Mauro

Maybe I'm blind, but I don't see any references to multiline anything in
this code. I ran it on Windows XP under wxPython 2.8.9.1 and Python 2.5
and it worked just fine. The StaticText is up a little too far, but
that's its default. I don't see any help text either when I mouse over
stuff, but then again I think you're supposed to use SetToolTip for that.

What wxPython and OS are you using?

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4101 (20090525) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

--
View this message in context: http://www.nabble.com/Multiline-static-text-tp23702686p23708160.html
Sent from the wxPython-users mailing list archive at Nabble.com.

goliah wrote:

Dear list,

I have a problem with a multliline wx.StaticText in a Panel: the second line
gets truncated (in the sense of height).
Sorry if this is a stupid question but i'm pretty new to wx.
Here's my code:

If you post runnable samples then it's much easier to help you out. See http://wiki.wxpython.org/MakingSampleApps

···

--
Robin Dunn
Software Craftsman