ensuring that a resize has been actualised



Hi,

in gimmage I catch the configure_event signal in order to resize the
image to fit the viewing area if the user resizes the window.

I query the width and height of an internal widget (a scrolled window)
but connect to the top window's configure_event signal because for some
strange reason the internal widget does not emit the signal (even though
it is clearly resized together with the top window). This of course
brings the problem that the resizing is not actually finished when I
query width/height and I zoom the image to the wrong size.

I even tried working around it by querying only the size of the top
level window and subtracting the height/width of all other widgets, but
even that does not give the correct values. Uncommenting the iteration
forcing does not help either!

----------------

// AppWindow.cpp

signal_configure_event().connect_notify(sigc::mem_fun(*this,&AppWindow::on_my_configure_event));

[...]

void AppWindow::on_my_configure_event( GdkEventConfigure* event )
	{
	std::cout << "configure event" << std::endl;
	//while(Gtk::Main::events_pending()) Gtk::Main::iteration();
	ImageBox.ScaleImage2(ImageScroller.get_width()-4,
			ImageScroller.get_height()-4,&scalefactor);
	}

-----------

when I do this instead, nothing happens, but it would be REALLY great if
this worked!

ImageScroller.signal_configure_event()...

------------


Any ideas?

-Bartek



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