Re: GtkEditable



Hi Dreamtick

> how can i get the length of the current selection of a GtkEditable Widget ?

GTK_EDITABLE(my_widget)->selection_end_pos -
	GTK_EDITABLE(my_widget)->selection_start_pos

But I can remember that I had the problem, that start was sometimes
greater then end (maybe when you select from the right to the left).

So you have to do something like:

	selection_length = MAX(start, end) - MIN(start, end);

Bye

Jan-Marek






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