On Wed, 16 Feb 2005, Tuomo Valkonen wrote: > On Wed, Feb 16, 2005 at 06:10:27PM +0000, David Tweed wrote: > > Hi, has anyone previously figured out a way to produce a list of all the > > windows on a workspace in lua? > > 1) Use WIonWS.managed_list to find the frames on the workspace, and > then WMPlex.llist (WFrame.llist) to find the client windows in them > and so on.
I'm a bit dense and not completely together on Ion's object hierarchies. Can I just check that this pseudocode is expressing the right thing to look at? For a WIonWS w, 1 iterate over the "things" o in o:managed_list() 2 for each o call a function analyse(o) ----------- 3 function analyse(o) iterates over "things" r in o:llist(1) 3 for each r set typ=obj_typename(r) 4 if typ=="WClientWin" it should be added to the table of client windows 5 else if typ=="WFrame" or "WSplit" recursively call analyse(r) 6 else its something irrelevant (and possibly dangerous to call llist on), so just ignore it > 2) Use ioncore.clientwin_list and filter it by scanning downwards > with WRegion.manager (ioncore.find_manager might also be of use, but > its behaviour might not be desired in all cases). Is the manager of a client in a frame the frame object, so that you'd have to `climb-up' until reaching a WIonWS object? Many thanks for the help, -- __cheers, dave____________________________________________ homepages.inf.ed.ac.uk/dtweed/ tel: +44 131 651 3447 JCMB, Kings Buildings, Edinburgh fax: +44 131 651 3435 X wrote a book about this, which Y was carrying around for a long time with little discernible effect -- John Baez
