Path: utzoo!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!sun-barr!apple!han From: han@Apple.COM (Byron Han) Newsgroups: comp.sys.mac.programmer Subject: Re: Moving Push Buttons In a Dialog Keywords: Buttons Dialog Message-ID: <50134@apple.Apple.COM> Date: 12 Mar 91 00:01:03 GMT References: <5373@media-lab.MEDIA.MIT.EDU> Organization: Apple R&D - Networking & Communications Lines: 21 In article <5373@media-lab.MEDIA.MIT.EDU> gslee@media-lab.MEDIA.MIT.EDU (Gene Lee) writes: > How can one successfully move a push button or any other >control within a dialog box. When I called MoveControl and SetDItem >to move my button, it seemed to work, but ModalDialog doesn't seem to >recognize them. Does anyone know what I did wrong? > > Inside Mac suggests that I don't call SetDItem, but when I >don't call it the control's rectangle doesn't change. > This seems to work. GetDItem(pDialog, itemNo, &itemType, &itemHandle, &itemRect); OffsetRect(&itemRect, dH, dV); SetDItem(pDialog, itemNo, itemType, itemHandle, &itemRect); MoveControl( (ControlHandle)itemHandle, itemRect.left, itemRect.top); -- Byron Han, CommToolbox Emir Changing the world, one connection at a time Apple Computer, Inc. -------------------------------------------- 20525 Mariani Ave, MS: 35CP Internet: han@apple.COM Cupertino, CA 95014 UUCP:{sun,voder,nsc,decwrl}!apple!han ATTnet: 408-974-6450 Applelink:HAN1 HAN1@applelink.apple.COM