Re: Loading the X selection (e.g. Edit, Copy)

From: Date: Mon, 07 Jun 2004 22:47:11 +0000
Subject: Re: Loading the X selection (e.g. Edit, Copy)
References: 1 2 3 4  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-4631@lists.php.net to get a copy of this message
On Tue, Jun 01, 2004 at 08:22:13AM +0300, Cosmin wrote: > You can put it in a hidden entry and the copy it to the clipboard > Something like this: > $entry = &new GtkEntry(); > $entry->hide(); > $entry->set_text('my text'); > $entry->select_region(0, -1); //this selects the whole text > $entry->copy_clipboard(); This works up to 2047 bytes. If the text in set_text() exceeds that length, it is truncated to 2047 bytes. I note that the apparent limit is one off a power of two. Guess 1: GtkEntry cannot take more than 2047 bytes. Guess 2: cut and paste needs the widget to be managed by an X window. -- James Cameron mailto:quozl@us.netrek.org http://quozl.netrek.org/

« previous php.gtk.general (#4631) next »