Skip to content

Commit ca6a48e

Browse files
author
Mark Mine
committed
Used TkGlobal instead of Tkinter and Pmw
1 parent f12cb81 commit ca6a48e

21 files changed

+25
-42
lines changed

direct/src/directtools/DirectSession.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
from DirectGrid import *
88
from DirectGeometry import *
99
from DirectLights import *
10-
from DirectSessionPanel import *
1110
from ClusterClient import *
1211
from ClusterServer import *
13-
from tkSimpleDialog import askstring
1412
import Placer
1513
import Slider
1614
import SceneGraphExplorer
@@ -169,8 +167,8 @@ def __init__(self):
169167

170168
if base.wantTk:
171169
import TkGlobal
172-
self.panel = DirectSessionPanel(parent = tkroot)
173-
170+
import DirectSessionPanel
171+
self.panel = DirectSessionPanel.DirectSessionPanel(parent = tkroot)
174172
try:
175173
# Has the clusterMode been set externally (i.e. via the
176174
# bootstrap application?
@@ -646,6 +644,7 @@ def downAncestry(self):
646644

647645
def getAndSetName(self, nodePath):
648646
""" Prompt user for new node path name """
647+
from tkSimpleDialog import askstring
649648
newName = askstring('Node Path: ' + nodePath.getName(),
650649
'Enter new name:')
651650
if newName:

direct/src/leveleditor/LevelEditor.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
from PandaObject import *
33
from PieMenu import *
44
from DirectGuiGlobals import *
5-
from Tkinter import *
5+
from TkGlobal import *
66
from DirectUtil import *
77
from DirectGeometry import *
88
from SceneGraphExplorer import *
99
from tkMessageBox import showinfo
1010
from tkFileDialog import *
1111
from whrandom import *
12-
import Pmw
1312
import Floater
1413
import VectorWidgets
1514
import string

direct/src/showbase/ShowBase.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,7 @@ def startTk(self, fWantTk = 1):
11931193
self.wantTk = fWantTk
11941194
if self.wantTk:
11951195
import TkGlobal
1196+
TkGlobal.spawnTkLoop()
11961197

11971198
def startDirect(self, fWantDirect = 1):
11981199
self.wantDirect = fWantDirect

direct/src/showbase/TkGlobal.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
21
from Tkinter import *
3-
import sys
42
import Pmw
3+
import sys
54
# This is required by the ihooks.py module used by Squeeze (used by
65
# pandaSqueezer.py) so that Pmw initializes properly
76
sys.modules['_Pmw'].__name__ = '_Pmw'
@@ -21,7 +20,8 @@ def tkloop(self):
2120
# Get the taskMgr
2221
from TaskManagerGlobal import *
2322

24-
# Spawn this task
25-
taskMgr.add(tkloop, "tkloop")
23+
def spawnTkLoop():
24+
# Spawn this task
25+
taskMgr.add(tkloop, "tkloop")
2626

2727

direct/src/tkpanels/AnimPanel.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44

55
# Import Tkinter, Pmw, and the floater code from this directory tree.
66
from AppShell import *
7-
from Tkinter import *
7+
from TkGlobal import *
88
from tkSimpleDialog import askfloat
9-
import Pmw
109
import string
1110
import math
1211
import types

direct/src/tkpanels/DirectSessionPanel.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
# Import Tkinter, Pmw, and the dial code
44
from PandaObject import *
55
from AppShell import *
6-
from Tkinter import *
6+
from TkGlobal import *
77
import string
8-
import Pmw
98
import Dial
109
import Floater
1110
import Slider

direct/src/tkpanels/FSMInspector.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
""" Finite State Machine Inspector module """
22
from PandaObject import *
33
from AppShell import *
4-
from Tkinter import *
4+
from TkGlobal import *
55
from tkSimpleDialog import askstring
6-
import Pmw
76
import math
87
import operator
98

direct/src/tkpanels/Inspector.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
### so that I can just type: inspect(anObject) any time.
55

66
import string
7-
from Tkinter import *
87
from TkGlobal import *
9-
import Pmw
108

119
### public API
1210

direct/src/tkpanels/MopathRecorder.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Import Tkinter, Pmw, and the dial code from this directory tree.
44
from PandaObject import *
5-
from Tkinter import *
5+
from TkGlobal import *
66
from AppShell import *
77
from DirectGlobals import *
88
from DirectUtil import *
@@ -11,7 +11,6 @@
1111
from tkFileDialog import *
1212
import os
1313
import string
14-
import Pmw
1514
import Dial
1615
import Floater
1716
import Slider

direct/src/tkpanels/ParticlePanel.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
# Import Tkinter, Pmw, and the floater code from this directory tree.
44
from AppShell import *
5-
from Tkinter import *
5+
from TkGlobal import *
66
from tkFileDialog import *
77
from tkSimpleDialog import askstring
88
import os
9-
import Pmw
109
import Dial
1110
import Floater
1211
import Slider

0 commit comments

Comments
 (0)