[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Hosting SWT windows inside a WIN32 app

Actually it is what I'm trying to do. Let me give some more details. The current application is built using a development tool called NatStar which has it's own wrapper over windows API. It is designed for N-tier apps and generates C code for the target platform. We use it on windows so it is rougly the same as talking about a C MDI App.

Using a DLL in C and JNI, we are able to create SWT java windows. Since constructing a composite requires a parent composite, I guess this is where some of the low level hacking occurs? From what I get of your last post, it seems to we it would be a lot of pain to get this to work? I don't suppose it's been done before?


Steve Northover wrote:

Windows MDI is a real mess, even for C programmers.  MDI is not supported by
SWT because it only occurs on Windows and is not portable.

If you really need Windows MDI, you might be better off leaving that part in
C and embedding SWT composites inside C based MDI parents.  This may require
modifications to the SWT event loop and other low level hacks to the toolkit
to get it to work.

"Yannick Grosjean" <rickkhunter@xxxxxxxxxxx> wrote in message
news:9bc963ed116964571994583f4d96c228$1@xxxxxxxxxxxxxxxxxx
actually I was indeed meanin MDI Child... I've been trying this morning
with decorations since they are said to be providing the functionality of
shells without being top windows, alas, without too much success.

Another way to put my problem would be to picture a very large WIN32 MDI
application, with many types of MDI Children, that I want to gradually
replace with SWT children, ultimately creating an MDI parent in SWT

Steve Northover wrote:

> Yes, if you mean "dialog child", then use the constructor "new Shell
> (Shell)".  If you mean "MDI child", then this is not supported in SWT.

> I'm not sure what the original problem is. It should be easy enough to
mix
> SWT and native code.  Can you give a better description, or even better,
> some I can run code?

> "Yannick Grosjean" <rickkhunter@xxxxxxxxxxx> wrote in message
> news:faaeedb3bcfbe1d1697ab6254a5cb47e$1@xxxxxxxxxxxxxxxxxx
>> Here's an interresting challenge.
>>
>> As part of the migration process of porting our application from win32
to
>> java/SWT, it is a requierement that the migration be done
progressively.
>> In other words, the main window of the application will remain  win32
>> while we gradually re-write the child windows with SWT.
>>
>> Our current approach is to contain SWT shells by first creating them,
then
>> using their window handles and the SetParent WIN32 function to attach
them
>> to our application. So far all seemed well but when the newly created
SWT
>> window has the focus, the main window loses it.
>>
>> From what I can tell, it's because the Shell object is by default
created
>> as a main window. My question is this, is there a way to create a SWT
>> shell that would be a child to a WIN32 main window?
>>
>> I have tried several things, but I can't seem to find a way to
construct a
>> Shell  and giving it a WIN32 window handle as a parent.
>>
>> Is there a way to do that? or to do something that would do the
> equivalent?
>>
>> Yannick Grosjean
>> Solutuons JetSoft
>>