Re: Scrolling GtkTextView dialog



On Wed, 2003-01-08 at 22:49, Dave Bentham wrote:

At the moment, when the default size is exceeded by the content, the
dialog magically grows to accomodate it; and it cannot be
manually reduced in size beyond the displayed text.

Can such a dialog be forced to use scroll bars over a certain size of
dialog?
        
        Well, I'm newbie, too, but You should (hope so:) put GtkTextView inside
a GtkScrolledWindow. Something like:

code >>>

GtkWidget *scrolled_window;
        
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_polici (GTK_SCROLLED_WINDOW (scrolled_window),
                                GTK_POLICY_AUTOMATIC,
                                GTK_POLICY_AUTOMATIC);

.... then, pack scrolled_window somewhere, maybe a vbox, or sometnig?

.... then, do:

gtk_container_add (GTK_CONTAINER (scrolled_window),
                        GtkTextView_widget); <= Your GtkTextView widget

....yes! You also need to do:

gtk_widget_show (scrolled_window)
gtk_widget_show (GtkTextView_widget);

<<< code end.

        Hope this helps,
        Vladimir.


-- 
"This is it... This is where I belong..."





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