[wxPython-users] wx.grid column sizing
Raffaello Barella
barbarossa.platz at gmail.com
Mon Feb 25 13:30:01 PST 2008
Thanks, Robin and Andrea
2008/2/25, Andrea Gavana <andrea.gavana at gmail.com>:
>
> Hi Robin & All,
>
>
> On Mon, Feb 25, 2008 at 7:39 PM, Robin Dunn wrote:
> > Raffaello Barella wrote:
> > > To me, wx.DC.GetTextExtent works fine if the text is on a single
> line,
> > > but if I add one or more linefeed escape sequences ('\n') it keeps
> > > evaluating the text as a single line.
> >
> > Correct. GetTextExtent does not do multi-line measurements, you need
> to
> > split and or wrap the text yourself and then measure each line and sum
> > the results.
>
>
> I remember also using wx.DC.GetMultiLineTextExtent, which works with
> the following call:
>
> width, height, lineHeight =3D wx.DC.GetMultiLineTextExtent(string,
> font=3DNone)
>
> I have used it with CustomTreeCtrl (and many other widgets) and it
> works pretty well.
>
> Andrea.
>
> "Imagination Is The Only Weapon In The War Against Reality."
> http://xoomer.alice.it/infinity77/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200802=
25/effe3a60/attachment.htm
More information about the wxpython-users
mailing list