Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!mcsun!ukc!icdoc!doc.ic.ac.uk!kn From: kn@doc.ic.ac.uk (Keng Ng) Newsgroups: comp.sys.mac.programmer Subject: Need MacApp Help ... Message-ID: <1963@gould.doc.ic.ac.uk> Date: 6 Jun 90 17:57:56 GMT Sender: news@doc.ic.ac.uk Organization: DoC., Imperial College, London, England Lines: 35 I'm creating a TPalette class in MacApp to implement the kind of tool palettes you see in MacDraw windows. It contains subviews of type TPaletteIcon which represent the individual tools. I've made TPalette a sub-class of TControl and TPaletteIcon a subclass of TIcon. My intention was to have a field called fCurrTool in TPalette which will be a reference to the current tool (i.e. a TPaletteIcon object), and have this field initialised in the IRES method of TPalette to the default tool. However, it seems that the fSubViews field of a view is not set up at the time its IRES method is called. Does anyone know of a workaround ? I've thought of just making fCurrTool an integer which corresponds to the position of the tool within the palette, but this will mean more work when it comes to hiliting/unhiliting the tools, since there doesn't seem to be a direct way of retrieving the n-th element of a list. My current 'fix' is to make fCurrTool record the fIdentifier of the current tool, and call FindSubView to retrieve it when necessary. Perhaps the question I should really ask is : does what I'm doing above look sensible ? I'm new to OOP and MacApp and working without the 'MacApp Cookbook' and 'Intro to MacApp ...' manuals doesn't make life any easier. (I'm waiting to hear from ADG, the U.K. equivalent of APDA). Oh, I'm using MacApp 2.0b9 with Think Pascal 3.0. --------------------- Keng Ng Dept of Computing Imperial College 180 Queen's Gate London SW7 2BZ Tel: +44 71 589 5111 ext 5091