selected text...



i'm trying to get selected text from an xterm
to be inserted into an entry widget. of course
i can middle click and paste, so i went to that 
part of the gtk code to see how the middle click
paste was accomplished. i can get the text to 
appear in the entry box, but it doesn't get
returned by gtk_entry_get_text. any ideas?
what am i missing here? if there is a way to
get selected text directly into some pointer
i'd really rather have that.

thanks.
brent

nasty code below...


	
	strcpy( before_paste, gtk_entry_get_text( GTK_ENTRY( entry ) ) );
	// before_paste has value
	gtk_entry_set_text( GTK_ENTRY( entry ), "" );
	gtk_selection_convert( GTK_WIDGET( entry ), 
		GDK_SELECTION_PRIMARY,
		gdk_atom_intern( "COMPOUND_TEXT", FALSE ),
		CurrentTime );
	gtk_editable_paste_clipboard( GTK_EDITABLE( entry ));
	
	strcpy( after_paste, gtk_entry_get_text( GTK_ENTRY( entry ) ) );
	//after_paste has no value
	do_something_with( after_paste );



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