NSSavePanel default file type

  • Hi list

    Our app allows to export its documents in a variety of formats, such as jpeg, tiff, png, pdf . Hence, we have set up the NSSavePanel to sport a file types popup that allows the user to select the desired file type.

    Now we want that save panel to remember the format of the last export operation that the user made. For example, when the user exported the last document as a pdf, the next time he selects the Export command the popup should default to the pdf format. I have found no way, however, to set the item that is selected in that popup by default. It always defaults to the first format.

    So, how can I set the item in the popup that is initially selected when the save panel comes up?

    Any advice is welcome

    Best regards

    Kurt Sutter
  • > Our app allows to export its documents in a variety of formats, such as jpeg, tiff, png, pdf . Hence, we have set up the NSSavePanel to sport a file types popup that allows the user to select the desired file type.
    ...
    > So, how can I set the item in the popup that is initially selected when the save panel comes up?

    Can't you just call methods on the NSPopUpButton you're setting as the accessory view? Ideally probably in response to -[NSDocument prepareSavePanel:]

    ~Martin
  • I could, if there were an official api to get that NSPopUpButton. Is there? I did not find one.

    Kurt

    On 12. Jun 2012, at 23:15, Martin Wierschin wrote:

    >> Our app allows to export its documents in a variety of formats, such as jpeg, tiff, png, pdf . Hence, we have set up the NSSavePanel to sport a file types popup that allows the user to select the desired file type.
    > ...
    >> So, how can I set the item in the popup that is initially selected when the save panel comes up?
    >
    > Can't you just call methods on the NSPopUpButton you're setting as the accessory view? Ideally probably in response to -[NSDocument prepareSavePanel:]
    >
    > ~Martin
    >
    >
  • Are you using a pre-built export dialog or a standard save dialog with a custom accessory view? Sounds like you need to use a custom accessory view, although this would most likely require you to code all the export features.

    Todd

    On Jun 12, 2012, at 10:11 PM, Kurt Sutter wrote:

    > I could, if there were an official api to get that NSPopUpButton. Is there? I did not find one.
    >
    > Kurt
    >
    > On 12. Jun 2012, at 23:15, Martin Wierschin wrote:
    >
    >>> Our app allows to export its documents in a variety of formats, such as jpeg, tiff, png, pdf . Hence, we have set up the NSSavePanel to sport a file types popup that allows the user to select the desired file type.
    >> ...
    >>> So, how can I set the item in the popup that is initially selected when the save panel comes up?
    >>
    >> Can't you just call methods on the NSPopUpButton you're setting as the accessory view? Ideally probably in response to -[NSDocument prepareSavePanel:]
    >>
    >> ~Martin
    >>
    >>

    >
    > ______________________________________________________________________
    > This email has been scanned by the Symantec Email Security.cloud service.
    > For more information please visit http://www.symanteccloud.com
    > ______________________________________________________________________
    >

    ______________________________________________________________________
    This email has been scanned by the Symantec Email Security.cloud service.
    For more information please visit http://www.symanteccloud.com
    ______________________________________________________________________
  • I have a save panel with a custom accessory view, but the file type popup is created by NSSavePanel

    If I had an offiacial way to get the NSPopUpButton I could send it a message to select the right item. Is there a way to get that button object?

    >
    >
    > Are you using a pre-built export dialog or a standard save dialog with a custom accessory view? Sounds like you need to use a custom accessory view, although this would most likely require you to code all the export features.
    >
    > Todd
    >
    >
    > On Jun 12, 2012, at 10:11 PM, Kurt Sutter wrote:
    >
    >> I could, if there were an official api to get that NSPopUpButton. Is there? I did not find one.
    >>
    >> Kurt
    >>
    >> On 12. Jun 2012, at 23:15, Martin Wierschin wrote:
    >>
    >>>> Our app allows to export its documents in a variety of formats, such as jpeg, tiff, png, pdf . Hence, we have set up the NSSavePanel to sport a file types popup that allows the user to select the desired file type.
    >>> ...
    >>>> So, how can I set the item in the popup that is initially selected when the save panel comes up?
    >>>
    >>> Can't you just call methods on the NSPopUpButton you're setting as the accessory view? Ideally probably in response to -[NSDocument prepareSavePanel:]
    >>>
    >>> ~Martin
    >>>
    >>>
    >>
    >>
    >> _______________________________________________
    >>
    >>
previous month june 2012 next month
MTWTFSS
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  
Go to today