5

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?

3 Answers 3

5

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

Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

1

Even inside GtkScrolledWindow with GTK_POLICY_NONE GtkTextView resizes itself while adding text. That's pretty nasty - impossible to have GtkTextView without scrollbars.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.