0

I Have a simple Panel initialized with a file picker control

wxBoxSizer* top_sizer;
top_sizer = new wxBoxSizer( wxHORIZONTAL );

m_BlenderFile = new wxStaticText( this, wxID_ANY, wxT("Blend File"), wxDefaultPosition, wxDefaultSize, 0 );
m_BlenderFile->Wrap( -1 );
top_sizer->Add( m_BlenderFile, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );

m_fileBlend = new wxFilePickerCtrl(
    this, wxID_ANY, wxEmptyString, wxT("Select a blender file"), wxT("*.blend"),
    wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE );
top_sizer->Add( m_fileBlend, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );


m_mainSizer->Add( top_sizer, 1, wxEXPAND, 5 );

At the line where I initialize the FilePickerCtrl, I get the following output in the console:

(bhelper:16553): GLib-CRITICAL **: g_byte_array_remove_range: 
assertion 'index_ + length <= array->len' failed

(bhelper:16553): GLib-CRITICAL **: g_byte_array_remove_range: 
assertion 'index_ + length <= array->len' failed

(bhelper:16553): GLib-CRITICAL **: g_byte_array_remove_range: 
assertion 'index_ + length <= array->len' failed

Unfortunately for me, the panel with the file picker is dynamically created by the user, so there could be 10 of these, and each time one is created, the three error lines above pop up.

What am I missing here?

PS: I am using wxWidgets 3.0.3 on a Linux machine

Dean Seo
  • 5,486
  • 3
  • 30
  • 49
  • What exact version of GTK+ do you have? Did you compile wx yourself or install it from the repository? What happen if you remove wxT() call around your strings? – Igor Feb 09 '18 at 15:08
  • I can't reproduce this. Do you see the problem on the "file picker" page of the widgets sample, distributed with wxWidgets, or is it specific to your application? – VZ. Feb 09 '18 at 16:17
  • @Igor I Have Gtk3 installed, No I did not compile wx myself. Removing wxT() doesn't Change anything. – ian ichung'wah Feb 10 '18 at 05:46
  • @VZ. This is specific to my c++ app. I have tried to reproduce with another minimal c++ app and also wxPython, but can't. – ian ichung'wah Feb 10 '18 at 05:51

1 Answers1

0

Without being able to reproduce it, it's difficult to know where does it come from. As usual, please try running your application under gdb and put breakpoints on g_log (see this answer for more details), this should give you (and us) at least some idea about where is this coming from.

VZ.
  • 21,740
  • 3
  • 39
  • 42