GtkTextView top / bottom margin?

I would like to know the correct and common way to add top and bottom fields in a GtkTextView , which is inside a GtkScrolledWindow . There are functions for setting the left and right fields that I use:

 gtk_text_view_set_left_margin(GTK_TEXT_VIEW(editor_text_view), 2); gtk_text_view_set_right_margin(GTK_TEXT_VIEW(editor_text_view), 2); 

But I can not find the documentation above and below. I tried changing the width of the border of the GtkTextView using gtk_container_set_border_width , but the border is not painted with the background color of the GtkTextView .

In principle - what I have on the left, and what I want is on the right.

Screenshot of what I haveScreenshot of what I want

+7
source share
3 answers

You must use CSS for this in GTK + 3:

http://developer.gnome.org/gtk3/3.3/GtkCssProvider.html

Perhaps you can use a class :

 .view { padding: 3px; } 

Or apply only style to GtkTextView:

 GtkTextView { padding: 3px; } 
+3
source

I am using Ubuntu Natty with gtk + -3.2.3. and these CSS properties are for some reason not affected.

But you can use: gtk_text_view_set_border_window_size ()

Along with: GTK_TEXT_WINDOW_TOP and GTK_TEXT_WINDOW_BOTTOM

And the border color will match the background of the GtkTextView.

http://developer.gnome.org/gtk3/3.4/GtkTextView.html#gtk-text-view-set-border-window-size

+2
source

I just had to solve a similar problem, and I put a text view in GtkAlignment - this gave me the opportunity to install an add-on for all parties.

+1
source

All Articles