Thread: [Boa Constr] wxButton - BS_MULTILINE feature in wxPython?
Status: Beta
Brought to you by:
riaan
From: Tim C. <ti...@ti...> - 2005-09-09 20:00:31
|
It would be very nice if wxPython would allow multiple-lined labels; and delving into the wxWindows code it appears that the presence of "\n" in the label should format the button label correctly (feature added in 2002, according to research in the wxWindows dev list). However, at least with the build of wxPython (2.5.4-msw) this functionality doesn't appear - at least on Windows. a. Is this only a Windows problem? b. Does anyone know enough about the wxPython build to know whether this feature is to be made available in wxPython? Thanks :-) Tim Dr Tim Couper TAC Software -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.10.19/93 - Release Date: 08/09/2005 |
From: Riaan B. <riaan@e.co.za> - 2005-10-04 12:36:23
|
Hi Tim, Tim Couper wrote: > It would be very nice if wxPython would allow multiple-lined labels; and > delving into the wxWindows code it appears that the presence of "\n" in the > label should format the button label correctly (feature added in 2002, > according to research in the wxWindows dev list). However, at least with the > build of wxPython (2.5.4-msw) this functionality doesn't appear - at least > on Windows. It seems to work for me. A reason why it may not appear to be working for you is that you can't enter "\n" through the Boa Inspector. Adding \n manually in the generated source works for me. Cheers, Riaan. |
From: Tim C. <ti...@ti...> - 2005-10-05 19:00:19
|
Riian/ Yes that works indeed - thanks. I note however, that if you subsequently change the color property on the button (in code), any double-line label reduces to single line with the \n char rendered as a square symbol - and the button seems to be rendered differently (eg square cornered). It appears that subsequently setting the label property on a button also causes the same symptoms. Anyone doing this kind of stuff? Simple code example below for anyone interested :-) Tim #Boa:Frame:Frame2 import wx def create(parent): return Frame2(parent) [wxID_FRAME2] = [wx.NewId() for _init_ctrls in range(1)] class Frame2(wx.Frame): def _init_ctrls(self, prnt): # generated method, don't edit wx.Frame.__init__(self, id=wxID_FRAME2, name='', parent=prnt, pos=wx.Point(271, 168), size=wx.Size(400, 182), style=wx.DEFAULT_FRAME_STYLE, title='Frame2') self.SetClientSize(wx.Size(392, 148)) def __init__(self, parent): self._init_ctrls(parent) self.button1 = wx.Button(id=wx.NewId(), label='normal\nButton', name='button1', parent=self, pos=wx.Point(48, 24), size=wx.Size(75, 72), style=0) # uncomment this to see rendering fail # self.button2.SetLabel('sss\\neee') self.button2 = wx.Button(id=wx.NewId(), label='coloured\n Button', name='button2', parent=self, pos=wx.Point(160, 24), size=wx.Size(75, 72), style=0) # uncomment this to see rendering fail # self.button2.SetBackgroundColour(wx.Colour(255, 0, 0)) -----Original Message----- From: Riaan Booysen [mailto:riaan@e.co.za] Sent: 04 October 2005 13:39 To: Tim Couper Cc: boa...@li... Subject: Re: [Boa Constr] wxButton - BS_MULTILINE feature in wxPython? Hi Tim, Tim Couper wrote: > It would be very nice if wxPython would allow multiple-lined labels; and > delving into the wxWindows code it appears that the presence of "\n" in the > label should format the button label correctly (feature added in 2002, > according to research in the wxWindows dev list). However, at least with the > build of wxPython (2.5.4-msw) this functionality doesn't appear - at least > on Windows. It seems to work for me. A reason why it may not appear to be working for you is that you can't enter "\n" through the Boa Inspector. Adding \n manually in the generated source works for me. Cheers, Riaan. -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date: 29/09/2005 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.9/115 - Release Date: 29/09/2005 |