dagorym
dagorym

Reputation: 5835

Howto determine the size of a string give the current font in wxWidgets

Is there a way to determine the display length of a given string (in pixels) based on the currently selected font in (C++) wxWidgets?

For example if I print out the string "Speed:" and want to put 10 pixels between the ':' and the value about to follow, I need to know how long the "Speed:" string was. Is there a way to determine this? I can't seem to find anything in the API documentation but I may be missing something.

Upvotes: 2

Views: 1148

Answers (1)

Nick
Nick

Reputation: 13444

Maybe http://docs.wxwidgets.org/stable/wx_wxdc.html#wxdcgettextextent ?

Note: I'm not a wxWidgets user.

Upvotes: 5

Related Questions