Re: [gtk-list] questions on using text widget




Hi Adrian


> (2) I've created a scrolled window (with both horizontal and vertical
>     scrollbars set to display always) which contains the text
>     widget. The line wrap and word wrap of the text widget are set to
>     FALSE. If more lines are inserted into the text widget, the
>     vertical scrollbar is updated correctly. But if the line is long,
>     the line just get truncated (with an arrow at the end of line),
>     the size of the "slider" of the horizontal scrollbar does not get
>     updated and remains the same. Shouldn't the size of slider of the
>     horizontal scrollbar changed instead of the line getting
>     truncated? Is this a bug or there is something that I need to set?

I have come up against precisely this problem.  I think that the scrolled
window horizontal scrollbar only updates if the width of the contained
window changes, and long lines don't cause the width of the text widget
to change; the lines just get truncated to the width of the widget.

My solution (which I have not tried yet) is to manually resize the widget
to be wider than the longest line of text (using gdk_text_extents(),
perhaps to get the length of the line).  Perhaps there's a better way?

There will be a less kludgey way to do this when the text widget supports
horizontal scrollbars directly, perhaps.

Chris

--
Chris Malek, Sys. Admin.           cmalek@etho.caltech.edu
Division of Biology, 216-76
California Institute of Technology
Pasadena, CA  91125



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]