[Gambas-user] Re: TextLabel misbehaving inside ScrollView.

Jose J. Rodriguez joe1962 at ...626...
Tue May 23 06:30:57 CEST 2006


On 5/7/06, Benoit Minisini <gambas at ...1...> wrote:
> On Saturday 06 May 2006 10:08, Jose J. Rodriguez wrote:
> > On 5/6/06, Benoit Minisini <gambas at ...1...> wrote:
> > > On Saturday 06 May 2006 03:33, Jose J. Rodriguez wrote:
> > > > On 5/4/06, Jose J. Rodriguez <joe1962 at ...626...> wrote:
> > > > > Hello,
> > > > >
> > > > > I'm trying to get a vertically scrollable TextLabel by embedding it
> > > > > inside a ScrollView, but when I set Textlabel.Autoresize to True, it
> > > > > becomes wider than the client area of the ScrollView, in fact, wider
> > > > > than the ScrollView control itself, as I can see if I activate both
> > > > > scrollbars. It doesn't matter if I set the TextLabel to Expand or
> > > > > not, nor does it matter which Arrangement I set for the ScrollView.
> > > > > If I manually set the width to Scroll.ClientWidth, I lose text at the
> > > > > bottom of the TextLabel. The ScrollView has Expand = True, in case
> > > > > this has anything to do with it.
> > > > >
> > > > > This is in Gambas 1.9.29.
> > > >
> > > > Still getting nowhere with this. I'd really appreciate a solution,
> > > > workaround (like how to know the height of the TextLabel needed to fit
> > > > the text, etc) or at least acknowledgement of the problem, as I'm sort
> > > > of stuck at this point on the installer project. The full blown html
> > > > component is not feasable for this, as it means adding another
> > > > component and also reduces the possibility if porting to the gtk
> > > > component later.
> > > >
> > > > Regards,
> > > > Joe1962
> > >
> > > There is no real solution at the moment, but you can use a TextView
> > > instead of a TextLabel, because it has a TextWidth and TextHeight
> > > property.
> >
> > Like I tried to say, TextView needs another component and has no
> > equivalent in GTK component. Also, it doesn't have "Padding", heh heh.
> > What TextView needs is a "AutoResize direction", with possible values
> > of horizontal, vertical and both.
> >
> > Regards,
> > Joe1962
> >
>
> TextLabel is just for displaying a simple and short HTML text. The problem is
> that TextView needs to be implemented in the GTK component. Adding features
> to the Qt version of TextLabel does not mean that the GTK one will have them
> automagically!
>


I know, but the stated objective is to try and have plug and play
replacement between qt and gtk components.

I'm now using a workaround, no Textlabel.Autoresize, I set the width
in code to fit the ScrollView, and set a height that will fit the
longest text I use. Is there at least the possibility to add a
property that returns the neccesary height needed for the text to fit
after setting the width? No problem if the answer is no, but it would
be a nice addition for this kind of use.

Regards,
Joe1962




More information about the User mailing list