Sujet : Re: are canvas coordinates limited to 32k
De : emil.g (at) *nospam* example.invalid (Emiliano)
Groupes : comp.lang.tclDate : 14. Apr 2025, 14:13:08
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250414101308.1fe25181451426d33806b1ca@example.invalid>
References : 1
User-Agent : Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu)
On Sun, 13 Apr 2025 20:44:50 -0700
et99 <
et99@rocketship1.me> wrote:
I've been experimenting with placing widgets inside a canvas. When I tried to test it's performance on lots of widgets (in a column) I am seeing the last few widgets not being displayed when the code does
[winfo reqheight $content]
where content is a frame and the value returned is over 32768 (actually starts failing just shy of that value).
This is X11 heritage. On X coordinates are limited to 32767.
$ wish9.1
% frame .f -width 32768
.f
% pack .f
% X Error of failed request: BadAlloc (insufficient resources for operation)
Major opcode of failed request: 53 (X_CreatePixmap)
Serial number of failed request: 137
Current serial number in output stream: 144
This limitation is hardcoded in Tk API as well. For example, the function
Tk_CanvasDrawableCoords(
Tk_Canvas canvas,
double x,
double y,
short *drawableXPtr,
short *drawableYPtr);
can't return coordinates bigger than 32767 for the canvas drawable.
-- Emiliano