Re: Maximum size of text view



"Evin Robertson" <nitfol my-deja com> writes:
(I'm using Gtk+ 1.3.9).

I have two text views in a vbox.  I want the upper view to have a
maximum size of 5 lines of text (in the standard font), like this:

  * if the window grows and the top view already has 5 lines, all
    new space is given to the lower view
  * if the window shrinks, the top view stays at 5 lines until the
    bottom view has shrunk as much as possible, and then it starts
    to shrink.

In Gtk widgets seem to have minimum sizes, but I can't figure out
how to give them maximum sizes.

GTK doesn't really have maximum sizes. It probably should. 

Try playing with something like this:
  - use a GtkTable, with a GTK_SHRINK flag on the top text widget
    and GTK_EXPAND | GTK_FILL on the bottom one
  - set the size request of the top text widget to allow 5 lines,
    using gtk_widget_set_size_request() for now. Pass -1 for the width 
    request to leave it unaffected.

Also, it's not clear how to figure out how large text will be with a given texttag.

TextView is supposed to have a height_lines and width_columns
properties; however they aren't implemented yet, there's a FIXME in
the code. I just filed
http://bugzilla.gnome.org/show_bug.cgi?id=62103, you can track that
issue by putting yourself in the CC list.  These would set the size
request in terms of line height/column width.

Havoc





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