Skip navigation
_ionone_
Currently Being Moderated

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

Jul 16, 2013 6:24 AM

Tags: #file #chooser #filechooser

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

 
Replies
  • Currently Being Moderated
    Jul 16, 2013 8:59 AM   in reply to _ionone_

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

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 17, 2013 2:13 AM   in reply to Ilya Varaev

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 18, 2013 9:06 AM   in reply to ion_one

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 19, 2013 2:07 PM   in reply to ion_one

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 19, 2013 2:11 PM   in reply to Ilya Varaev

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 19, 2013 2:22 PM   in reply to Shmoopie99

    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.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points