Re: [gtk-list] Re: GtkText widget handling of "default values"



Andreas Tille <tille@physik.uni-halle.de> wrote:
>static void FocusInEntry(GtkWidget *entry)
>{
>  g_return_if_fail ( entry ) ;
>  g_return_if_fail ( GTK_IS_ENTRY(entry) ) ;
>  gtk_editable_select_region(GTK_EDITABLE(entry), 0, -1);
>  gtk_widget_show(entry);
>}
>What am I doing wrong?

Hi, this worked for me when I did

	len = strlen( gtk_entry_get_text( GTK_ENTRY( entry ) ) );
	gtk_entry_select_region( GTK_ENTRY( entry ), 0, len );

ie., you have to give the exact end point. Puzzled me for a while too. I
used to have gtk_entry_select_region( GTK_ENTRY( entry ), 0, 10000 ) and it
caused some odd problems :/

John
--
John Cupitt, john.cupitt@ng-london.org.uk, +44 (0)171 930 2108
VASARI Lab, The National Gallery, Trafalgar Square, London, WC2N 5DN



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