Mac Listctrl assertion

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
gabre
Knows some wx things
Knows some wx things
Posts: 29
Joined: Sat Mar 02, 2013 9:45 am

Mac Listctrl assertion

Post by gabre » Fri Jun 07, 2013 6:24 am

I got the following error on mac:
assert.png
assert.png (31.6 KiB) Viewed 2676 times
No error on Windows / Linux. What can cause this? I hope there is somebody who knows the proper way to solve it without having to understand wx inner code. :) (less work)

User avatar
doublemax
Moderator
Moderator
Posts: 15921
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Mac Listctrl assertion

Post by doublemax » Fri Jun 07, 2013 8:16 am

The error message is pretty obvious: You can't call SetItemCount() on a wxListCtrl that is not "virtual".

Apparently, you're not using a virtual wxListCtrl. In that case you can just remove the SetItemCount() call as it doesn't make sense anyway.
Use the source, Luke!

gabre
Knows some wx things
Knows some wx things
Posts: 29
Joined: Sat Mar 02, 2013 9:45 am

Re: Mac Listctrl assertion

Post by gabre » Wed Jun 12, 2013 1:56 pm

oh yeah, thank you, the solution was as easy as u said.
I have a "stupid" question. I tested my wxErlang app under Mac again and managed to start the application without assertions. the new problem is that "my widgets are scattered all over the screen". I know that this is a hard question (without code and further, more precise information) but there may be somebody who knows what the error may be.
This screenshot shows my app after removing all the pages (for debugging purposes) from my main notebook widget except this page. As you can see it is a panel with another notebook (so my app consists of a main notebook and some other notebooks under some of the pages).
mac_Err.png
mac_Err.png (40.14 KiB) Viewed 2651 times
My app (with all pages) under Win (or Linux):
winapp.png
winapp.png (12.92 KiB) Viewed 2651 times
this is how i create my frame/widgets:
1, I create a frame
2, I create a panel (frame as parent)
3/1 Sizer (static, on panel)
3/2 notebook (panel as parent)
4, add Notebook to the sizer
5, wxPanel:setSizer(Panel, Sizer),
wxFrame:maximize(Frame),
wxFrame:sendSizeEvent(Frame),
6, setting up connections (connect)
7, adding pages to the notebook:
7/1 create a panel for the new notebook "page" (tab)
7/2 add sizer and widgets
7/3 wxPanel:setSizer(PanelOfCurrentNotebookPage, SizerOfCurrentNotebookPage),
wxSizer:layout(SizerOfCurrentNotebookPage),
8, show frame
(I tried to follow the guide lines of wxErlang demo)

Sorry for the stupid question, but I have no clue how to solve this on Mac... :(

User avatar
doublemax
Moderator
Moderator
Posts: 15921
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Mac Listctrl assertion

Post by doublemax » Wed Jun 12, 2013 2:41 pm

This is indeed hard to tell, usually this kind of symptom indicates a wrong parent-child relationship

First you should reduce the code as much as possible, e.g. only one button, one notebook with one page.

Also on the second screenshot, it looks as if you were using wxStaticBox sizers. If they are also in your demo-code, try replacing them with "normal" boxsizers for a test.
Use the source, Luke!

gabre
Knows some wx things
Knows some wx things
Posts: 29
Joined: Sat Mar 02, 2013 9:45 am

Re: Mac Listctrl assertion

Post by gabre » Thu Jun 13, 2013 11:23 am

I found out that these lines

Code: Select all

    wxSizer:add(Sz, ButtSz, [{proportion, 0}] ++ Expand),
    wxSizer:add(Sz, Notebook1, [{proportion, 1}] ++ Expand),
cause problems with widget positioning. If I remove proportion and expand ( Expand == [{flag, ?wxEXPAND}], nothing special just flags for sizers in a functional style) the notebook widget is positioned well.
Now I ll try to find out why these lies are problematic...

gabre
Knows some wx things
Knows some wx things
Posts: 29
Joined: Sat Mar 02, 2013 9:45 am

Re: Mac Listctrl assertion

Post by gabre » Wed Jun 19, 2013 11:54 am

I managed to solve the last problem but there is a new one here: buttons (and input fields) inside multiple sizers are unusable... I mean buttons are not clickable (but they are properly positioned).

gabre
Knows some wx things
Knows some wx things
Posts: 29
Joined: Sat Mar 02, 2013 9:45 am

Re: Mac Listctrl assertion

Post by gabre » Wed Jun 19, 2013 12:49 pm

There is a solution for my sizer+control problem: (it is related to staticbox)
http://wxpython-users.1045709.n5.nabble ... 51829.html

Another problem I faced: I have a wxListCtrl which shows the files found in my database (nothing special). It is placed on a notebook page, I can reach this page but when I try to navigate to another one the mouse pointer changes and shows the program is loading and I cant do anything. On GTK and Win it works and doesnt consume (too much) memory and CPU (its loading time is less than 1 sec).

Post Reply