I have a grid control in a panel and two other panels in the frame. I generate the grid dynanmically and would like to set the size of the frame such that grid is exactly fit and there are no scrollers. How do I do this?
Yes, I am using sizers. But I got a feeling that whatever I do with sizers, it’s not going to change the size of my main frame and I would like to do that based up on the size of the grid. Then I tried reading the size of the grid using grid.GetSize() and it returns the current size of the grid. How do you get the expanded size(with no scrollers) of a grid if I want to use this size to enforce size of the frame.
I guess you have to set to do something like this:
grid.SetMinSize(grid.GetSize())
Afterwards you have to layout and fit your main frame again.
Stani
···
--
Ananda Regmi wrote:
Greetings,
I have a grid control in a panel and two other panels in the frame. I
generate the grid dynanmically and would like to set the size of the frame
such that grid is exactly fit and there are no scrollers. How do I do this?
Yes, I am using sizers. But I got a feeling that whatever I do with sizers,
it's not going to change the size of my main frame and I would like to do
that based up on the size of the grid. Then I tried reading the size of the
grid using grid.GetSize() and it returns the current size of the grid. How
do you get the expanded size(with no scrollers) of a grid if I want to use
this size to enforce size of the frame.
I have a grid control in a panel and two other panels in the frame. I
generate the grid dynanmically and would like to set the size of the frame
such that grid is exactly fit and there are no scrollers. How do I do this?
Yes, I am using sizers. But I got a feeling that whatever I do with sizers,
it’s not going to change the size of my main frame and I would like to do
that based up on the size of the grid. Then I tried reading the size of the
grid using grid.GetSize() and it returns the current size of the grid. How
do you get the expanded size(with no scrollers) of a grid if I want to use
Probably something like this (self=frame), supposing that the grid is in
the first sizer of your frame:
self.grid.SetMinSize(self.grid.GetVirtualSize())
self.SetMinSize(self.GetSizer().GetMinSize())
self.Fit()
The size you are after is the virtual size, which you want to match with
the visible client size. (So this was wrong in my first post.)
Stani
···
--
Ananda Regmi wrote:
Thanks for the response Stani..
Would you mind elaborating a little on "Afterwards you have to layout and
fit your main frame again."
Ananda
On 6/21/07, Stani's Python Editor <spe.stani.be@gmail.com> wrote:
I guess you have to set to do something like this:
grid.SetMinSize(grid.GetSize())
Afterwards you have to layout and fit your main frame again.
Stani
-- http://pythonide.stani.be
Ananda Regmi wrote:
> Greetings,
>
> I have a grid control in a panel and two other panels in the frame. I
> generate the grid dynanmically and would like to set the size of the
frame
> such that grid is exactly fit and there are no scrollers. How do I do
this?
>
> Yes, I am using sizers. But I got a feeling that whatever I do with
sizers,
> it's not going to change the size of my main frame and I would like to
do
> that based up on the size of the grid. Then I tried reading the size of
the
> grid using grid.GetSize() and it returns the current size of the grid.
How
> do you get the expanded size(with no scrollers) of a grid if I want to
use
> this size to enforce size of the frame.
>
> Thanks in advance,
>
> Ananda
>
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
I have a grid control in a panel and two other panels in the frame. I
generate the grid dynanmically and would like to set the size of the
frame such that grid is exactly fit and there are no scrollers. How do I
do this?
I think, this is tricky. At least you can't do that only by relying on the
sizing mechanism of sizers. See that thread:
I have a grid control in a panel and two other panels in the frame. I
generate the grid dynanmically and would like to set the size of the
frame such that grid is exactly fit and there are no scrollers. How do I
do this?
I think, this is tricky. At least you can’t do that only by relying on the
sizing mechanism of sizers. See that thread: