wx.PseudoDC missing method

Hi everybody,
I would like to use dc.GetTextExtent method, being dc a PseudoDC
instance, but it looks like PseudoDc, differently from other DC
classes, hasn't this method. Maybe I'm not using PseudoDC in the
orthodox way, otherwise how could I circumvent this problem? I need to
right-align text in a drawing

thanks in advance for hints,

Marco

Hi,

···

On Sep 6, 2009, at 8:35 AM, Marco Prosperi wrote:

Hi everybody,
I would like to use dc.GetTextExtent method, being dc a PseudoDC
instance, but it looks like PseudoDc, differently from other DC
classes, hasn't this method. Maybe I'm not using PseudoDC in the
orthodox way, otherwise how could I circumvent this problem? I need to
right-align text in a drawing

Use DrawLabel

dc.DrawLabel("SomeText", rect, wx.ALIGN_RIGHT)

Cody

perfect!

thanks a lot

···

On 6 Set, 15:44, Cody Precord <codyprec...@gmail.com> wrote:

Hi,

On Sep 6, 2009, at 8:35 AM, Marco Prosperi wrote:

> Hi everybody,
> I would like to use dc.GetTextExtent method, being dc a PseudoDC
> instance, but it looks like PseudoDc, differently from other DC
> classes, hasn't this method. Maybe I'm not using PseudoDC in the
> orthodox way, otherwise how could I circumvent this problem? I need to
> right-align text in a drawing

Use DrawLabel

dc.DrawLabel("SomeText", rect, wx.ALIGN_RIGHT)

Cody

Marco Prosperi wrote:

Hi everybody,
I would like to use dc.GetTextExtent method, being dc a PseudoDC
instance, but it looks like PseudoDc, differently from other DC
classes, hasn't this method. Maybe I'm not using PseudoDC in the
orthodox way, otherwise how could I circumvent this problem? I need to
right-align text in a drawing

thanks in advance for hints,

If you need to measure text you can always create a wx.ClientDC to do it. There are some optimizations in place where it is needed to help make a measuring-only dc more efficient.

···

--
Robin Dunn
Software Craftsman