WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-30-2011, 10:29 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
If you plan on upgrading to Vizard 4, you can use the vizinput module to display file open/save dialogs:
Code:
import vizinput
filename = vizinput.fileOpen()
filename = vizinput.fileSave()
If you need code that works with Vizard 3, then you can use the win32gui module that comes with Vizard:
Code:
import win32gui
import win32con
import pywintypes

def OpenFileDialog():
	try:
		value = win32gui.GetOpenFileNameW(
				hwndOwner = viz.window.getHandle(),
				InitialDir = '',
				Flags = win32con.OFN_EXPLORER|win32con.OFN_FILEMUSTEXIST|win32con.OFN_NOCHANGEDIR,
				File = '',
				Filter = '' )
	except pywintypes.error:
		return ''
	else:
		return value[0]

def SaveFileDialog():
	try:
		value = win32gui.GetSaveFileNameW(
				hwndOwner = viz.window.getHandle(),
				InitialDir = '',
				Flags = win32con.OFN_EXPLORER|win32con.OFN_NOCHANGEDIR,
				File = '',
				Filter = '' )
	except pywintypes.error:
		return ''
	else:
		return value[0]
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:44 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC