Re: SelectionNotify and GtkText, etc...




Mike Benham <moxie@vivid.net> writes:

> 	Well, I am writing an application that needs to paste selections
> without clients having asked for them.  For some reason I just assumed
> that everyone would have written their widgets as "event driven" so that
> they did not actually know the difference between receiving a
> SelectionNotify, or receiving a SelectionNotify after having called
> XConvertSelection().  I just envisioned everything having a case for that
> event, regardless.  Upon testing I noticed that some clients accept random
> SelectionNotify events while most don't.  rxvt handles the situation like
> I want it to, gtk and xterm don't.  (Actually, I think xterm still uses
> cut buffers or something)

Actually, XTerm does support the current selection mechanism in addition to
cut buffers - otherwise you wouldn't be able to paste from GTK+
in xterm.

>   I suppose you are correct, upon further
> inspection, ICCCM doesn't seem to imply that receiving random
> SelectionNotify events is called for.
> 	So I guess my new question is, how would I go about hacking this
> functionality?  When does GtkText call XConvertSelection()?  I can't seem
> to make it call XConvertSelection() by sending it a button2 XButtonEvent.

It should work, assuming that you send the event ot the right subwindow.
(see gtk_text_button_press.)

If you want to do it external to the application, then this is about
the only way you are going to be able to do it, unless the app has
an application-specific control interface. 

I'm still quite unable to imagine your application, so making other
suggestions is beyond me at this point. 

Regards,
                                        Owen



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