Re: how to justify text in a GtkTextView




Boncek, John wrote:

I can't get text justification to work.  Am I missing something?  Here is
a code snippet:

        // create TextView
        GtkTextView *           view;
        GtkTextBuffer *         buffer;
        view = GTK_TEXT_VIEW(gtk_text_view_new());
        buffer = gtk_text_view_get_buffer(view);
        gtk_text_buffer_set_text (buffer, "some initial text", -1);
//      GtkTextIter             start;
//      GtkTextIter             end;
//      gtk_text_buffer_get_start_iter(buffer, &(start));
//      gtk_text_buffer_get_end_iter(buffer, &(end));
//      gtk_text_buffer_remove_all_tags (buffer, &(start), &(end));
        gtk_text_view_set_justification (view, GTK_JUSTIFY_CENTER);

The text window appears, displays the initial text, and accepts keyboard
input, etc.  But it comes up left-justified regardless.  I tried
GTK_JUSTIFY_RIGHT also.  I also tried turning off any tags in case any
tags are created by default, as indicated in the currently-commented
section, since the documentation says the justification can be overridden
by a tag.
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org

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