Segmentation Fault with wx.dataview.DataViewListCtrl

Hi all,
I have an application:

You log in, and a new thread is started to do the logging in (to prevent the GUI from blocking), then another window is opened, and the logon frame is closed.

This all works fine, until I try to populate my DataViewListCtrl with 1 or more rows after the login process is finished, as part of MainFrame.Show().

When I try this, I get segmentation fault or worse.

Any ideas why?

Cheers,

Take care,

Chris Norman

chris.norman2@googlemail.com

Are you opening your second window from the second thread? If so,
that’s the problem.
You don’t have just one message queue in your process. Instead,
there is one message queue for each thread, and windows are “owned”
by the thread that created them. So, if you create a window in a
secondary thread, the creation messages will go to that thread’s
message queue. You probably do not have another MainLoop call
running in that thread, so no one will ever process those messages.
Unless you’re doing something very special, you should make sure
that ALL of your GUI activities happen on your main thread. In your
case, that means the login thread should use something like
wx.CallAfter to transition back to the main thread to do the GUI
work.

···

Chris Norman wrote:

Hi all,
I have an application:

    You log in, and a new thread is started to do the

logging in (to prevent the GUI from blocking), then another
window is opened, and the logon frame is closed.

    This all works fine, until I try to populate my

DataViewListCtrl with 1 or more rows after the login process is
finished, as part of MainFrame.Show().

When I try this, I get segmentation fault or worse.

-- Tim Roberts, Providenza & Boekelheide, Inc.

timr@probo.com

Hi,

I was using wx.CallAfter, but I was rushing, and made some stupid mistakes.

Went away and did the washing up, and now it works.

Thanks for your help.

Take care,

Chris Norman

chris.norman2@googlemail.com

···

Chris Norman wrote:

Hi all,
I have an application:

    You log in, and a new thread is started to do the

logging in (to prevent the GUI from blocking), then another
window is opened, and the logon frame is closed.

    This all works fine, until I try to populate my

DataViewListCtrl with 1 or more rows after the login process is
finished, as part of MainFrame.Show().

When I try this, I get segmentation fault or worse.

-- Tim Roberts, Providenza & Boekelheide, Inc.

timr@probo.com