UI/FBFolderPopup.py

UI/FBFolderPopup.py
1 # Copyright 2009 Autodesk, Inc. All rights reserved.
2 # Use of this software is subject to the terms of the Autodesk license agreement
3 # provided at the time of installation or download, or which otherwise accompanies
4 # this software in either electronic or hard copy form.
5 #
6 # Topic: FBFolderPopup, FBFilePopupStyle
7 #
8 
9 from pyfbsdk import FBFolderPopup, FBFilePopupStyle, FBMessageBox
10 
11 # Create the popup and set necessary initial values.
12 lFp = FBFolderPopup()
13 lFp.Caption = "FBFolderPopup example: Select a folder"
14 
15 # Set the default path. Good for a PC only... will have to be different for Mac.
16 lFp.Path = r"C:\Program Files"
17 
18 # Get the GUI to show.
19 lRes = lFp.Execute()
20 
21 # If we select a folder, show its name, otherwise indicate that the selection was canceled.
22 if lRes:
23  FBMessageBox( "FBFolderPopup example", "Selected folder:\n Path: '%s'" % lFp.Path, "OK" )
24 else:
25  FBMessageBox( "FBFolderPopup example", "Selection canceled", "OK" )
26 
27 # Cleanup
28 del( lFp, lRes, FBFolderPopup, FBFilePopupStyle, FBMessageBox )