RE: clipboard pasted text highlighting broken?



A strange observation using the code in the previous post below...

With the start position of gtk_editable_select_region() set to "(gint) 0";
*  All text placed into a gtkentry using gtk_entry_set_text() is
selected/highlighted.
*  NO text placed into the same gtkentry using gtk_editable_paste_clipboard() is
selected/highlighted.

With the start position of gtk_editable_select_region() set to "(gint) 1";
*  All text after the first character placed into a gtkentry using
gtk_entry_set_text() is selected/highlighted.
*  All text placed into the same gtkentry using gtk_editable_paste_clipboard() -
including the first character - is selected/highlighted.

This sounds like a bug.  I get different results when using the same arguments
to gtk_editable_select_region() based on where the text in a gtkentry came from.
Can anyone else independently confirm this?



				-- Stupid Genius

> ----------
> From: 	Dugas, Alan[SMTP:alan dugas analog com]
> Sent: 	Monday, October 16, 2000 10:13 AM
> To: 	gtk-app-devel-list gnome org; gtk-list gnome org
> Subject: 	clipboard pasted text highlighting broken?
> 
> Sorry for the repost, but this seems like it's something that someone else
> would
> have run into by now.  Simply put, how do you highlight text in a gtkentry
> widget that was pasted there from the clipboard?  Any response would be
> appreciated!
> 
> Is there something special that needs to be done in order to select text
> pasted
> into a gtkentry from the clipboard?  I am unable to do so using the code
> below.
> If I comment out the gtk_editable_paste_clipboard() line below and insert a
> gtk_entry_set_text() line, I can select/highlight the constant character
> string
> used in gtk_entry_set_text().  Can anybody figure out what I'm doing wrong?
> Does anyone know if this is a bug in gtk?  Thanks in advance to those who
> respond.
> 
> 
> 
> 				-- Stupid Genius
> 
> 
> /* Creating entry widget to input search string */
> entry = gtk_entry_new();
> gtk_signal_connect(GTK_OBJECT(entry), "activate",
> 			GTK_SIGNAL_FUNC(find_string), GTK_WIDGET(entry));
> gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(entry), FALSE, FALSE, 0);
> gtk_editable_paste_clipboard(GTK_EDITABLE(GTK_ENTRY(entry)));
> gtk_editable_select_region(GTK_EDITABLE(GTK_ENTRY(entry)), (gint) 0, (gint)
> -1);
> gtk_widget_show(entry);
> 
> 
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> 




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