Why are new files I've created not showing their listboxes when reopened?

Never suggested it did.
But probably changing drawing color was the wrong word.
Please change the TEXT color in the PaintTextCell event.

cmd-a / alt-a ?

But your ListBox must allow that in design properties.

image

You said you can see the listbox contains data. The listbox is already visible.

The scroll button on the right shows there is are rows loaded into the listbox. The Cash Balance at the bottom right is showing the sum of all the debits and credits of the listbox. I opened the Account Chart. It also shows nothing on the listbox, but when I key in an account number, the account’s title appears next to it. This file has records, in all the correct columns because when i choose to export it as TEXT, the result is everything that was imported into the new file and saved to begin with.

All of the journals are selectable from the sidebar on the left, if they are visible to select. When clicking on this one, it sends the scroll button to the bottom of the list.

This is how the app’s main screen shows when opened properly.

I am also seeing the Search Field change its dimensions.

Can you check the available number of columns ?

Sometimes (bad code) when I add a Row, I “lost” some columns. I gain them back adding a new Row with all Columns… (or change the Column Count):
the data are here, but simply not displayed… sometimes.

There are thirteen columns, but only the first eight are displayed. I’ve attached a screenshot here to show Jeff what I meant that other listboxes that show queries and report information are also hosed the same as the journals on the main window.

have you sub classed a listbox to reuse it? because all appear white on white?
if so have you changed super to DesktopListBox?
if you copy the project, you could remove all paint events then i expect all data appear.
if you click a row, break and look into the debugger the list would show data, correct?

2 Likes

Yes, subclassed for the journal listboxes. Not used for listboxes used for queries or reports.
DesktopListbox was changed by Xojo when I created the listboxes. I referred to the item class for the journal listboxes (seven). When I step through code, yes, I see data in the debugger and it appears correct.

Again. this problem does not occur if I open a file created with an already exist file created in API.1 days. I can save that file and it opens fine (as shown above). This problem only occurs with new files containing newly introduced data. They display fine until saved and reopened.

Years ago, I provided my project file for the engineers. Might save some time if that could happen, I have deadline with Apple in a couple of weeks about this app.

Are you saving color data in the file? Perhaps that is being stored differently now.

Here is a project file and related data file I used it to create. I haven’t coded to delete individual items from the listbox, but if you figure what I missed, let me know. For now, you can delete the file to start all over anew.

I have to say I was worried that this would not show the issue I was trying to describe here. It was working perfectly and then, all of a sudden, it stopped displaying data. Just like the others I’ve talked about, the letters are not appearing on the page when the listBox’s PaintCellBackgount has active code in it. I only used a simple color set switching between odd and even rows. Anyway, after many moves trying to delete entries, the file suddenly stopped showing the text on the listbox. The file I included was not displaying properly. It may for you, for a while. I honestly did not expect it to break, but it did.

The culprit is in the PaintBCellBackgroundPaint handle. My app requires this to work. Damn.

If you all find a fix lemme know. Totally grateful for your input. You asked for a sample project…

ListboxBug Project.zip (13.1 KB)

I’ve not subclassed a listbox, unless creating an item class does the same thing. The super is properly changed to DesktopListbox. I’ve not tried, but the small project that demos the problem, yet not exactly, I removed the background paint code and text reappeared. Yes, stepping through code shows all data has been read into the file and placed properly where it needs to go.

You’re drawing a light color to the background of the rows. When in dark mode, white is the default row text color. You need to implement the PaintCellText event and change the DrawingColor of the graphics context accordingly to a dark color.

As @Jeff_Tullin and I think a couple of others have said a few times above.

1 Like

That would be ctrl-a :wink:

Do you want to support dark mode? to look like this:

instead of this:

if the answer is no, then you can remove Supports Dark Mode

If you answer is yes, then add PaintCellText to your ListBox and, because you always paint a light background, make sure your text is always dark.

I hope this helps.

Edit: of course the right way to do it is assign light colors in light mode and dark background colors in dark mode.

took 10 seconds to add this to the sample project, and yes, it looks fine.

2 Likes

but at least white at light brown should be visible in even odd row.

It is. You have to squint, but it’s there.

2 Likes

I apologize to everyone about posting the “smaller” project that was intended to replicate the problem I’m having with met larger work. At best, it has provided some good advice when working with DarkMode, PaintCellBackground, and PaintCellText. I continue to believe the way these new files have been reopening is not related to paint. I’m not getting gridlines, for starts.

Returning to my larger project, I’ve turned off DarkMode, removed the PaintCellBackground code in Listbox and the handler in PaintCellText only sets the DrawingColor to black except when a row is selected (blue), is set to white .

Turning that stuff off made no difference, these files still show as the screenshots I’ve uploaded. The sidebar is not drawing any text, even after adding “DrawingColor = RGB(0.0.0)” to the sidebar’s PaintCellText event.

My anxiety about this issue I’m having has caused e to not communicate as effectively as I should. Giving you stats on the development environment I have here did not provide a proper beginning. Solving that nugget: CPU is M2 Mac Mini, 16MB RAM, Mac OS 15.5, Xojo 2025..2. The source for refactoring (API.1) was saved April 20, 2022.

I’m happy to upload my refactored work for any of you to create a new file with a minimal record or two and provide feedback whether the file opens and appears as my screenshots have shown here. At best, you may provide feedback that you’re not experiencing this and there’s something wrong with my Mac or the OS. The upload is less than 10 MB, larger than the 4MB limit on uploads here.

Best I guess is to offer to email the disc image to you if you want to look first-hand at this problem. Looking at the project yourself is probably the most information I could provide. I could email you a disk image of this using my Contact page at Corona’s web site at www.designersdomain.com.

Two weeks to Apple. Refactor was supposed to be the update I was delivering. The only updateI’m delivering is a rewritten accounting software manual.

Thanks, again, for helping look at this, and your patience with me and my lack of adequate communication about it. I appreciate your forgiveness any forum rules I may have ignored.