UI/WebView.py
 
 
 
UI/WebView.py
# Copyright 2012 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.
#
# Script description:
# Create a tool with a FBWebView showing the Autodesk web page
#
# Topic: FBWebView
#

from pyfbsdk import *
from pyfbsdk_additions import *

def CreateTool():    
    # Tool creation will serve as the hub for all other controls
    t = FBCreateUniqueTool("WebView Example")

    t.StartSizeX = 1024
    t.StartSizeY = 500

    WebView = FBWebView()
    
    x = FBAddRegionParam(0,FBAttachType.kFBAttachLeft,"")
    y = FBAddRegionParam(0,FBAttachType.kFBAttachTop,"")
    w = FBAddRegionParam(0,FBAttachType.kFBAttachRight,"")
    h = FBAddRegionParam(0,FBAttachType.kFBAttachBottom,"")
    
    t.AddRegion("WebView","WebView", x, y, w, h)
    
    t.SetControl("WebView",WebView)

    ShowTool(t)

    WebView.Load("http://www.autodesk.com")

CreateTool()