From: Roode, E. <er...@ba...> - 2008-07-17 19:00:30
|
How do I compute the size (amount of screen real-estate) that a given chunk of text will be, in a given font? The reason I ask is that I am trying to change the text of a label, and using the Text or Change methods do not resize the control; the control stays at its original size and truncates any new text. (This behavior is very annoying!). Here is an example: my $main = Win32::GUI::Window->new (-name => 'Main', -width => 300, -height => 150); my $label = $main->AddLabel (-text => 'foo'); $label->Text('Much longer now'); $main->Show; Win32::GUI::Dialog; What displays is "Mu", because that's all that can fit in the space where "foo" was. Is there a way to make a Label auto-resize? Thanks in advance, Eric |