Widget size: can a widget "know" its height & width?

Is there a way to import the current width & height of a widget and use them in calculations? (In any unit! I know KWGT has some interesting . . . features . . . regarding size units. I can work with that as long as I know the hardware screen res and maybe the launcher's row/column spec.)

For example: I'm trying to build a smart music widget that knows whether it's got a PORTRAIT or LANDSCAPE aspect ratio so it can decide to display album art & track info as either right/left panels or top/bottom panels. I want it to be able to make that decision dynamically if you resize the widget. That's just one example.

  • You have the si(rwidth) and si(rheight) that give you the size of the widget (root container) in kustom points.

Awesome! Thanks. I must have missed that.