Re: Problem selecting a region in a GtkTextBuffer



Dixit Pierre Sarrazin <sarrazip at sympatico dot ca> (2003-03-26 22:37):
I am having problems with code that should select a region in a GTK+
text buffer but does not appear to work.
        [...]
    gtk_text_buffer_place_cursor(buf, &start_it);
    gtk_text_buffer_get_iter_at_offset(buf, &end_it, end);
    mark = gtk_text_buffer_get_selection_bound(buf);
    gtk_text_buffer_move_mark(buf, mark, &end_it);

I seem to have found the cause.  After this code, in the application
I'm developing, there was a call to gtk_editable_select_region() on
a GtkEntry situated in the same top-level window as the GtkTextView.
By suspending that call, the highlighting appeared in the GtkTextView
as wanted.

-- 
Pierre Sarrazin <sarrazip at sympatico dot ca>



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