Re: Followup with code, Gdk/X integration



On Tue, 2004-12-21 at 14:41, Carl Nygard wrote:
> See attached code sample.  Compile with:
> 
> g++ -o resize resize.cxx -L/usr/X11R6/lib `pkg-config --libs --cflags
> gtkmm-2.0` -lXm -lXt -lX11 -lm
> 
> 
> Run resize:
> 
> [carl traveler raster]$ ./resize
> //--------------hit button at startup
> create new info
> Straight X: XID(83886103) dims: width = 500 height = 300 pos: 0,25
> X Via Gdk::Drawable: XID(83886103) dims: width = 500 height = 300 pos: 0,25
> Gdk::Drawable: 500,300
> 
> //-------------resize in X direction, hit button
> Straight X: XID(83886103) dims: width = 702 height = 300 pos: 0,25
> X Via Gdk::Drawable: XID(83886103) dims: width = 702 height = 300 pos: 0,25
> Gdk::Drawable: 500,300     //------------- note unchanged
> 
> //-------------resize in Y direction, hit button
> Straight X: XID(83886103) dims: width = 702 height = 441 pos: 0,25
> X Via Gdk::Drawable: XID(83886103) dims: width = 702 height = 441 pos: 0,25
> Gdk::Drawable: 500,300     //------------- note unchanged
> 
> 
> I don't know why the Gdk::Drawable still thinks it's the same old size
> as when it was initialized, even though the underlying X window is
> resized.

I'm not really sure why, but the answer is:

recreate the Gdk::Drawable object every time the Widget (or Window)
resizes, and you have to call XFlush() and XSync() before recreating the
Gdk::Drawable.

Cheerio




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