Skip to content

Instantly share code, notes, and snippets.

@asmwarrior
Created January 22, 2016 13:29
Show Gist options
  • Save asmwarrior/3d1e618a32789476fd59 to your computer and use it in GitHub Desktop.
Save asmwarrior/3d1e618a32789476fd59 to your computer and use it in GitHub Desktop.
minimal sample code for wxListbook issue
#include <wx/wx.h>
#include <wx/listbook.h>
#include <wx/artprov.h>
class MyDialog1 : public wxDialog
{
public:
wxListbook* m_listbook1;
wxPanel* m_panel6;
MyDialog1()
: wxDialog(NULL, wxID_ANY, "MyDialog")
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizer1;
bSizer1 = new wxBoxSizer( wxVERTICAL );
m_listbook1 = new wxListbook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLB_DEFAULT );
wxSize m_listbook1ImageSize = wxSize( 80,80 );
int m_listbook1Index = 0;
wxImageList* m_listbook1Images = new wxImageList( m_listbook1ImageSize.GetWidth(), m_listbook1ImageSize.GetHeight() );
m_listbook1->AssignImageList( m_listbook1Images );
wxImage m_listbook1Image;
m_panel6 = new wxPanel( m_listbook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_listbook1->AddPage( m_panel6, wxT("text"), false );
m_listbook1Images->Add(wxArtProvider::GetIcon(wxART_WARNING, wxART_OTHER, m_listbook1ImageSize));
m_listbook1->SetPageImage( m_listbook1Index, m_listbook1Index );
m_listbook1Index++;
bSizer1->Add( m_listbook1, 1, wxEXPAND | wxALL, 5 );
this->SetSizer( bSizer1 );
this->Layout();
this->Centre( wxBOTH );
}
};
class MyApp : public wxApp
{
public:
virtual bool OnInit()
{
wxInitAllImageHandlers();
MyDialog1 dlg;
dlg.ShowModal();
return false;
}
};
IMPLEMENT_APP(MyApp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment