summaryrefslogtreecommitdiffstats
path: root/Mac/Demo/PICTbrowse/cicnbrowse.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1999-12-23 14:45:02 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1999-12-23 14:45:02 (GMT)
commit3b23ed9ba640ed6426a341091e6a5ad7405158a9 (patch)
tree5f5fc3f76530ff25839e262f619c8226edee1337 /Mac/Demo/PICTbrowse/cicnbrowse.py
parent6a6db0724cfa6f6d7126672be68551e49f52f063 (diff)
downloadcpython-3b23ed9ba640ed6426a341091e6a5ad7405158a9.zip
cpython-3b23ed9ba640ed6426a341091e6a5ad7405158a9.tar.gz
cpython-3b23ed9ba640ed6426a341091e6a5ad7405158a9.tar.bz2
Converted to Appearance and using a List control in stead of manually creating the List and putting it in a useritem. The old version is in oldPICTbrowse, for documentary purposes.
Diffstat (limited to 'Mac/Demo/PICTbrowse/cicnbrowse.py')
-rw-r--r--Mac/Demo/PICTbrowse/cicnbrowse.py27
1 files changed, 5 insertions, 22 deletions
diff --git a/Mac/Demo/PICTbrowse/cicnbrowse.py b/Mac/Demo/PICTbrowse/cicnbrowse.py
index 8a31ccc..38e3bed 100644
--- a/Mac/Demo/PICTbrowse/cicnbrowse.py
+++ b/Mac/Demo/PICTbrowse/cicnbrowse.py
@@ -5,6 +5,7 @@ import EasyDialogs
import Res
import Qd
import Win
+import Controls
import List
import sys
import struct
@@ -119,11 +120,11 @@ class MyDialog(FrameWork.DialogWindow):
self.id = id
FrameWork.DialogWindow.open(self, ID_MAIN)
self.wid.SetDialogDefaultItem(MAIN_SHOW)
- tp, h, rect = self.wid.GetDialogItem(MAIN_LIST)
- rect2 = rect[0]+1, rect[1]+1, rect[2]-17, rect[3]-17 # Scroll bar space
- self.list = List.LNew(rect2, (0, 0, 1, len(contents)), (0,0), 0, self.wid,
- 0, 1, 1, 1)
self.contents = contents
+ self.ctl = self.wid.GetDialogItemAsControl(MAIN_LIST)
+ h = self.ctl.GetControlDataHandle(Controls.kControlListBoxPart,
+ Controls.kControlListBoxListHandleTag)
+ self.list = List.as_List(h)
self.setlist()
def setlist(self):
@@ -139,13 +140,6 @@ class MyDialog(FrameWork.DialogWindow):
self.list.LSetDrawingMode(1)
self.list.LUpdate(self.wid.GetWindowPort().visRgn)
- def do_listhit(self, event):
- (what, message, when, where, modifiers) = event
- Qd.SetPort(self.wid)
- where = Qd.GlobalToLocal(where)
- if self.list.LClick(where, modifiers):
- self.do_show()
-
def getselection(self):
items = []
point = (0,0)
@@ -165,21 +159,10 @@ class MyDialog(FrameWork.DialogWindow):
for resid in selection:
self.parent.showCIcon(resid)
- def do_rawupdate(self, window, event):
- tp, h, rect = self.wid.GetDialogItem(MAIN_LIST)
- Qd.SetPort(self.wid)
- Qd.FrameRect(rect)
- self.list.LUpdate(self.wid.GetWindowPort().visRgn)
-
- def do_activate(self, activate, event):
- self.list.LActivate(activate)
-
def do_close(self):
self.close()
def do_itemhit(self, item, event):
- if item == MAIN_LIST:
- self.do_listhit(event)
if item == MAIN_SHOW:
self.do_show()