Last Enhancements of V 1.3


This javascript class allows you to add window in a HTML page.

This class is based on Prototype. The code is inspired by the powerful library. You can even use all effects to show and hide windows if you include effects.js file , but it's not mandatory.

It has been tested on Safari, Camino, Firefox and IE6, Opera looks fine.


Belorussian (thanks to Paul Bukhovko)


How to Use

It's easy to use, just include two javascripts and one css (more if you want different skins).

<script type="text/javascript" src="/javascripts/prototype.js"> </script> <script type="text/javascript" src="/javascripts/window.js"> </script> <link href="/stylesheets/themes/default.css" rel="stylesheet" type="text/css"/> <!-- Add this to have a specific theme--> <link href="themes/mac_os_x.css" rel="stylesheet" type="text/css"/>

To create a window, you just have to instanciate a Window object with some optional parameters, set innerHTML of the window main content and call show() or showCenter() function. Check out the samples tab with more sample codes

win = new Window({className: "mac_os_x", title: "Sample", width:200, height:150, destroyOnClose: true, recenterAuto:false}); win.getContent().update("<h1>Hello world !!</h1>"); win.showCenter();

Test it

PWC-OS Sample

There is a lot of way to use PWC, modal dialogs, tooltips. I decided to create a light WebOS using PWC. It's a good example if you want to start to use it as a window manager.
Full code is included in the distrib (about only 50 lines of code!!).
I will post new features on my PWC section of my blog.

Try it now


Only for French readers!

If you use Prototype and (and you do, since you are interested in PWC), I recommend this excellent book by Christophe Porteneuve. Not only does it provide in-depth coverage of Prototype and, it also talks about CSS/XHTML/RSS/REST, and more.
All code samples can be downloaded and give you a deep understanding of those frameworks.

English readers, Wait, Christophe is writing a book for Pragmatics Programmers, it will be available soon, stay tuned :)

Thanks to

- Vincent Le Moign (Webalys) for the logo, PWC-OS dock bar and MORE!!!
- Jorge Díaz ( for the rails helper
- A lot of contributors like Irfan Jamadar, Felix Shnir, Dan Atkinson, Brice Joly, Nick Hemsley, Richard Piacentini and more (sorry If I forgot your name)


This library is licensed under a MIT-style license, so you can use it for anything you like, as long as you include the copyright notice.