New topic: Popup Menu differences between Mac and Win
<http://forums.realsoftware.com/viewtopic.php?t=30594> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message B0B Post subject: Popup Menu differences between Mac and WinPosted: Wed Oct 21, 2009 9:59 pm Joined: Sun Mar 05, 2006 5:29 am Posts: 68 I have a popup menu on a window that I populate with items (quite often only one item), and when finished I execute the following to make sure that there is a default item selected: PopMenu1.ListIndex=0 PopMenu1.Refresh This works on Mac OSX but not on Win XP. On the Mac, the first item is displayed, and later returns the correct data when accessed by the program. On the PC, the menu remains blank and the program produces a NilObjectException later when I try to access the Caption text. What am I doing wrong? Edit: One other point of interest: When I populate the menu with a single item, then on the Mac the menu only has a single item. On the PC, the menu has a blank item plus the item that I had added. It appears that the PC version starts with a default blank item while the Mac does not. Edit2: On a hunch I tried doing a PopMenu1.DeleteAllRows before starting to add menu items. However, it still puts a blank item on the PC version. _________________ MacBook Pro (Intel) OSX 10.5; RealBasic 2009 r1 Top B0B Post subject: Re: Popup Menu differences between Mac and WinPosted: Wed Oct 21, 2009 11:01 pm Joined: Sun Mar 05, 2006 5:29 am Posts: 68 Well I still don't know why it was doing it, but I've fixed it. I added the following code after populating the menu: #if TargetWin32 PopMenu1.RemoveRow(0) #endif _________________ MacBook Pro (Intel) OSX 10.5; RealBasic 2009 r1 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]
