using SWT within a C++ GUI app [message #442695] |
Sat, 11 September 2004 18:09 |
Eclipse User |
|
|
|
Originally posted by: pault.dessci.com
Hi,
I have a project that consists of a substantial cross-platform (Windows and
Mac) GUI app. I would like to use SWT to define new UI components such as
toolbars and dialogs. In a toy Windows app, I have successfully hosted a
Java Virtual Machine and brought up an SWT window (shell). Before moving to
the next step, I want to see if anyone has any advice or experience with
this kind of thing. For example, if someone can convince me that I'm wasting
my time, that may save me hours of frustration.
I don't think dialogs will be too much of a problem as they contain their
own event dispatch loop. However, a toolbar is a modeless window with
respect to the C++ app so it needs to receive events dispatched from the C++
program's main event loop. I can call display.readAndDispatch from within
the loop but I'm wondering if this will be enough.
Has anyone actually tried anything like this? Any thoughts will be
appreciated.
|
|
|
Re: using SWT within a C++ GUI app [message #442815 is a reply to message #442695] |
Mon, 13 September 2004 23:09 |
Steve Northover Messages: 1636 Registered: July 2009 |
Senior Member |
|
|
Check this newsgroup. There was a guy trying to do a similar thing that ran
into trouble on Mac. There is only one GUI thread on that platform and his
C code needed to be it.
Unless you have a major amount of UI code, you are almost always better off
to stick with one implementation language. Seeing as most of your app is
already written in C, then sticking to C means that among other things,
debugging will be easier. If you wanted to switch to Java, one possiblity
would be to keep the non-UI portions of the code base and call them from
Java, rather than keeping the main program in C. Without knowing what your
app does, it's hard to really comment.
"Paul Topping" <pault@dessci.com> wrote in message
news:chvepd$fq8$1@eclipse.org...
> Hi,
>
> I have a project that consists of a substantial cross-platform (Windows
and
> Mac) GUI app. I would like to use SWT to define new UI components such as
> toolbars and dialogs. In a toy Windows app, I have successfully hosted a
> Java Virtual Machine and brought up an SWT window (shell). Before moving
to
> the next step, I want to see if anyone has any advice or experience with
> this kind of thing. For example, if someone can convince me that I'm
wasting
> my time, that may save me hours of frustration.
>
> I don't think dialogs will be too much of a problem as they contain their
> own event dispatch loop. However, a toolbar is a modeless window with
> respect to the C++ app so it needs to receive events dispatched from the
C++
> program's main event loop. I can call display.readAndDispatch from within
> the loop but I'm wondering if this will be enough.
>
> Has anyone actually tried anything like this? Any thoughts will be
> appreciated.
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02907 seconds