Louis wrote:
>> Yes, it is possible. Make sure that your app is in a bundle. If you
>> have a correct bundle, you call fl_open_callback() with a function
>> that will handle all drop operations onto the application icon.
>>
> Uhm in a bundle? Do you mean in a app bundle directory?
> The application is in a .app directory, i can open the programm with double 
> click.
> The info.plist content is:
> <?xml version="1.0" encoding="UTF-8"?>
> <plist version="0.9">
>     <dict>
>       <key>CFBundleInfoDictionaryVersion</key>
>       <string>6.0</string>
>       <key>CFBundleExecutable</key>
>       <string>fedit</string>
>       <key>CFBundleIdentifier</key>
>       <string>org.fltk.fedit</string>
>       <key>CFBundleName</key>
>       <string>fedit</string>
>       <key>CFBundlePackageType</key>
>       <string>APPL</string>
>     </dict>
> </plist>
> 
> If I drag a file onto the application and release the mouse button the file 
> moves back to its original location.
> The application name also does not get bold like the textedit name if a file 
> is dragged onto it.

You need to declare the file types your app can handle. For example, if 
your app can display .txt and .dat files and edit .dat files, you could add

<key>CFBundleDocumentTypes</key>
   <array>
     <dict>
       <key>CFBundleTypeExtensions</key>
         <array>
           <string>txt</string>
           <string>dat</string>
         </array>
       <key>CFBundleTypeName</key><string>MyApp Data File</string>
       <key>CFBundleTypeRole</key><string>Viewer</string>
     </dict>
     <dict>
       <key>CFBundleTypeExtensions</key>
         <array>
           <string>dat</string>
         </array>
       <key>CFBundleTypeName</key><string>MyApp Data File</string> 

       <key>CFBundleTypeRole</key><string>Editor</string>
     </dict>
   </array>

in your plist. You could also provide additional info like specific 
icons for each file type, use a CFBundleOSType instead of a file 
extension, etc.

--Christophe
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to