Re: resizing a drawingarea

On 04/10/2011 02:43 PM, Robert Pearce wrote:
Hi Kees,

On Sun, 10 Apr 2011 11:19:01 +0200 you wrote:
On 04/10/2011 10:30 AM, Povietkin Konstantin wrote:
В Вск, 10/04/2011 в 08:53 +0200, Kees Kling пишет:
I have a widget derived from Gtk::DrawingArea. This widget is placed in
a window. So far so good, but when I resize the window, the size of the
drawingarea stays the same. What must I do about that.

You should use Gtk::Viewport.
Do you mean deriving from Gtk::Viewport or adding the widget to a
viewport, because the latter doesn't work for me

I can't imagine why Konstantin thought a viewport was what you need. A
viewport is a device for making a large unshrinkable widget fit in a
small window by adding scroll bars.

Unless I'm mistaken, a DrawingArea just presents somewhere to use the
graphics primitives. It has very little inherent functionality. I
assume you're using the on_expose_event hook to do some drawing? I
think for resizing you will need to do something in the
on_size_allocate hook too. And you'll need to modify the drawing
algorithms in on_expose_event to take account of the new size.


gtkmm-list mailing list
gtkmm-list gnome org
Yes i'm using on_expose_event tyo do the drawing and I also has

the "virtual void on_size_allocate(Gtk::Allocation& allocation);" method. In this method I call ste_allocation(allocation) and I check on several places in my code what the geometry of the widget is and these are correct, but my drawingArea keeps its orginal size.

Pls Help


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]