diff options
author | culler <culler> | 2018-11-19 16:46:35 (GMT) |
---|---|---|
committer | culler <culler> | 2018-11-19 16:46:35 (GMT) |
commit | 0a42f0a076ef817fb754688b9ec08860bee20569 (patch) | |
tree | 96618a9c28994931d2365080ff6c028c9dbd04b2 /generic/ttk | |
parent | dd4ed400b944368e798553efd57cffeb83f1d91d (diff) | |
download | tk-0a42f0a076ef817fb754688b9ec08860bee20569.zip tk-0a42f0a076ef817fb754688b9ec08860bee20569.tar.gz tk-0a42f0a076ef817fb754688b9ec08860bee20569.tar.bz2 |
Use XCreateImage instead of XGetImage to create a scratch image in ttkDefaultTheme.c
Diffstat (limited to 'generic/ttk')
-rw-r--r-- | generic/ttk/ttkDefaultTheme.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index 4a06192..20ba013 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -510,7 +510,7 @@ static void IndicatorElementDraw( XGCValues gcValues; GC copyGC; unsigned long imgColors[8]; - XImage *img; + XImage *img = NULL; Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &padding); b = Ttk_PadBox(b, padding); @@ -550,11 +550,17 @@ static void IndicatorElementDraw( /* * Create a scratch buffer to store the image: */ - img = XGetImage(display,d, 0, 0, - (unsigned int)spec->width, (unsigned int)spec->height, - AllPlanes, ZPixmap); - if (img == NULL) - return; + + img = XCreateImage(display, NULL, 32, ZPixmap, 0, NULL, + (unsigned int)spec->width, (unsigned int)spec->height, + 0, 0); + if (img == NULL) { + return; + } + img->data = ckalloc(img->bytes_per_line * img->height); + if (img->data == NULL) { + return; + } /* * Create the image, painting it into an XImage one pixel at a time. @@ -572,7 +578,6 @@ static void IndicatorElementDraw( */ memset(&gcValues, 0, sizeof(gcValues)); copyGC = Tk_GetGC(tkwin, 0, &gcValues); - TkPutImage(NULL, 0, display, d, copyGC, img, 0, 0, b.x, b.y, spec->width, spec->height); |