Distributed GUI
Distributed GUI
- Subject: Distributed GUI
- From: Miroslav Prymek <email@hidden>
- Date: Sun, 30 Sep 2007 10:17:02 +0200
Hello,
I want to develop an application which GUI will consist of
distributed objects.
I get unintended results - what am I doing wrong?
--------------------------------------- code snips:
***** client:
- (byref id) aquaView {
if (!aquaView) {
aquaView = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0,
300, 20)];
[aquaView setStringValue:@"Distant view! Yupiii!"];
}
return aquaView;
}
***** server (where the view should appear):
id target=[[NSConnection
rootProxyForConnectionWithRegisteredName:toBeAddedName
host:nil] retain];
if (target==nil) {
NSLog(@"Agent '%@' doesn't exist",toBeAddedName);
return nil;
}
// add new tab
NSTabViewItem* tab = [[NSTabViewItem alloc]
initWithIdentifier:toBeAddedName];
[tab setLabel:toBeAddedName];
[view addTabViewItem:tab];
// tab's view should be aquaView of the distant object
id targetView = [target aquaView];
NSLog(@"Target view: %@",targetView);
NSLog(@"Target NSTextField value: %@",[targetView stringValue]);
[tab setView:targetView];
---------------------------------------
When I run the client and the server, I get:
2007-09-30 10:11:13.151 LLDesk[4910] Target view: <NSTextField:
0x3193f0>
2007-09-30 10:11:13.151 LLDesk[4910] Target NSTextField value:
Distant view! Yupiii!
So everything seems OK. But when I click on the newly created tab,
the application simply hangs.
I suppose the whole thing has something to do with notifications and
should be done somehow else, but I don't know how :(
Thanks for any advices, I'm totaly lost :(
M. Prymek
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden