Re: Invisible plug window, embedding event boxes



Andreas Schiffler <aschiffler appwares com> writes:

> Cheers all,
> 
> I am somewhat new to gtk and cannot figure this one out.
> 
> I would like to use gtk tooltips (amongst other things) in my non-Gtk
> application. So what I do is to create a plug widget that is embedded in
> my X window. The I create a tooltip object for tooltip mantenance. Then
> some event boxes which get embedded into the plug widget and are used to
> add the tooltips.
> 
> So far it works fine ... exept that the plug window overdraws my
> application window as a black box. 
> 
> Is there a way to make the plug window invisible while allowing it to
> receive events? Or simply to inhibit it beeing drawn (so it appears
> invisible)? 
> 
> It seems to me I just need to prevent the draw event from getting
> through. Is there a way to set the event mask for the plug window to do
> that?
> 
> Is there another way would be not to use the plug window, but to embed
> the event boxes directly into my existing window. Can that be done?

I think your best bet would be simply to cut-and-paste the relevant
portions of gtktooltips.c and decide yourself when and where to pop up
the tooltip - the actual code involved in drawing the tooltip is
much less code and much less complicated code than trying to figure
out how to use the standard GtkTooltips to pop up a tip on a non-GTK+
window.

(The problem is that window in X are either InputOnly or InputOutput;
to hold visible widgets, GtkPlug needs to be InputOutput, but
then it will have a backgound and draw as a square on top of your
application. GtkPlug/GtkSocket integrate deeply into the structure
of GTK+ so creating a modified GtkPlug is much harder than copying
the tooltips code.)

Regards,
                                        Owen



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