Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!uc!nic.MR.NET!srcsip!manyjars!mnkonar From: mnkonar@manyjars.SRC.Honeywell.COM (Murat N. Konar) Newsgroups: comp.sys.mac.programmer Subject: Re: cdev resources Message-ID: <24672@srcsip.UUCP> Date: 28 Jun 89 00:58:40 GMT References: <1103@tasis.utas.oz> Sender: news@src.honeywell.COM Reply-To: mnkonar@src.honeywell.com (Murat N. Konar) Organization: ids Lines: 33 In article <1103@tasis.utas.oz> charles@tasis.utas.oz (Charles Lakos) writes: >2. What happens if you cannot allocate resource numbers for the cdev > code resources in the recommended range (-4048..-4033?)? The CDEF > does not have a number in that range because I couldn't work out how > to reference the CDEF in the CNTL's procID (which should be the resource > id of the CDEF * 16 + variation - all in 16 bits!). > >3. Why is it that the system does not seem to use custom scroll bars in its > cdevs?? Instead those cdevs (e.g. Sound) specify a UserItem where the > scroll bar will be drawn. Makes one suspicious! I suspect that the answer to questions 2 and 3 are related. The cdevs that use custom CDEFs are probably: 1) using NewControl to create a control (invisible at first) 2) setting the controls rectangle to the user item rect 3) getting a handle to the custom CDEF (numbered in the recommended range) by using GetResource 4) storing the handle to the custom CDEF into the proc field of the control record 5) replacing the user item with the control using SetDItem 6) showing the control by using ShowControl. Disclaimer: I'm writing all this off the top of my head so if it doesn't work, oops. But I think there is enoughg in here to get you on your way to solving your problem. ____________________________________________________________________ Have a day. :^| Murat N. Konar Honeywell Systems & Research Center, Camden, MN mnkonar@SRC.honeywell.com (internet) {umn-cs,ems,bthpyd}!srcsip!mnkonar(UUCP)