Python Reference Guide
 
Loading...
Searching...
No Matches
UI\FBFilePopup.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: FBFilePopup, FBFilePopupStyle
7#
8
9from pyfbsdk import FBFilePopup, FBFilePopupStyle, FBMessageBox
10
11# Create the popup and set necessary initial values.
12lFp = FBFilePopup()
13lFp.Caption = "FBFilePopup example: Select a file"
14lFp.Style = FBFilePopupStyle.kFBFilePopupOpen
15
16# BUG: If we do not set the filter, we will have an exception.
17lFp.Filter = "*"
18
19# Set the default path.
20lFp.Path = r"C:\Program Files"
21
22# Get the GUI to show.
23lRes = lFp.Execute()
24
25# If we select files, show them, otherwise indicate that the selection was canceled.
26if lRes:
27 FBMessageBox( "FBFilePopup example", "Selected file:\n Name: '%s'\n Path: '%s'" % ( lFp.FileName, lFp.Path ), "OK", None, None )
28else:
29 FBMessageBox( "FBFilePopup example", "Selection canceled", "OK", None, None )
30
31# Cleanup.
32del( lFp, lRes, FBFilePopup, FBFilePopupStyle, FBMessageBox )
File Popup (for open/save).
Definition: pyfbsdk_generated.h:7765
int FBMessageBox(str pBoxTitle, str pMessage, str pButton1Str, str pButton2Str=None, str pButton3Str=None, int pDefaultButton=0, int pScrolledMessage=0)
Dialog popup box.