Re: [Pyobjc-dev] Using global functions and constants?
Brought to you by:
ronaldoussoren
|
From: Michael M. <mic...@gm...> - 2008-02-03 01:17:40
|
Hi, I just found this in an email from Bob Ippolito a while back. (at http://www.mail-archive.com/pyt...@py.../msg02013.html ) Try using objc.loadBundleFunctions. if IOBluetoothNSStringToDeviceAddress is pretty simple, that might work. Here's the example from the email: bundle = NSBundle.bundleWithPath_('/System/Library/Frameworks/Carbon.framework') objc.loadBundleFunctions(bundle, globals(), ( ('SetSystemUIMode', 'III', " Sets the presentation mode for system-provided user interface elements."), )) On Feb 2, 2008 3:14 PM, Orestis Markou <or...@or...> wrote: > Hello, > > I'm trying to use IOBluetooth and IOBluetoothUI. I've figured out > using the Obj-C part (using objc.loadBundle) but IOBluetooth uses some > external functions, like IOBluetoothNSStringToDeviceAddress in > IOBluetoothUtilities. I can't find a way to use this. > > I've tried using gen_bridge_metadata but I get a compiler error. > Checking, I've seen that there is a IOBluetooth.bridgesupport file > inside the framework resources but it doesn't contain the above > function. After looking around, I've tried using a constant it *does* > contain, ie kBluetoothFeatureEncryption, but Python still can't find it. > > I'm using: > > import objc as _objc > > _objc.loadBundle('IOBluetooth', globals(), > bundle_path=u'/System/Library/Frameworks/IOBluetooth.framework') > > in IOBluetooth.py and > > from IOBluetooth import * > > in my main class. > > The documentation on wrapping global functions/constants is *severely* > lacking, so any help appreciated :) > -- > Orestis Markou > or...@or... > http://orestis.gr/ > > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > -- Michael McCracken UCSD CSE PhD Candidate research: http://www.cse.ucsd.edu/~mmccrack/ misc: http://michael-mccracken.net/wp/ |