Cairo / GTK example code crashes when window is too big or maximized

Posted by user1890673 on Stack Overflow See other posts from Stack Overflow or by user1890673
Published on 2012-12-17T02:54:52Z Indexed on 2012/12/17 11:03 UTC
Read the original article Hit count: 282

Filed under:
|
|
|
|

I have copied and compiled the source code available in the section titled "Full Source".

http://cairographics.org/threaded_animation_with_cairo/

I adapted this code to a project that I'm working on only to find that the app would crash when I made the window too big. Going back to the original example code, it too crashes when the window is too big (> 1000x1000 or so).

I narrowed down in the example that this line appears to be responsible:

pixmap = gdk_pixmap_new(window->window,500,500,-1);

Where pixmap is of type GdkPixmap*. Resizing the window overwrites pixmap with a new pixmap that is the size of the window.

I am doing this in Eclipse Juno in Windows Vista, 32-bit. My compiler is MinGW version 0.5-beta-20120426-1. My GTK+ version is 2.24.10 and apparently Cairo is 1.10.2 I added all of the includes and libraries for GTK and also added compiler switch -mms-bitfields.

Is there a limit to the size of a pixmap or something? I'm just starting with GTK with examples so I'm not sure where to go if this example doesn't work.

© Stack Overflow or respective owner

Related posts about gtk

Related posts about mingw