On Fri, Sep 17, 2010 at 12:48:28PM +0200, David Unric wrote: > [...] > I'd need to figure out the position (x and y coordinates) of a widget placed > in > my wibox. Extents function, i.e. calling mywidget:extents() return table with > width and height fields only :-( > [...]
I'm afraid that's not easily possible. You could run the layout
function for the specific widget box with a flattened version (i.e.
in-order traversed) of the widget table. That way you'd get a
1-dimensional array of geometries with X and Y offsets to the X and Y
coordinates of the wibox.
The problem with getting a widgets geometry without specific regard to
the wibox it is in is that one widget can be in multiple widget boxes
with different layouts, i.e. in one wibox it could have a geometry of
say { x = 10, y = 10, width = 100, height = 16 } while in another the
geometry of the very same widget would be { x = 200, y = 0, width = 10,
height = 100 }.
--
$l="\n";$p=q-sub r{rand}sub c{((shift)**2+(shift)**2)<1}while(
$i++<=$s){$t++if c r,r}die("Gregor Best, 0xDB9F9A7C, ".($t/$s*
4).$l)-;$s+=ord$$|$_ for split //,$p;srand($s|$$);eval$p;die$@
pgpCeciYnzYQR.pgp
Description: PGP signature
