wFrame size 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
msdobrescu
Knows some wx things
Knows some wx things
Posts: 35
Joined: Wed Sep 08, 2004 6:22 am

wFrame size

Post by msdobrescu »

Hello,

I have an wxApp based on wxFrame.
How could I set the size of the wxFrame programatically (from a menu for example)?

Thanks,
Mike.
TrV
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 630
Joined: Wed Jul 04, 2007 1:12 pm

Post by TrV »

mikeandtherest
Experienced Solver
Experienced Solver
Posts: 50
Joined: Fri Jul 24, 2009 5:27 pm
Location: Cluj-Napoca, Romania

Post by mikeandtherest »

Hi!

Let's say you have a button on your frame. This code will change the frame`s dimensions

Code: Select all

void MyFrame::WxButton3Click(wxCommandEvent& event)
{
	SetSize( 800, 600 );
}
This SetSize method has more parameters(it's overloaded) so it can be used in other ways. But this is the simplest way to achieve what you need. Read more here http://docs.wxwidgets.org/2.6/wx_wxwind ... dowsetsize

Cheers,
Mihai Paraschivescu
"The Journey Of A Thousand Miles Begins With A Single Step"
msdobrescu
Knows some wx things
Knows some wx things
Posts: 35
Joined: Wed Sep 08, 2004 6:22 am

Post by msdobrescu »

Thank you, it worked. Good lesson: look into parents' documentation! :D
Post Reply