Commit da75aa66 authored by Jack Jansen's avatar Jack Jansen

Various toolbox routines have gotten new names.

parent 42729b00
...@@ -9,7 +9,7 @@ This module uses DLOG resources 256, 257 and 258. ...@@ -9,7 +9,7 @@ This module uses DLOG resources 256, 257 and 258.
Based upon STDWIN dialogs with the same names and functions. Based upon STDWIN dialogs with the same names and functions.
""" """
from Dlg import GetNewDialog, SetIText, GetIText, ModalDialog from Dlg import GetNewDialog, SetDialogItemText, GetDialogItemText, ModalDialog
def Message(msg): def Message(msg):
...@@ -25,8 +25,8 @@ def Message(msg): ...@@ -25,8 +25,8 @@ def Message(msg):
if not d: if not d:
print "Can't get DLOG resource with id =", id print "Can't get DLOG resource with id =", id
return return
tp, h, rect = d.GetDItem(2) tp, h, rect = d.GetDialogItem(2)
SetIText(h, msg) SetDialogItemText(h, msg)
while 1: while 1:
n = ModalDialog(None) n = ModalDialog(None)
if n == 1: if n == 1:
...@@ -51,16 +51,16 @@ def AskString(prompt, default = ""): ...@@ -51,16 +51,16 @@ def AskString(prompt, default = ""):
if not d: if not d:
print "Can't get DLOG resource with id =", id print "Can't get DLOG resource with id =", id
return return
tp, h, rect = d.GetDItem(3) tp, h, rect = d.GetDialogItem(3)
SetIText(h, prompt) SetDialogItemText(h, prompt)
tp, h, rect = d.GetDItem(4) tp, h, rect = d.GetDialogItem(4)
SetIText(h, default) SetDialogItemText(h, default)
d.SelIText(4, 0, 255) # d.SetDialogItem(4, 0, 255)
while 1: while 1:
n = ModalDialog(None) n = ModalDialog(None)
if n == 1: if n == 1:
tp, h, rect = d.GetDItem(4) tp, h, rect = d.GetDialogItem(4)
return GetIText(h) return GetDialogItemText(h)
if n == 2: return None if n == 2: return None
...@@ -88,8 +88,8 @@ def AskYesNoCancel(question, default = 0): ...@@ -88,8 +88,8 @@ def AskYesNoCancel(question, default = 0):
# 3 = No # 3 = No
# 4 = Cancel # 4 = Cancel
# The question string is item 5 # The question string is item 5
tp, h, rect = d.GetDItem(5) tp, h, rect = d.GetDialogItem(5)
SetIText(h, question) SetDialogItemText(h, question)
while 1: while 1:
n = ModalDialog(None) n = ModalDialog(None)
if n == 1: return default if n == 1: return default
......
...@@ -5,7 +5,7 @@ import MacOS ...@@ -5,7 +5,7 @@ import MacOS
import traceback import traceback
from addpack import addpack from addpack import addpack
addpack('Demo') addpack('Tools')
addpack('bgen') addpack('bgen')
addpack('ae') addpack('ae')
#addpack('ctl') #addpack('ctl')
...@@ -377,7 +377,7 @@ class Menu: ...@@ -377,7 +377,7 @@ class Menu:
self.menu.AppendMenu('x') # add a dummy string self.menu.AppendMenu('x') # add a dummy string
self.items.append(label, shortcut, callback, kind) self.items.append(label, shortcut, callback, kind)
item = len(self.items) item = len(self.items)
self.menu.SetItem(item, label) # set the actual text self.menu.SetMenuItemText(item, label) # set the actual text
if shortcut: if shortcut:
self.menu.SetItemCmd(item, ord(shortcut)) self.menu.SetItemCmd(item, ord(shortcut))
return item return item
...@@ -429,7 +429,7 @@ class AppleMenu(Menu): ...@@ -429,7 +429,7 @@ class AppleMenu(Menu):
Menu.__init__(self, bar, "\024") Menu.__init__(self, bar, "\024")
self.additem(abouttext, None, aboutcallback) self.additem(abouttext, None, aboutcallback)
self.addseparator() self.addseparator()
self.menu.AddResMenu('DRVR') self.menu.AppendResMenu('DRVR')
def dispatch(self, id, item, window, event): def dispatch(self, id, item, window, event):
if item == 1: if item == 1:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment