Thanks for your help, I'm underway but have to get some sleep now.
I now have a working GETGETSEL as follows:
Code: Select all
HB_FUNC( GETGETSEL )
{
gboolean retval;
gint start;
gint end;
GtkWidget * hWnd = ( GtkWidget * ) hb_parnl( 1 );
retval = gtk_editable_get_selection_bounds( GTK_EDITABLE( hWnd ), &start, &end );
hb_stornl( start, 2 );
hb_stornl( end, 3 );
hb_retl( retval );
}
Code: Select all
METHOD GetSel( nStart, nEnd ) CLASS TGet
LOCAL iFirst
LOCAL iLast
LOCAL lRetVal
iFirst := 0
iLast := 0
lRetVal := GetGetSel( ::hWnd, @iFirst, @iLast )
IF lRetVal
// MsgInfo( "Selection" )
// MsgInfo( iFirst )
// MsgInfo( iLast )
nStart := iFirst
nEnd := iLast
ENDIF
RETURN lRetVal
in get.prg
nStart is set to first character in selection (0 based) and nEnd to the first character not in the selection (0 based).
It may be convenient to modify these values, perhaps to give first character position (1 based) and length depending upon the best way to modify TGet:KeyDown().
Thanks
Doug
(xProgrammer)