Timer in Carbon vs Cocoa

Hi,

I have created an application with one ListBox and two TextAreas such as Completed Objectives and NON Completed Objectives.

When an item is checked in the ListBox, it is added to the Completed Objectives text area and deleted from the NON Completed Objectives text area.

I have put the following code in a Timer


me.period=1000
  Dim i As Integer
  
  ObjectivesCompleted = ""
  ObjectivesNOTCompleted = ""
  
  For i=0 to ListBox1.ListCount-1
    if ListBox1.CellCheck(i,0) then
      ObjectivesCompleted = ObjectivesCompleted + str(Listbox1.Cell(i,0)) + EndOfLine
      TextArea1.text = ObjectivesCompleted
    end
  Next
  
  For i=0 to ListBox1.ListCount-1
    if NOT ListBox1.CellCheck(i,0) then
      ObjectivesNOTCompleted = ObjectivesNOTCompleted + str(Listbox1.Cell(i,0)) + EndOfLine
      TextArea2.text = ObjectivesNOTCompleted
    end
  Next

For some reason, this code fails to delete the last item from the NON Completed Objectives text area when all items in the ListBox are checked.

To fix this deficiency, I created another timer that sets the NON Completed Objectives text area to a blank string.

This code with two timers works perfectly in Carbon.

When I try the same code in Cocoa, the NON Completed Objectives text area is flickering and is showing no text.

So, I need to either put up with Carbon, or try to find a way to fix the problem with Cocoa.

I would appreciate any suggestions.

Thank you

While I’m not sure exactly what you’re doing, I don’t think it should flicker. You should file a bug report in Feedback with an example project and we can see if it’s a bug or not.

Why not toss the timer, and do this in the CELLCLICK event of the listbox itself??
If they haven’t clicked a box for 10 min why waste time checking to see if they did?

Hi, everybody.
I have found a way around.
Thank you for every ones help.
Works in Cocoa now.