Re: GtkTextView geometry



On Mon, 2005-09-12 at 21:01 -0400, Frank W. Miller wrote:
> 
> Greetings,
> 
> I don't know if this is the right list for this so if not I apologize in
> advance.
> 
> Let's say I want to create a GtkTextView that has a set size at startup
> (regardless of its contents).  Let's also say that I want the size of
> the GtkTextView to remain the same when I append text to it.  I'd also
> like it to have horiz and vertical scrollbars that can be used to scroll
> around in the associated GtkTextBuffer while the GtkTextView remains the
> same size.
> 
> How would I go about setting this up?
> 

Not sure your question makes sense. I think when you say size of the
TextView you may really mean the size of the GtkScrolledWindow
containing the text view, and when you say TextBuffer you may mean the
TextView.

If so then you'd put the textview in a scrolled window, and the easiest
way to set the default size is gtk_window_set_default_size() on the
*toplevel* GtkWindow (not the scrolled window). But using
gtk_window_set_geometry_hints() and providing the scrolled window as a
geometry widget you could get more elaborate. Or there's
gtk_widget_set_size_request() on the scrolled window which sets its
minimum size.

Havoc





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