# Copyright 2009 Autodesk, Inc.  All rights reserved.
# Use of this software is subject to the terms of the Autodesk license agreement 
# provided at the time of installation or download, or which otherwise accompanies
# this software in either electronic or hard copy form.
#
# Topic: FBFolderPopup, FBFilePopupStyle
#

from pyfbsdk import FBFolderPopup, FBFilePopupStyle, FBMessageBox

# Create the popup and set necessary initial values.
lFp = FBFolderPopup()
lFp.Caption = "FBFolderPopup example: Select a folder"

# Set the default path. Good for a PC only... will have to be different for Mac.
lFp.Path = r"C:\Program Files"

# Get the GUI to show.
lRes = lFp.Execute()

# If we select a folder, show its name, otherwise indicate that the selection was canceled.
if lRes:
  FBMessageBox( "FBFolderPopup example", "Selected folder:\n  Path: '%s'" % lFp.Path, "OK" )
else:
  FBMessageBox( "FBFolderPopup example", "Selection canceled", "OK" )

# Cleanup
del( lFp, lRes, FBFolderPopup, FBFilePopupStyle, FBMessageBox )