TextView right justification problem



Hi,

I am trying to use TextView, following the GTK2 API documentation:

 textview = GTK_TEXT_VIEW(lookup_widget(window1, "textview1"));
 buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview));
 gtk_text_buffer_set_text (buffer, "0,00", -1);
 tag = gtk_text_buffer_create_tag (buffer,
       "triplescale_rightjustify",
       "scale", 3.0,
       "justification", GTK_JUSTIFY_RIGHT,
       NULL);
 gtk_text_buffer_get_iter_at_offset (buffer, &start, 0);
 gtk_text_buffer_get_iter_at_offset (buffer, &end, -1);
 gtk_text_buffer_apply_tag (buffer, tag, &start, &end);

The text indeed is scaled by 3.0 but it is not right justified.
I can't get it right justified with "0,00", "0,00\n" or "\n0,00\n" strings.

The gtk-demo textview part contains code for right justification
but when I start to edit the start of the right justified line, it switches to left justification. When I edit it at the end of line of somewhere in the middle,
it does not change justification.

Best regards,
Zoltán Böszörményi





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]