Aylur / ags

A customizable and extensible shell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting width/height elements

myryk31415 opened this issue · comments

I wanna use the width of the elements to hide them if the screen is not wide enough to show them all.
Is there any way to get the width/height of elements?

I could get the min-width from the css manually but that seems a bit tedious and also doesn't reflect the actual width accuratly.

const allocation = widget.get_allocation();
const width = allocation.width;
const height = allocation.height;
const x = allocation.x;
const y = allocation.y;


const width = widget.get_allocated_width()
const height = widget.get_allocated_height()

might be useful as well:
a widget will emit a size-allocatesignal when its size changed.

Thanks a lot :)

Where do I find documentation of stuff like that? Not the ags-wiki right? GTK docs?