Copy link to clipboard
Copied
Hi
i'd like to create a filechooser button to load/save but inside the plugin window. Is it possible ? if yes how can i do that ?
and i need the algorithm to be Mac/Windows compatible if possible
thanks a lot
*best regards*
Jeff
Copy link to clipboard
Copied
If by the "plugin window" you mean the dialog an automation or a filter plugin from the SDK sample code opens for you, you have to write platform-specific code using either Cocoa on Mac or regular WinAPI on Windows (e.g. by hooking GetOpenFileName()/GetSaveFileName() functions to a button you will add to the resource file or create dynamically). Take a look at any plugin that has a GUI (e.g. the Dissolve plugin) and you'll see that the GUI code is entirely platform-specific as there is no platform-independed GUI framework bundled with Photoshop anymore.
Another option is to use some third-party cross-platform library such as Qt, but if you just need a couple of buttons and file selection dialogs it's probably not worth the trouble,.
Copy link to clipboard
Copied
thanks you very much
i looked and found GTK+ also but it's written in C (i know there is a c++ wrapper but) also i need a gradient selector so i think QT is the right choice.
thanks a lot
Jeff
Copy link to clipboard
Copied
Hi again
I've tried to make Qt working. I managed to get it compiled without errors but when i try to call the new window (a very basic one) Photoshop crashes.
I have no idea where to go now.
please help me!
Jeff
Copy link to clipboard
Copied
A couple of hints:
1. Instantiate QAppilcation before showing the GUI and delete right after, before passing control back to PS. Maintaining a persistent Qt application that doesn't interfere with Photoshop is doable, but it involves some additional work
2. On PC do properly parent all your modal dialogs off QWinWidget created with HWND of PS's main application window
Copy link to clipboard
Copied
I've never gotten a Qt based dialog to work properly on Mac - there are too many collisions with PS's own Cocoa stuff.
I ended up shelling out to an external QApplication-based dialog and that works fine.
Copy link to clipboard
Copied
Shmoopie99, if you make sure QAppliation is instantiated and killed 'on demand', running it inside a PS plugin on Mac should be relatively straightforward. The persistancy is indeed a bigger fish to fry.