How do I make my textview area scrollable if...

This is a discussion on How do I make my textview area scrollable if... within the Linux Programming forums, part of the Platform Specific Boards category; How do I make my textview area scrollable if there is to much text for the textview widget to hold? ...

  1. #1
    Registered User Annonymous's Avatar
    Join Date
    Apr 2011
    Location
    Jackson, New Jersey, United States
    Posts
    302

    How do I make my textview area scrollable if...

    How do I make my textview area scrollable if there is to much text for the textview widget to hold?

    For example, let's say my textview widget can hold 9 lines. If a tenth line is added the widget then extends vertically and the buttons are out of reach.

    What I would like to do is if this becomes the problem. I want the text are to become scrollable.

    How would I go about this?

    Thanks.

  2. #2
    Registered User Annonymous's Avatar
    Join Date
    Apr 2011
    Location
    Jackson, New Jersey, United States
    Posts
    302
    I figured it out.

    I detached the textview from the table.(Removed the highlighted in red)
    Code:
    view = gtk_text_view_new ();
    //gtk_table_attach_defaults(GTK_TABLE(table), view, 1, 9, 2, 5);
    buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(view));
    And enabled the scrollable window with:
    Code:
    scrolledwindow = gtk_scrolled_window_new(NULL, NULL);
    gtk_container_add(GTK_CONTAINER(scrolledwindow), view);
    gtk_table_attach_defaults(GTK_TABLE(table), scrolledwindow, 1, 9, 2, 5);
    gtk_widget_show(scrolledwindow);
    Thanks all.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 09-21-2006, 06:14 AM
  2. So I want to make a bunch of text area things
    By Noobwaker in forum Windows Programming
    Replies: 4
    Last Post: 05-12-2006, 11:26 AM
  3. Circle Area
    By Zophixan in forum C++ Programming
    Replies: 3
    Last Post: 11-05-2002, 11:50 AM
  4. Scrollable window within a SDI
    By phil in forum Windows Programming
    Replies: 3
    Last Post: 10-14-2002, 05:53 PM
  5. Looking for LA area programmers to make a demo for an RPG!!
    By Unregistered in forum C++ Programming
    Replies: 11
    Last Post: 08-31-2001, 09:08 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21