[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.platform.swt] Re: Use handle passed from Java to Native...
|
Thank you very much for your response. I greatly appreciate it!
Steve Northover wrote:
> Not sure exactly which handle you want or what you are trying to do.
> Obviously, you needed C code on Windows to do it and you needed the HWND of
> the shell which you were able to find. On Motif, I don't know exaclty what
> X/Xt/Xm handle you are after but if you pass in the handle of a Shell, this
> is an Xt Widget and you can use XtParent() to repeatedly get the parent of
> the handle until you see an Xt Widget that is the handle of the
> TopLevelShell. Use XtIsSubclass() to test each parent until you find one
> that is "shellWidgetClass". At this point, you will have the Xt Widget that
> represents the shell. If you need the X window, call XtWindow().
> All of this is done in platform specific C code and none of this really has
> anything to do with SWT.
> "Greg Roberts" <gwrobert@xxxxxxxxxx> wrote in message
> news:b9ts97$dpv$1@xxxxxxxxxxxxxxxx
> > I can do that, get the parents - but that again returns a Widget (int
> > value/pointer) and that is where my problem is. I don't know what I am
> > able to do with that value that will allow me to get a hold of the actual
> > Widget, or determine type or whatever. I am probably sounding really
> > stupid but this is my first experience using this and am having a
> > difficult time grasping it. Hopefully I am making some sort of sense as to
> > what my problem is. I have the Widget (passed in) that is a window and I
> > want to be able to do stuff to that window. What do I need to do with the
> > value I have to get to work on the actual component?
> >
> > thank you for the previous answer.
> >
> >
> > Steve Northover wrote:
> >
> > > Use XtParent() in the C code to climb up the parent chain until you see
> a
> > > TopLevelShell.
> >
> > > "Greg Roberts" <gwrobert@xxxxxxxxxx> wrote in message
> > > news:b9thjl$1ko$1@xxxxxxxxxxxxxxxx
> > > > We are writing an eclipse plug-in that is going to allow us to
> lock-down
> > > > our desktop window. In the Java code I am getting all of the workbench
> > > > windows and then I am grabbing the one I want and calling
> > > > getShell().handle on it. I can pass that handle down to the native
> code
> > > > using JNI and in Windows I can use that handle and cast it to a HWND
> and
> > > > have controll of that window in the native code. In Linux this does
> not
> > > > work. The Shell handle is not the same as the XLib or Motif
> > > > Windows/Widgets. So I am wondering if you know of anyway to use the
> > > > getShell() method from the org.eclipse.swt.widgets.shell class so that
> I
> > > > can pass a handle down to Motif/Xlib and use that to be able to
> control
> > > > the window. Previously I was using Xlib and was getting a handle on
> the
> > > > window by cycling through all windows and looking for the window name.
> > > > That is no longer possible however because we are not going to know
> what
> > > > the window name will be any longer - i18n.
> > > >
> > > > Any assistance would be greatly appreciated.
> > > >
> > > > thank you,
> > > > Greg Roberts
> > > > IBM
> > > > gwrobert@xxxxxxxxxx
> > > >
> >
> >
> >
> >
> >