Lisp HUG Maillist Archive

Coordinates of origin of pane in tab layout

I'd like to find the cursor position relative to the origin of a 
scrollable pinboard-layout which is an element of a tab-layout.

I can get the cursor coordinates relative to the pinboard-layout, but 
this is no good, because the pane might be scrolled and the slug 
position is in arbitrary units.

Since I can get the cursor coordinates relative to the screen, if I 
could find the screen coordinates of the pane's top left corner I could 
subtract them.

Converting 0,0 to screen coordinates from pane doesn't work because of 
the possibility of scrolling. Converting 0,0 from the tab-layout 
includes the border and possibly tabs.

Is there a way to find the dimensions of the tab-layout's border and 
tabs?  Or a more direct way?

Mitch


Re: Coordinates of origin of pane in tab layout

> I'd like to find the cursor position relative to the origin of a 
> scrollable pinboard-layout which is an element of a tab-layout.
> 
> I can get the cursor coordinates relative to the pinboard-layout, but 
> this is no good, because the pane might be scrolled and the slug 
> position is in arbitrary units.
> 
> Since I can get the cursor coordinates relative to the screen, if I 
> could find the screen coordinates of the pane's top left corner I could 
> subtract them.
> 
> Converting 0,0 to screen coordinates from pane doesn't work because of 
> the possibility of scrolling. Converting 0,0 from the tab-layout 
> includes the border and possibly tabs.
> 
> Is there a way to find the dimensions of the tab-layout's border and 
> tabs?  Or a more direct way?

A workable, but not pleasing, way to do this is to store the offset 
between the tab-layout and its pane at initialization before the pane is 
scrolled and then use this as a parameter.

Mitch


Updated at: 2020-12-10 08:44 UTC