Used TkGlobal instead of Tkinter and Pmw

This commit is contained in:
Mark Mine 2003-07-03 20:04:42 +00:00
parent f12cb81d9d
commit ca6a48e55b
21 changed files with 25 additions and 42 deletions

View File

@ -7,10 +7,8 @@ from DirectSelection import *
from DirectGrid import * from DirectGrid import *
from DirectGeometry import * from DirectGeometry import *
from DirectLights import * from DirectLights import *
from DirectSessionPanel import *
from ClusterClient import * from ClusterClient import *
from ClusterServer import * from ClusterServer import *
from tkSimpleDialog import askstring
import Placer import Placer
import Slider import Slider
import SceneGraphExplorer import SceneGraphExplorer
@ -169,8 +167,8 @@ class DirectSession(PandaObject):
if base.wantTk: if base.wantTk:
import TkGlobal import TkGlobal
self.panel = DirectSessionPanel(parent = tkroot) import DirectSessionPanel
self.panel = DirectSessionPanel.DirectSessionPanel(parent = tkroot)
try: try:
# Has the clusterMode been set externally (i.e. via the # Has the clusterMode been set externally (i.e. via the
# bootstrap application? # bootstrap application?
@ -646,6 +644,7 @@ class DirectSession(PandaObject):
def getAndSetName(self, nodePath): def getAndSetName(self, nodePath):
""" Prompt user for new node path name """ """ Prompt user for new node path name """
from tkSimpleDialog import askstring
newName = askstring('Node Path: ' + nodePath.getName(), newName = askstring('Node Path: ' + nodePath.getName(),
'Enter new name:') 'Enter new name:')
if newName: if newName:

View File

@ -2,14 +2,13 @@ from ShowBaseGlobal import *
from PandaObject import * from PandaObject import *
from PieMenu import * from PieMenu import *
from DirectGuiGlobals import * from DirectGuiGlobals import *
from Tkinter import * from TkGlobal import *
from DirectUtil import * from DirectUtil import *
from DirectGeometry import * from DirectGeometry import *
from SceneGraphExplorer import * from SceneGraphExplorer import *
from tkMessageBox import showinfo from tkMessageBox import showinfo
from tkFileDialog import * from tkFileDialog import *
from whrandom import * from whrandom import *
import Pmw
import Floater import Floater
import VectorWidgets import VectorWidgets
import string import string

View File

@ -1193,6 +1193,7 @@ class ShowBase(DirectObject.DirectObject):
self.wantTk = fWantTk self.wantTk = fWantTk
if self.wantTk: if self.wantTk:
import TkGlobal import TkGlobal
TkGlobal.spawnTkLoop()
def startDirect(self, fWantDirect = 1): def startDirect(self, fWantDirect = 1):
self.wantDirect = fWantDirect self.wantDirect = fWantDirect

View File

@ -1,7 +1,6 @@
from Tkinter import * from Tkinter import *
import sys
import Pmw import Pmw
import sys
# This is required by the ihooks.py module used by Squeeze (used by # This is required by the ihooks.py module used by Squeeze (used by
# pandaSqueezer.py) so that Pmw initializes properly # pandaSqueezer.py) so that Pmw initializes properly
sys.modules['_Pmw'].__name__ = '_Pmw' sys.modules['_Pmw'].__name__ = '_Pmw'
@ -21,7 +20,8 @@ def tkloop(self):
# Get the taskMgr # Get the taskMgr
from TaskManagerGlobal import * from TaskManagerGlobal import *
# Spawn this task def spawnTkLoop():
taskMgr.add(tkloop, "tkloop") # Spawn this task
taskMgr.add(tkloop, "tkloop")

View File

@ -4,9 +4,8 @@
# Import Tkinter, Pmw, and the floater code from this directory tree. # Import Tkinter, Pmw, and the floater code from this directory tree.
from AppShell import * from AppShell import *
from Tkinter import * from TkGlobal import *
from tkSimpleDialog import askfloat from tkSimpleDialog import askfloat
import Pmw
import string import string
import math import math
import types import types

View File

@ -3,9 +3,8 @@
# Import Tkinter, Pmw, and the dial code # Import Tkinter, Pmw, and the dial code
from PandaObject import * from PandaObject import *
from AppShell import * from AppShell import *
from Tkinter import * from TkGlobal import *
import string import string
import Pmw
import Dial import Dial
import Floater import Floater
import Slider import Slider

View File

@ -1,9 +1,8 @@
""" Finite State Machine Inspector module """ """ Finite State Machine Inspector module """
from PandaObject import * from PandaObject import *
from AppShell import * from AppShell import *
from Tkinter import * from TkGlobal import *
from tkSimpleDialog import askstring from tkSimpleDialog import askstring
import Pmw
import math import math
import operator import operator

