[10555] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Re: ANNOUNCE: GtkConsole 0.0.1

daemon@ATHENA.MIT.EDU (Lyndon Drake)
Mon Nov 30 17:03:46 1998

Date: Tue, 1 Dec 1998 11:03:16 +1300
From: Lyndon Drake <lyndon@stat.auckland.ac.nz>
To: gtk-list@redhat.com
In-Reply-To: <y3xlnks3lym.fsf@sunbird.daimi.au.dk>; from Thomas Mailund Jensen on Mon, Nov 30, 1998 at 10:33:05PM +0100
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

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

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post