• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How can i create a filechooser button inside the plugin window?

New Here ,
Jul 16, 2013 Jul 16, 2013

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

TOPICS
SDK

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Contributor ,
Jul 16, 2013 Jul 16, 2013

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,.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 17, 2013 Jul 17, 2013

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 18, 2013 Jul 18, 2013

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 19, 2013 Jul 19, 2013

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 19, 2013 Jul 19, 2013

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 19, 2013 Jul 19, 2013

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines