Re: [gtk-list] ANNOUNCE: GtkConsole 0.0.1



>>>>> "L" == Lyndon Drake <lyndon@stat.auckland.ac.nz> writes:

 L> PS: How can I find the start and end of the selected text in a
 L> GtkText widget?  I need to prevent deletions of text outside the
 L> input area in GtkConsole.

The selection?  Get it from the editable superclass

  if (GTK_EDITABLE (text)->has_selection) {
    from = MIN (GTK_EDITABLE (text)->selection_start_pos,
		GTK_EDITABLE (text)->selection_end_pos);
    to = MAX (GTK_EDITABLE (text)->selection_start_pos,
	      GTK_EDITABLE (text)->selection_end_pos);
    g_print ("selction is from %d to %d\n", from, to);
  }

	/mailund



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