Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make GtkTextView look like GtkEntry?

Or "How to add a visible (thin) border to GtkTextView"? Is it ever possible?

Thank you in advance.

like image 703
Paulo Freitas Avatar asked Jun 05 '11 00:06

Paulo Freitas


2 Answers

Years later... but searching the web still gives no good answers to this question.

The solution is quite simple: Just create a GtkFrame and add the GtkScrolledWindow containing the GtkTextView, here is some example code in python:

frame = Gtk.Frame()
scroll = Gtk.ScrolledWindow()
scroll.set_hexpand( True )
scroll.set_border_width( 3 )
textview = Gtk.TextView()
scroll.add( textview )
frame.add( scroll )
like image 154
Martin Avatar answered Nov 20 '22 18:11

Martin


After about 9 and a half years later...

I'm going to give a language-independent answer.

First, add a GtkScrolledWindow, it'll enable scrolling. Now add your GtkTextView. Then set shadow type to something other than none. It'll show a border around your GtkTextView.

like image 33
Akib Azmain Avatar answered Nov 20 '22 19:11

Akib Azmain