[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Painting an image in Eclipse plugin

Hi All,

I needed a help in getting the right widget-window where I can paint an image (using XPutImage on X). Now, what I have is a "handle" from eclipse port onto Linux and my plugin to eclipse has this "handle" from eclipse.

On Windows, I see that this handle actually is HWND and on Mac its HIViewRef.

However on Linux, I found that this is actually a pointer to GtkWidget.

Now, in my plugin case, this pointer actually points to window which has many widgets and one of them happens to be the window where I need to paint my image.

I was trying to find out the right widget by using gtk_widget_get_ancestor(widget, <TYPE>)

However the issue is there are plenty of types which I could try and find out whether we have such a type or not.

Is there a elegant way of doing this ? Something like:

GtkWidget *mywidget = (GtkWidget *) handle;
mywindow = <Search for all widgets to get the right type> (mywidget);
myXwin = mywindow->window;
display = GDK_WINDOW_XDISPLAY(myXwin);
screen = DefaultScreen(display);
XPutImage (display, window, .... <image created>);

So, how do I search for widgets housed within the widget given by eclispe handle and find the right window ?

Thanks for any quick help.
Regards
Prakash