View File

@ -4,9 +4,7 @@
### so that I can just type: inspect(anObject) any time. ### so that I can just type: inspect(anObject) any time.
import string import string
from Tkinter import *
from TkGlobal import * from TkGlobal import *
import Pmw
### public API ### public API

View File

@ -2,7 +2,7 @@
# Import Tkinter, Pmw, and the dial code from this directory tree. # Import Tkinter, Pmw, and the dial code from this directory tree.
from PandaObject import * from PandaObject import *
from Tkinter import * from TkGlobal import *
from AppShell import * from AppShell import *
from DirectGlobals import * from DirectGlobals import *
from DirectUtil import * from DirectUtil import *
@ -11,7 +11,6 @@ from DirectSelection import *
from tkFileDialog import * from tkFileDialog import *
import os import os
import string import string
import Pmw
import Dial import Dial
import Floater import Floater
import Slider import Slider

View File

@ -2,11 +2,10 @@
# Import Tkinter, Pmw, and the floater code from this directory tree. # Import Tkinter, Pmw, and the floater code from this directory tree.
from AppShell import * from AppShell import *
from Tkinter import * from TkGlobal import *
from tkFileDialog import * from tkFileDialog import *
from tkSimpleDialog import askstring from tkSimpleDialog import askstring
import os import os
import Pmw
import Dial import Dial
import Floater import Floater
import Slider import Slider

View File

@ -2,9 +2,8 @@
# Import Tkinter, Pmw, and the dial code from this directory tree. # Import Tkinter, Pmw, and the dial code from this directory tree.
from PandaObject import * from PandaObject import *
from Tkinter import * from TkGlobal import *
from AppShell import * from AppShell import *
import Pmw
import Dial import Dial
import Floater import Floater

View File

@ -2,9 +2,8 @@
Dial Class: Velocity style controller for floating point values with Dial Class: Velocity style controller for floating point values with
a label, entry (validated), and scale a label, entry (validated), and scale
""" """
from Tkinter import * from TkGlobal import *
from Valuator import * from Valuator import *
import Pmw
import Task import Task
import math import math
import string import string

View File

@ -2,8 +2,7 @@
EntryScale Class: Scale with a label, and a linked and validated entry EntryScale Class: Scale with a label, and a linked and validated entry
""" """
from PandaObject import * from PandaObject import *
from Tkinter import * from TkGlobal import *
import Pmw
import string import string
import tkColorChooser import tkColorChooser
from tkSimpleDialog import * from tkSimpleDialog import *

View File

@ -3,9 +3,8 @@ Floater Class: Velocity style controller for floating point values with
a label, entry (validated), and scale a label, entry (validated), and scale
""" """
from PandaObject import * from PandaObject import *
from Tkinter import * from TkGlobal import *
from Valuator import * from Valuator import *
import Pmw
import Task import Task
import math import math
import string import string

View File

@ -1,7 +1,7 @@
""" """
A basic widget for showing the progress being made in a task. A basic widget for showing the progress being made in a task.
""" """
from Tkinter import * from TkGlobal import *
class ProgressBar: class ProgressBar:
def __init__(self, master=None, orientation="horizontal", def __init__(self, master=None, orientation="horizontal",

View File

@ -1,7 +1,6 @@
from PandaObject import * from PandaObject import *
from Tkinter import * from TkGlobal import *
from Tree import * from Tree import *
import Pmw
# changing these strings requires changing DirectSession.py SGE_ strs too! # changing these strings requires changing DirectSession.py SGE_ strs too!
DEFAULT_MENU_ITEMS = [ DEFAULT_MENU_ITEMS = [

View File

@ -2,9 +2,8 @@
Slider Class: Velocity style controller for floating point values with Slider Class: Velocity style controller for floating point values with
a label, entry (validated), and min/max slider a label, entry (validated), and min/max slider
""" """
from Tkinter import * from TkGlobal import *
from Valuator import * from Valuator import *
import Pmw
import Task import Task
import math import math
import string import string

View File

@ -18,7 +18,7 @@
import os import os
import sys import sys
import string import string
from Tkinter import * from TkGlobal import *
from PandaObject import * from PandaObject import *
# Initialize icon directory # Initialize icon directory

View File

@ -1,6 +1,5 @@
from PandaObject import * from PandaObject import *
from Tkinter import * from TkGlobal import *
import Pmw
import tkColorChooser import tkColorChooser
import WidgetPropertiesDialog import WidgetPropertiesDialog
import string import string

View File

@ -1,5 +1,4 @@
from Tkinter import * from TkGlobal import *
import Pmw
import Valuator import Valuator
import Floater import Floater
import Slider import Slider

View File

@ -1,5 +1,4 @@
from Tkinter import * from TkGlobal import *
import Pmw
import types import types
import string import string