Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GtkTextView automatically resizing

Tags:

c

gtk

gtktextview

I'm messing around with GTK and glade for the first time, and I've run across a really annoying issue. When I enter text into a TextView, the TextView automatically resizes larger, pushing other widgets away.

This is a really annoying behavior. I do not want my TextView changing size depending on the amount of text within it.

Does anyone know what I can do to prevent the TextView from resizing based on its content?

like image 271
endeavormac Avatar asked Apr 23 '10 02:04

endeavormac


2 Answers

You should put GtkTextView into GtkScrolledWindow with "hscrollbar-policy" and "vscrollbar-policy" properties set to "automatic".

like image 57
dmitry_vk Avatar answered Sep 18 '22 04:09

dmitry_vk


I may have asked a bit too soon.

The answer is, the TextView must go inside a scrolled window.

Hopefully someone else will run across this problem one day, and this solution will help them.

like image 35
endeavormac Avatar answered Sep 18 '22 04:09

endeavormac