New topic: ListBox CellBackgroundPaint event crash - solved
<http://forums.realsoftware.com/viewtopic.php?t=43778> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message JimPitchford Post subject: ListBox CellBackgroundPaint event crash - solvedPosted: Thu Apr 26, 2012 4:16 pm Joined: Mon Apr 11, 2011 2:01 pm Posts: 93 My app was crashing intermittently in debug and runtime with no information about RB's status in the OSX crash report. After a fair bit of investigation I tracked it down to the cellBackgroundPaint event. This was using g.drawstring (text) where text was derived by a method (get_nextDate). Now the result of that method was not changing between refreshes of the screen so the re-calculation for each row was a somewhat redundant. So I changed the text to point to a property instead and updated that property when needed elsewhere in the program. The result was no more crashing. Now I know what I did was just poor programming practice - since recalculating every time would take up a lot more cycles than calculating it once and applying it to a property - but I didn't expect the result to be a crash. Could it be that the cycles to recalculate something within a listbox would actually cause the listbox to crash? Jim _________________ Jim OSX 10.6.8, rb2011r4 Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 1 post ] -- 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]
