New topic: Custom Properties in a Window
<http://forums.realsoftware.com/viewtopic.php?t=29671> Page 1 of 1 [ 5 posts ] Previous topic | Next topic Author Message bineo Post subject: Custom Properties in a WindowPosted: Fri Aug 21, 2009 4:39 am Joined: Sun Jul 16, 2006 1:48 pm Posts: 147 Location: Switzerland Is it normal that if i got a Window with a custom property, and i set this property's value, the window shows up? Even if i never called window.show ? I don't get the logic of this... _________________ unimatrix0 Top mjh Post subject: Re: Custom Properties in a WindowPosted: Fri Aug 21, 2009 4:47 am Joined: Sun Feb 19, 2006 3:10 pm Posts: 329 Location: Hamburg, Germany Itâs called implicit instantiation; you can turn it off in the IDE (individually for each window). Then you will have to create the window explicitly by calling new. What happens in your case is that at first, you have just a class such as âmyWindowâ, but not an instance (object) of that class. When you use the class like it was an object, i.e. âmyWindow.someProperty = 99â, then an instance will be automagically created for you so the property can be set. If myWindow is set to be initially visible, then it will be shown at that point. Implicit instantiation was supposed to simplify things, but it confuses developers new to RB no end. It is best turned off. _________________ Michael J. HuÃmann http://digicam-experts.de Top bineo Post subject: Re: Custom Properties in a WindowPosted: Fri Aug 21, 2009 6:29 am Joined: Sun Jul 16, 2006 1:48 pm Posts: 147 Location: Switzerland ok this makes sense so either i do the thing by myself with "new" or i set visible to false ? _________________ unimatrix0 Top mjh Post subject: Re: Custom Properties in a WindowPosted: Fri Aug 21, 2009 7:27 am Joined: Sun Feb 19, 2006 3:10 pm Posts: 329 Location: Hamburg, Germany bineo wrote:so either i do the thing by myself with "new" or i set visible to false ? Yes, setting Visible to false is another option â the window will still be created when you access a property (not just custom properties, by the way), but it wonât show until you tell it to. _________________ Michael J. HuÃmann http://digicam-experts.de Top computerfreaker Post subject: Re: Custom Properties in a WindowPosted: Fri Aug 21, 2009 8:52 am Joined: Thu Mar 05, 2009 1:03 pm Posts: 1415 Location: USA You can read all about implicit instantiation here: http://forums.realsoftware.com/viewtopic.php?f=1&t=29485 It's a long thread but well worth reading... _________________ With great power comes great responsibility. Learn something new every day, and the rest will take care of itself. Life is a journey, not a destination. Enjoy the trip! Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 5 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]
