GtkEditable::delete_text

void delete_text(int start_pos, int end_pos);

Deletes a sequence of characters. The characters that are deleted are those characters at positions from start_pos up to, but not including end_pos. If end_pos is negative, then the the characters deleted will be those characters from start_pos to the end of the text.

Example 53. Deleting all text from an entry


$editable->delete_text(0, -1);

     

Example 54. Deleting all selected text from the editable


$bounds = $editable->get_selection_bounds();
if ($bounds !== false) {
    $editable->delete_text($bounds[0], $bounds[1]);
}

     

See also: delete_selection()