[Gambas-user] TextWidth

Benoît Minisini gambas at ...1...
Sat Sep 4 14:31:36 CEST 2010


> 2010/9/3 Benoît Minisini <gambas at ...1...>:
> > I couldn't find a better solution than Doriano, because there is no easy
> > way to know the size of a control border in Qt and GTK+.
> > 
> > Moreover, I don't see the need of adjusting a TextBox to its contents, as
> > usually this is an editable control, and so the user can enter any text
> > in it. Or maybe you are doing something not usual with a TextBox? :-)
> > 
> > --
> > Benoît Minisini
> 
> Yes is unusual. An experiment derived of a little misunderstanding,
> just for learn about.
> 
> The best solution that I found was:
> 
> txtSomeThing.Width = txtSomeThing.TextWidth(txtSomeThing.Text & "W")

This is not a solution, as the width of the border is not related to the width 
of the "W" character at all.

-- 
Benoît Minisini




More information about the User mailing list