Re: Authorization Plug-in with GUI
Re: Authorization Plug-in with GUI
- Subject: Re: Authorization Plug-in with GUI
- From: Damien Bobillot <email@hidden>
- Date: Thu, 16 Feb 2006 12:00:21 +0100
Markus Hanauska wrote :
I'm currently reading the documentation for the Authorization Plug-
in. I'd like to write one that kicks in during login process before
the actual log-in window appears (for Tiger only).
So far I understood everything I have to do with /etc/authorization
and how to write a plug-in itself (thanks to the NullAuth Plug-in
code example). The problem is, my plug-in has to display a GUI and
it would be great if that's Cocoa using NIB files, not
programatically using Carbon.
However, I don't understand how to do this. When my functions are
called, I don't know from which thread and which context. Am I
within a Cocoa context or just a C context. AFAIK the Cocoa tools
only work if the event handler is thread 0 (trying to create an app
and runloop in another thread gets you nowhere).
So I tried just loading my NIB with a subclassed controller, not
working. So how would I go about creating a GUI? Is there any
trick? Does Apple has any source code showing an Authorization Plug-
in with GUI?
Your plugin is launch from a Carbon application, so there's already a
UI loop. I've never wrote authorization plugins, but I have some
experience in using cocoa in a plugin of a carbon app :
- you must call NSApplicationLoad() to initialize the AppKit
environment.
- you may then load a cocoa nib, and create cocoa windows
- the carbon event loop of the hosting application will treat events
in cocoa windows, so you don't need to (and you mustn't) create your
own UI event loop.
- you can't add cocoa views to carbon windows, and carbon views to
cocoa windows.
More information :
http://developer.apple.com/documentation/Cocoa/Conceptual/
CarbonCocoaDoc/index.html
--
Damien Bobillot
_______________________________________________
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