Jan Engelhardt
2014-03-28 20:12:11 UTC
Normally, a wxTreeCtrl as a child of a wxFrame, wxDialog or wxPanel(!)
appears as a white area with a sunken border around it. (That is,
assuming that your system does not have a fancy theme set up.) This is
just the way I would expect it, and wxMSW and wxGTK exhibit this
behavior of course.
Now, if such a wxTreeCtrl is created as a direct child of a wxNotebook
and added to the notebook as a page, then, _under wxGTK_, the background
of the treectrl will be some gray.
That seems unexpected, but perhaps there is some reason you know of?
-- testcase --
#include <wx/wx.h>
#include <wx/notebook.h>
#include <wx/treectrl.h>
class Main : public wxFrame {
public: Main(void) : wxFrame(NULL, wxID_ANY, "Hi") {
auto nb1 = new wxNotebook(this, wxID_ANY);
auto tree1 = new wxTreeCtrl(nb1, wxID_ANY);
auto root1 = tree1->AddRoot("root");
tree1->AppendItem(root1, wxEmptyString);
nb1->AddPage(tree1, "tree", true);
auto nb2 = new wxNotebook(this, wxID_ANY);
auto panel2 = new wxPanel(nb2, wxID_ANY);
auto tree2 = new wxTreeCtrl(panel2, wxID_ANY);
auto root2 = tree2->AddRoot("root");
auto si2 = new wxBoxSizer(wxVERTICAL);
tree2->AppendItem(root2, wxEmptyString);
si2->Add(tree2, 1, wxEXPAND);
panel2->SetSizer(si2);
si2->SetSizeHints(panel2);
nb2->AddPage(panel2, "tree", true);
auto si0 = new wxBoxSizer(wxHORIZONTAL);
si0->Add(nb1, 1, wxEXPAND);
si0->Add(nb2, 1, wxEXPAND);
SetSizer(si0);
si0->SetSizeHints(this);
};
};
class App : public wxApp {
public: bool OnInit(void) {
(new Main)->Show();
return true;
};
};
IMPLEMENT_APP(App);
appears as a white area with a sunken border around it. (That is,
assuming that your system does not have a fancy theme set up.) This is
just the way I would expect it, and wxMSW and wxGTK exhibit this
behavior of course.
Now, if such a wxTreeCtrl is created as a direct child of a wxNotebook
and added to the notebook as a page, then, _under wxGTK_, the background
of the treectrl will be some gray.
That seems unexpected, but perhaps there is some reason you know of?
-- testcase --
#include <wx/wx.h>
#include <wx/notebook.h>
#include <wx/treectrl.h>
class Main : public wxFrame {
public: Main(void) : wxFrame(NULL, wxID_ANY, "Hi") {
auto nb1 = new wxNotebook(this, wxID_ANY);
auto tree1 = new wxTreeCtrl(nb1, wxID_ANY);
auto root1 = tree1->AddRoot("root");
tree1->AppendItem(root1, wxEmptyString);
nb1->AddPage(tree1, "tree", true);
auto nb2 = new wxNotebook(this, wxID_ANY);
auto panel2 = new wxPanel(nb2, wxID_ANY);
auto tree2 = new wxTreeCtrl(panel2, wxID_ANY);
auto root2 = tree2->AddRoot("root");
auto si2 = new wxBoxSizer(wxVERTICAL);
tree2->AppendItem(root2, wxEmptyString);
si2->Add(tree2, 1, wxEXPAND);
panel2->SetSizer(si2);
si2->SetSizeHints(panel2);
nb2->AddPage(panel2, "tree", true);
auto si0 = new wxBoxSizer(wxHORIZONTAL);
si0->Add(nb1, 1, wxEXPAND);
si0->Add(nb2, 1, wxEXPAND);
SetSizer(si0);
si0->SetSizeHints(this);
};
};
class App : public wxApp {
public: bool OnInit(void) {
(new Main)->Show();
return true;
};
};
IMPLEMENT_APP(App);
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users