Is Stack & Tile scriptable?

What the title says. Is it possible to tell one window on your system to stack and/or tile itself to another, in a script, perhaps using hey?

Pretty sure the answer to that is no. And I doubt there are currently plans to implement that after all the other themed decorators haven’t been ported to stack and tile yet either…

So if you wanted that feature you’d probably have to implement it yourself. You could ask on the mailling list if the developers think it would be a desireable feature…

There’s no public API for this yet. There’s a private API for stacking windows that apps can integrate; but not yet so for tiling.

This would be a kickass feature to implement though :slight_smile:

There may be a problem of grabbing a “handle” to the other window through scripting. It can’t be done with pointers, because the other window could be in a different address space. I’m not sure how the “hey” syntax would look like then, as hey can only work with one app at a time.

However, I also think it would be great to have this as well as a tiling API and a more complete stacking API.

1 Like

Thanks, all. cb88: waaaaayyy above my paygrade, sorry.

let me explain the sort of thing I had in mind. yes, there’d have to be an API, but when I say “scriptable” I mean that there is a cli utility that exposes the APi to scripting, in bash, python, yab, perl, whatever. let’s call it “tiler”

So I write an app “ColumnofButtons” that is essentially a vertical button bar and the first thing it does is make a SYSTEM call to tiler:

tiler ColumnofButtons StyledEdit

And a new instance of StyledEdit automagically appears and tiles itself to the right of my button bar. We can now make a wide variety of specialised text editors quickly and easily. Actually communicating between the two tiled apps would have to be done by hey or its descendant.Apply the same principle to webkit and you can have cheap and easy site-specific browsers.

Anyway, it was just a thought. Thanks for the responses.

first we need the API. There are some experiments with it already (for example the NetSurf browser uses the stacking API to do tabbed browsing). Once the API is there we can try to expose it through scripting at the BWindow level. This means you could use hey to send messages to any window to handle the stacking and tiling. This part is currently missing, but we should think about adding it as it would be in line with what Haiku should be (I think). I opened a ticket to track this: https://dev.haiku-os.org/ticket/11847

meanwhile, are replicants a good compromise?

@spinach: Good question. Replicants were created by Be and recreated for Haiku and that seems to have been it. I understand, priorities and all that. But even in the BeOS days few people made use of them, and I’m not aware of anyone having given serious thought to what could be done with this technology. Then again, I don’t read the R2 discussions.

ATM I am not finding replicants very stable, and when one goes bad, you need to delete tracker_shelf and lose ALL the replicants on your carefully-crafted desktop. Not good. Needs a rethink IMHO. Maybe an automated backup of tracker_shelf and a “Recreate desktop” preference.

But to make replicants do what I propose above you would need

  1. a container other than the desktop and deskbar.
  2. an OS-wide facility to make everything able to be replicated.

That would be kickass.

you actually can make shelves other than the desktop – at least, i think you can? i’m kinda sure of it, yeah. you definitely wouldn’t want to put all of everything just on the desktop – i usually reserve that for system monitor and workspaces, myself.

Yes, you can host replicants anywhere. An example “test” application doing this is SHelfer.

There are actually some interesting uses of replicants in BeOS apps, for example NetPositive HTML view could be embedded in other applications, which brought an "active desktop" like feature to BeOS ("in 10 lines of code", Be marketing department used to say when Windows 98 made that a major new feature), but was used in more useful ways too, such as BeHappy embedding it in a documentation browser.