Re: Writing application without Interface Builder
Re: Writing application without Interface Builder
- Subject: Re: Writing application without Interface Builder
- From: Christian Stieber <email@hidden>
- Date: Tue, 18 Jul 2006 11:48:45 +0200
At 21:00 17.07.2006 -0500, Patrick Hartling wrote:
I am experimenting with writing a Cocoa application without using Interface
Builder
It's pretty messy, but can be done. My software works
completely without the IB crap.
stuck setting up the application menu. It seems as though a default
application menu is being created somewhere, but I cannot get access to it
Menus are one of the things that I haven't quite figured out yet;
what I do now is to load a "Dummy.nib" with the menu during startup,
and just edit that one. As of now it merely localizes the entries in
there, but I hope I can also add my own menus when I need some.
In main:
...
[WTG_Framework_Application sharedApplication];
[NSBundle loadNibNamed:@"Dummy" owner:NSApp];
InitMenu([NSApp mainMenu]);
...
I'm pretty sure that there must be a better way to do menus...
but Cocoa docs are generally very bad, and Apple assuming
that everyone can/wants to use IB doesn't exactly improve
things. So for now I'm happy when I get something to work
at all, worrying about such "minor" issues when I stumble
across the correct solution.
I did try various hacks with the menus, but I never got things
to work properly: either no menus at all, the correct emnu
in the menu bar and no menu in the taskbar, the correct menu
in the taskbar and no menu in the titlebar, a messed up menu
in the titlebar, inaccessible menu in the titlebar... you name
it, I got it all at some point. But so far, loading a menu from
a nib was the only way I ever got a menu to work properly.
Other problems: when I run the application from gdb, it doesn't
properly connect to the GUI --- I can click buttons and stuff,
but text entry fields don't work, and I'm not getting the icon
in the taskbar. Things work fine when run from the Desktop,
though, so that's another "customers won't see it" case .-)
Christian
_______________________________________________
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