Panel hiding while creation Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
MuhammadSohail
Experienced Solver
Experienced Solver
Posts: 96
Joined: Fri Jun 17, 2005 1:53 pm
Location: Germany
Contact:

Panel hiding while creation

Post by MuhammadSohail »

Hi all,

My program is reading the ini file to get the total number of panels info. In the main dialog at the right top left corner , panel creation is displayed.Where as i m hiding the each panel after creation.

wxPanel * panel = new wxPanel(this, -1 );
panel->Hide();

Some one can help me , how can i hide the panels .

Thanks
Sohail
phlox81
wxWorld Domination!
wxWorld Domination!
Posts: 1387
Joined: Thu Aug 18, 2005 7:49 pm
Location: Germany
Contact:

Post by phlox81 »

panel->Show(false);
MuhammadSohail
Experienced Solver
Experienced Solver
Posts: 96
Joined: Fri Jun 17, 2005 1:53 pm
Location: Germany
Contact:

Post by MuhammadSohail »

i tried this function
panel->Show(false) but it is not helpful.

Does any one knows other way

Thanks
upCASE
Moderator
Moderator
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE »

Hi!
If you're using sizers for adding the panels, hiding should work if you trigger a re-layout of the sizer after creating the panels.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
MuhammadSohail
Experienced Solver
Experienced Solver
Posts: 96
Joined: Fri Jun 17, 2005 1:53 pm
Location: Germany
Contact:

Post by MuhammadSohail »

Hi

I am inserting the panels into the vector container.


Thanks
phlox81
wxWorld Domination!
wxWorld Domination!
Posts: 1387
Joined: Thu Aug 18, 2005 7:49 pm
Location: Germany
Contact:

Post by phlox81 »

Muhammad Sohail wrote:Hi

I am inserting the panels into the vector container.


Thanks
Then panel->Show(false) should work.
If the panel is within a sizer, you need to detach the panel first.

phlox
MuhammadSohail
Experienced Solver
Experienced Solver
Posts: 96
Joined: Fri Jun 17, 2005 1:53 pm
Location: Germany
Contact:

Post by MuhammadSohail »

Hi all,

Panel hiding is functioning with both functions
panel->Show(false)
panel->Hide()

The real problem, While creating the panels, small square transparent window in the right top corner of the wxDialog is appeared. This small
window i dont want to show.

Does anone knows

thanks
phlox81
wxWorld Domination!
wxWorld Domination!
Posts: 1387
Joined: Thu Aug 18, 2005 7:49 pm
Location: Germany
Contact:

Post by phlox81 »

Muhammad Sohail wrote:Hi all,

Panel hiding is functioning with both functions
panel->Show(false)
panel->Hide()

The real problem, While creating the panels, small square transparent window in the right top corner of the wxDialog is appeared. This small
window i dont want to show.

Does anone knows

thanks
Hm, you need to derive a panelclass from wxPanel, and call wxPanel::Show(false)
in its constructor. I am doing it this way, and it works for me.

phlox
MuhammadSohail
Experienced Solver
Experienced Solver
Posts: 96
Joined: Fri Jun 17, 2005 1:53 pm
Location: Germany
Contact:

Post by MuhammadSohail »

It works.. Thanks a lot

sohail
Post Reply