Re: adding NSView from other application
Re: adding NSView from other application
- Subject: Re: adding NSView from other application
- From: Dmitry Markman <email@hidden>
- Date: Wed, 30 Mar 2005 18:52:46 -0500
thanks a lot for your answer
just to clarify
it's not my application
just someone ask me to think about that
he said that it works fine for windows and linux
here is a fragment of the code for a2 application (receiver)
linux:
int javaXId = atoi(mMsgString);
NS_ASSERTION(javaXId, "Invalid X window handle\n");
pBrowser = g_new0(GtkBrowser, 1);
pBrowser->topLevelWindow = gtk_plug_new(javaXId);
and windows
HWND hWnd = (HWND) atoi(mMsgString);
pBrowserWnd = new BrowserWindow();
if (!pBrowserWnd)
break;
SetRect(&rect, 0, 0, 0, 0);
HWND hWndClient = pBrowserWnd->Create(hWnd,rect,
_T("about:blank"),
WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL |
WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
WS_EX_CLIENTEDGE);
where mMsgString is a string received from application a1 (via TCP/IP
for example)
and it contains address of widget created by a1
so they wanted to do the same thing on mac os x
thanks again
On Mar 30, 2005, at 4:20 PM, Ondra Cada wrote:
Dmitry,
On 30.3.2005, at 22:52, Dmitry Markman wrote:
I'd like to clarify some issue
Well, it's not that simple.
in general we can formulate problem as following:
1. there are 2 applications a1 and a2
2. a1 application creates NSView and send address of that NSView to
a2 application (via TCP/IP protocol for example)
3. a2 application create NSView and attempts to add that new NSView
to the NSView that a1 application created
I think it's impossible on the Macintosh,
It is not general enough. Exactly as formulated, it truly is not
possible with any system which uses virtual address space. And that, I
believe, is just anything these days, even, IIRC, the Symbian of
mobile phones does that :))
but I'd like to know for sure and reasons (if it's impossible)
There are possibilities though to get precisely the functionality (I
think) you want. First, you can get it almost for free with
distributed objects: through them, you can access any object remotely,
and you even should be able to vend the NSView in question bycopy
(never tried myself).
Besides, without knowing the applications design one can't be sure,
but it smells to me suspicious: do you really want to *create* the
view in one and *send the view* to another? (No offence meant, perhaps
your design is excellent, just I wonder...)
You seldom enough create views programmatically: some, I daresay,
99.9% of tasks are better solved using NIBs -- and of course, you can
load one application's NIB into another app any time (presumed there
are proper access rights, of course).
Also, the idea of creating a view and moving it into a different
environment sounds suspicious too: don't you perchance rather want to
share/send the *data* which control the view creation, and -- possibly
-- to share a bundle/framework with the code which crates the view
based on the data?
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
Dmitry Markman
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden