Once upon a time Rajarshi Guha wrote @ 20 May 2003 16:41:29 -0400
Hi, I've recently started working on a Gtk2 project. I previously used to use the GtkText widget for multi line editing, but thats deprecated in favour of the GtkTextView/GtktextBuffer combo. However the text/ example in the docs for gtk2 only shows the use of GtkText. Right now my problem is how can I clear a text view? The way I thought it would work is buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text1)); gtk_text_buffer_delete(buffer, ?, ?) My question is: how do I get a text iterator to the beginning and end of a bufffer? Ithink I must be missing something obvious but any help would be appreciated. Thanks,
Working on a text editor, I've written this code! /* I've omitted error checking! */ void katoob_delete_buffer (GtkTextBuffer *buffer) { GtkTextIter start, end; gtk_text_buffer_get_start_iter (buffer, &start); gtk_text_buffer_get_end_iter(buffer, &end); gtk_text_buffer_delete (buffer, &start, &end); } -- ---------------- -- Katoob Main Developer Linux registered user # 224950 ICQ # 58475622 FIRST make it run, THEN make it run fast "Brian Kernighan".
Attachment:
pgp3bIOQHWS0l.pgp
Description: PGP signature