Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

resizing widget in pygtk

Tags:

size

widget

pygtk

I have a scrolled window, which contains a drawing area in pygtk. I would like to change the size of the drawing area, and keep the scrolled window as it is. I don't find a function that works on widgets. I can get the size and so on, but I can't set it. Could someone give me a pointer to the solution?

Thanks,

v923z

like image 731
v923z Avatar asked Nov 19 '11 17:11

v923z


1 Answers

It sounds like .set_size_request() is what you need. An example would be:

drawingarea.set_size_request(400, 400)

The values are the width and height of the canvas. Assuming you're ScrolledWindow is setup correctly, the scrollbars should adjust automatically to the size of the DrawingArea.

like image 137
Andrew Steele Avatar answered Nov 13 '22 08:11

Andrew Steele