I have been trying to build my applications using the Cocoa widget set to look for issues. I am pretty impressed with the results, but there are still some issues.
I have a complex preferences dialog that uses a TPageControl with about 20 TTabSheets, each of which has 10 to 20 or so controls. The Tabs are hidden on the PageControl, and the user selects a page from a TListBox next to it. The current TTabSheet is set using:
PageControl1.PageIndex := fCurPage;
This works fine in Windows, Linux, and Carbon. In Cocoa however, the controls are all drawn correctly on initial tabsheet, but subsequent tabsheets only display TLabels and TPaintBoxes. All other controls (TCheckBoxs, TComboBoxes, TEdits) are not drawn. If I display the tabs, and click on them (avoiding the above code) the controls are drawn correctly.
I was unsuccessful in duplicating the issue in a small program, so I took the code and removed everything except the minimum. The problem persisted. However, when I moved the form to a new project, and opened it there, the problem went away. I also tried code like:
PageControl1.PageIndex := fCurPage;
PageControl1.Controls[fCurPage].Update
and:
PageControl1.PageIndex := fCurPage;
if PageControl1.Controls[fCurPage] is TTabSheet then begin
ts := TTabSheet(PageControl1.Controls[fCurPage]);
c := ts.ControlCount;
for i := 0 to c-1 do
ts.Controls[i].Update;
end;
Any suggestions or similar issues?