{"id":4502,"date":"2023-09-25T15:38:00","date_gmt":"2023-09-25T15:38:00","guid":{"rendered":"https:\/\/truelogic.org\/wordpress\/?p=4502"},"modified":"2023-09-25T15:38:00","modified_gmt":"2023-09-25T15:38:00","slug":"14-wxwidgets-wxsplitterwindow","status":"publish","type":"post","link":"https:\/\/truelogic.org\/wordpress\/2023\/09\/25\/14-wxwidgets-wxsplitterwindow\/","title":{"rendered":"14. wxWidgets \u2013 wxSplitterWindow"},"content":{"rendered":"\n<p><strong>OVERVIEW<\/strong><\/p>\n\n\n\n<p>The wxSplitterWindow is a modern UI widget to allow window regions of variable height or width. They can be split either horizontally or vertically. You can create more complex interfaces by nesting wxSplitterWindows.<\/p>\n\n\n\n<p>The sample code shows two wxGrid objects in two splitter windows.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>SAMPLE CODE<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n#include &amp;lt;wx\/wxprec.h&gt;\n#include &amp;lt;wx\/wx.h&gt;\n#include &amp;lt;wx\/grid.h&gt;\n#include &amp;lt;wx\/splitter.h&gt;\n\nclass Splitter:public wxFrame {\npublic:\n    Splitter(const wxString&amp;amp; title);\n};\n\nclass ThisApp:public wxApp {\npublic:\n    virtual bool OnInit();\n};\n\nSplitter::Splitter(const wxString&amp;amp; title):\n    wxFrame(NULL, -1, title, wxDefaultPosition, wxSize(500,200)) {\n\n    wxSplitterWindow* split = new wxSplitterWindow(this);\n\n    wxPanel *panLeft = new wxPanel(split, -1);\n    wxGrid* grid = new wxGrid(panLeft, -1);\n    grid-&gt;CreateGrid(20,10);\n    wxBoxSizer* vbox = new wxBoxSizer(wxVERTICAL);\n    panLeft-&gt;SetSizer(vbox);\n    vbox-&gt;Add(grid, 1, wxALL | wxEXPAND);\n\n    wxPanel *panRight = new wxPanel(split, -1);\n    wxGrid* grid2 = new wxGrid(panRight, -1);\n    grid2-&gt;CreateGrid(20,10);\n    wxBoxSizer* vbox2 = new wxBoxSizer(wxVERTICAL);\n    panRight-&gt;SetSizer(vbox2);\n    vbox2-&gt;Add(grid2, 1, wxALL | wxEXPAND);\n\n    split-&gt;SplitVertically(panLeft, panRight);\n    split-&gt;SetMinimumPaneSize(100);\n\n};\n\nbool ThisApp::OnInit() {\n    Splitter* split = new Splitter(wxT(&quot;Splitter Demo&quot;));\n    split-&gt;Show(true);\n    return TRUE;\n};\n\nwxIMPLEMENT_APP(ThisApp);\n\n\n<\/pre><\/div>\n\n\n<p>The output is shown below<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"735\" height=\"312\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2023\/09\/Screenshot-from-2023-09-25-21-07-17.png\" alt=\"\" class=\"wp-image-4504\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2023\/09\/Screenshot-from-2023-09-25-21-07-17.png 735w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2023\/09\/Screenshot-from-2023-09-25-21-07-17-620x263.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2023\/09\/Screenshot-from-2023-09-25-21-07-17-300x127.png 300w\" sizes=\"auto, (max-width: 735px) 100vw, 735px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>OVERVIEW The wxSplitterWindow is a modern UI widget to allow window regions of variable height or width. They can be split either horizontally or vertically. <a class=\"mh-excerpt-more\" href=\"https:\/\/truelogic.org\/wordpress\/2023\/09\/25\/14-wxwidgets-wxsplitterwindow\/\" title=\"14. wxWidgets \u2013 wxSplitterWindow\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":4405,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[302,365],"tags":[],"class_list":["post-4502","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cc","category-wxwidgets"],"_links":{"self":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/4502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/comments?post=4502"}],"version-history":[{"count":2,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/4502\/revisions"}],"predecessor-version":[{"id":4505,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/4502\/revisions\/4505"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/media\/4405"}],"wp:attachment":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/media?parent=4502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/categories?post=4502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/tags?post=4502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}