New topic: ContainerControl Button Position
<http://forums.realsoftware.com/viewtopic.php?t=46031> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message Robin Colston Post subject: ContainerControl Button PositionPosted: Fri Nov 23, 2012 3:28 pm Joined: Sat Sep 15, 2007 10:25 pm Posts: 10 Hi, I have a container control with a button that contains the code: window2.left=self.left+me.left window2.top=self.top+me.top window2.showModal Window2 is shown and covers the button in the calling window, this is what I want. This works great if I don't move the window1 before pushing the button, however when I move the window1 before pushing the show button, window2 is displayed in the location relative to the location of window1 prior to move and could be further to one side or the other than I would like. I am assuming that self in this case is referring to the container control that me(the button) is part of and not Window1. If that is correct, how do I include the window1 new location in figuring out where window2 should open? Thanks, Robin Top charonn0 Post subject: Re: ContainerControl Button PositionPosted: Fri Nov 23, 2012 4:46 pm Joined: Mon Apr 02, 2007 2:08 am Posts: 1020 Location: San Francisco, CA, USA For code within a ContainerControl, Self refers to the ContainerControl and Me refers to the child control you're working in. To access the properties of the Container's parent window/container, use Self.Parent; or use Me.TrueWindow to find the topmost containing window/container of the control/container. I'm not sure whether this is the cause of your problem, though. _________________ Boredom Software Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 2 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
