Re: [Gtk-osx-users] Info.plist and gtk_osxapplication_get_bundle_id()

On Jul 8, 2010, at 11:54 AM, Richard Procter wrote:

> Hi there,
> I tried using gtk_osxapplication_get_bundle_id() today to determine  
> at runtime if the code was running in a bundle, however it insisted  
> on returning None (this is from python) despite my best efforts.
> I have what appears to be a valid Info.plist file in my $ 
> {BUNDLE_ROOT}/Contents directory, containing
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http:// 
> dtd">
> <plist version="1.0">
> <dict>
> [...]
>     <key>CFBundleIdentifier</key>
>     <string>org.gtk.demo</string>
> The call is indifferent to its ordering with respect to  
> OSXApplication.ready().
> I am running the bundle from the finder.
> Interestingly, gtk_osxapplication_get_resource_path() is returning $ 
> {BUNDLE_ROOT}/Contents/Resources/bin whether the .plist file is  
> present or not, which suggests to me that OS X might not believe it  
> is running a bundle, or is finding something wrong with Info.plist,  
> or something else again (perhaps the pygtk example bootstrap script I  
> am using is confusing it somehow, or...?).
> Does anyone know of any gotchas I should be aware of here? Is there a  
> working python example I could look at?

Have a look at; and
 there are some possibilities listed there.

get_resource_path works whether there's a bundle or not -- and seems to give the right answer-- which can be very convenient.

John Ralls

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]