Qdow API

Window UI interfacing has arrived in Snap!

Introducing, Qdow API!

This API includes a variety of blocks!

Click here to view some of them!

Qdow API script pic

Qdow API script pic (2)

Qdow API script pic (1)

Qdow API script pic (3)

Qdow API script pic (4)

And much more inside the project!

And here are some features i'll add in the future! (Updated as in February 1 2023)
  1. Shadows under windows (scrapped because it will interfere with touching)
  2. Change font of the title bar (for the sake of a non-javascript experience)
  3. Add icons before the title bar (Working on it now!)
  4. Costumes to replace the title bar (Working on it now!)
  5. Pop-ups! (NaHBr0, too hard)
  6. (NEW!) disable some window buttons

Try it out by clicking here!

For people who used this API, here are the changelogs! (current version: 1.4.11)

Qdow API 1.0

  • first release

Qdow API 1.1

  • Added a window watcher variable to record x/y position
  • All windows now require WindowAPI to exist for window watcher to work.
  • Fixed a bug where the "close window" block only closes New Window

Qdow API 1.2

  • Added a rendering block to reduce space
  • Finally added a version comment on New Window
  • Added a customize block to change the window's appearance

Qdow API 1.3

  • Replaced the titlebar render block with a much more complex but faster version to reduce lag
  • Fixed Black Contents of window when rendering
  • removed Block Variables on the render block

Qdow API 1.4

  • fixed many bugs (I meant literally many which felt like decades)
  • 1.4.11

  • plans to remove the unmaximize block
  • modified the windows reporter to delete any unnecessary windows (closed windows)
  • Added a quick demo
  • Added borders
  • fixed rendering after adding borders
  • Optimized rendering with 75% accuracy

If you want to improve or report bugs on this project, you can post a comment on this post! I'll be sure to kindly check it out and add it inside the project. (and yes, i'll credit you.)

Looks very nice project :slight_smile:

One thing I noticed - if I create a new window and then maximise it and then un-maximise it - it doesn't return to it's previous position and size

Could that feature be added?

Oops! Everytime it resizes, it returns into the centre of the stage for better pen rendering. I'll fix that soon!

Maybe I'll use the name to save the positions and size because I'm too lazy to do variable listing...

Instead, use ids for each one, so there are no weird collisions.

Very nice! Good work!

i found a little bug...
this:
image
should be this:
image

As a little improvement, you could draw a border for the windows like this:
image
instead of this:
image

Hmm... I forgot to add those again?! (This happened 2 times before)

I was about to make it soon as I was fixing the resize, but thanks for giving the border concept!

I just woke up though, so maybe I'll release these patches soon enough!

Interesting idea! I had one big issue with it, and a couple of minor details about the programming.

The big issue is that the description of GO TO WINDOW led me to expect that the sprite would be attached to the window. You can do that with SET [MY ANCHOR] TO. Thereafter if you move the window, the sprite will move with it.

One small issue is that instead of


it's more Snap! ly to say

Strictly speaking, we don't make any promises about the order of the clones in the list reported by MY CLONES, so it's better to use the new clone directly in the TELL. (This is why having the reporter version is so much better than just the command!)

And one more, which is that you can save some time by taking advantage of hyperblock features. For example instead of


you can just

I haven't read all of the code but there are probably more such cases.

This part makes the title bar and the window body. Your modified version turns every pixel to that pixel, and it's not how i intended it to do. The code i made is not that complicated but it's optimized enough to make a window.

This one i can qualify as an optimization.

Ah, sorry. I still bet you could use RESHAPE but whatever.

How did you do that though? Did you edit it on an image editor? It's too complicated for me to make it...

Yeah, i made it in paint...

You need to modify the drawing process of the window...

Look at the


block in the Text Costumes library.

Kinda... I had this optimization idea using reshape and append:

I made a much faster way of rendering the window by extending the lists and connecting them using append. hope this might help with other beginners' projects

I don't know what you mean by that. Can you please explain?

Generate a unique ID for each window, and use that to identify different windows instead of using the window's name. This makes it so I can make more than one window with the same name.

That makes sense. Thank you so much for explaining!

Very cool! however, SnipOS 7 will not be adding the Qdow API. (yet.)

Sorry if this is a turn-off for some people, but I've already worked really hard on it since early January and I would have to redesign everything.

That's what significant updates are for. Try adding it anyway! I'd say all these previous updates weren't very "major," It was more like a "new app" and stuff that didn't need a new major version.

This update, however, is major. I am going to attempt to add something like it, OS7 will support more apps with windows, but for me to add resizing is something I really don't want to do, seeing as this version is releasing in about 8-9 days.

OS8 (Codename: Clementine) will have many new features I can't say.

I'm already beta-testing window resizing with ColdFusion Architecture, but that won't be for this major version.

If you want window resizing, and that's all you want, go to Frames OS.

If you want games, apps, community features, and more, go to SnipOS 6.