Re: [gtkmm] TextView resizing


* Barnaby Gray <bee pickle me uk> [2002-12-28 14:03:13]:
> Yes, it is placed in a ScrolledWindow. If I let it use a horizontal
> scrollbar then the TextView widget causes horizontal scrolling
> instead, if I set it to Gtk::POLICY_NEVER then it does the behaviour
> described as before.
> Additionally, since the original question I noticed if I do a
> set_size_request on the scrolled window widget then it displays
> different behaviour - the TextView now doesn't cause resizing, but
> instead scrolls horizontally, even for Gtk::POLICY_NEVER on the
> horizontal scrollbar (just no scrollbar appears).

I had a similiar problem with my application (
and asked on several mailing list on how to solve it, but people told me
that it was "expected behaviour" with GtkTreeView, whereas GtkText was
buggy in this aspect.

As far as I remember, the workaround I found was to use:

    set_size_request(0, -1); // on the scrolledwindow


    set_wrap_mode(Gtk::WRAP_CHAR); // on the textview

However, wrapping on characters isn't always the prettiest solution, so
I'm quite annoyed with the behaviour you describe as well.

> Ideally I'd like it to resort to character wrapping when a word is
> longer than a line - and I've seen this behaviour in gaim which uses
> gtk+ 2 directly, but I can't seem to replicate the setup with gtkmm 2.

A quick grep through their sources tells me that they use GtkText rather
than GtkTextView.

Hope that helps,

  - Morten.

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