Search code examples
cgtkgtktextview

GtkTextView can't wrap line


Hello I'm using Gtk on C, I need to have a GtkTextView in the middle of my window with many other widgets, I can't make the widget wrap lines. This is a very annoying behavior, anyone have any idea of what am I missing? This is the code I'm using to set it's properties:

gtk_text_view_set_left_margin(GTK_TEXT_VIEW(commentsTextView),20);
gtk_text_view_set_right_margin(GTK_TEXT_VIEW(commentsTextView),290);
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(commentsTextView),GTK_WRAP_WORD);
gtk_text_view_set_pixels_inside_wrap(GTK_TEXT_VIEW(commentsTextView),0);
gtk_widget_set_size_request(commentsTextView,300,300);

Edit:

I solved this in a different way, still the problem remains unsolved :S


Solution

  • Did you put your text view into a GtkScrolledWindow?