Re: Cut/Copy/Paste Menu Selections



On 28 May 2001 00:51:14 -0500, D. Brian Gosnell wrote:
> 
> On 27 May 2001 13:55:04 -0400, Havoc Pennington wrote:
> > 
> > 
> > Damian Ivereigh <damian cisco com> writes: 
> > > However I would like to also change the "sensitivity" of the menu items
> > > according to various situations. The most obvious example is only making
> > > "paste" sensitive when there is actually something in the clipboard.
> > > 
> > > I have searched around for some way to easily detect if there is
> > > something in the clipboard. However I have found no function or easy way
> > > to do this. Does anyone have any suggestions? Should I just give up?
> > > 
> > 
> > I remember being this impossible but I don't remember all the
> > issues. Owen will know.
> > 
> > You can use XGetSelectionOwner() to see if someone owns the selection
> > (i.e. there's something to paste), but I don't think there's a good
> > way to know whether the available stuff to paste is something you know
> > how to paste. i.e. you can't find out the data types of the stuff on
> > the clipboard (text, image, postscript, Word document) without
> > actually trying to paste. I could be wrong.
> > 
> > Havoc
> > 
> 
> Just throwing around an idea here but couldn't you dump the data in the
> clipboard to a file and then run system("file DATA").  It's a bad hack
> but would seem to get the job done.  I've done worse stuff than this
> dealing with GTKText in GTK1.2.

That's not really a good idea if you have a 20 megs image in the
clipboard.

Cheers

-- 
/Bastien Nocera
http://hadess.net





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