Re: Invisible GtkImage



On Sun, 2013-06-23 at 21:17 +0200, zz excite it wrote:

Hi,
maybe adding a callback to a window signal and redraw the image could be an option?

take a look at http://zetcode.com/tutorials/gtktutorial/gtkevents/

gtk_widget_add_events(GTK_WIDGET(window), GDK_CONFIGURE);

"The event mask of the widget determines, what kind of event will a particular widget receive.
Some event are preconfigured, other events have to be added to the event mask.
The gtk_widget_add_events() adds a GDK_CONFIGURE event type to the mask.
The GDK_CONFIGURE event type accounts for all size, position and stack order events."

 g_signal_connect(G_OBJECT(window), "configure-event",
     G_CALLBACK(your_callback), NULL);


Just an idea.

Ciao,
ZZ

Hey ZZ,

It's a good idea, but it's tough to implement because if you are talking
about resizing a GtkImage widget dynamically, I don't think it's really
designed to do that. I think some of its internal data functions on the
assumption that it won't resize. I think the GtkDrawingArea widget can
be dynamically resized and, as long as the client takes responsibility
for resizing whatever pixels that are to be painted on it, it should
work.

The trick at this point is to try and get the AspectFrame and
DrawingArea to resize and expand in the right way which seems very
difficult so far.

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com


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