Re: How can I enable the horizontal scroll-bar in a text widget.

The short answer is you can't.  The Gtk Text widget does not support a
horizontal scrollbar.

The long answer is that you have to manage the scrollbars yourself.  I have
written a 50 line key press processing routine that manually manages both
the vertical and horizontal scrollbar of a text widget (I haven't been able
to make it work where the vertical is managed by the text widget and the
horizontal by my code).  It is ugly and a horrible hack, it flickers, but
it works.

If you are interested, I'll email a small test app with a Gtk Text window with
vertical and horizontal scrollbars to you directly, but take note that it will
probably take a bit of effort to integrate into any code you currently have.


I ripped some code from the up-to-date Perl/Gtk+ widget demo. I have a
text widget with a vertical scroll-bar and a horizontal one nearby. The
vertical one works perfectly, but I cannot get the horizontal one to do
anything. It doesn't seem to move the window either way.

How can I get it to move the text left and right?

I am attaching the sample code to this message.


      Shlomi Fish


Andrew Schretter
Systems Programmer, Duke University
Dept. of Mathematics (919) 660-2866

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