Re: [gtk-list] Re: ANNOUNCE: GtkConsole 0.0.1



On Mon, Nov 30, 1998 at 10:33:05PM +0100, Thomas Mailund Jensen wrote:
> >>>>> "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);
>   }
> 

That's what I've tried; all I get is "from 0 to 0", no matter how much
text I try selecting.  I've run it in the debugger, but I get the same
result.

Any ideas?

Lyndon



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