diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 90825e2392b2d70e43c7a25b8a3752299a933894 (patch) | |
tree | e33aa27f02b74604afbfd0ea4f1cfca8833d882a /kjsembed/docs/examples/multipart | |
download | tdebindings-90825e2392b2d70e43c7a25b8a3752299a933894.tar.gz tdebindings-90825e2392b2d70e43c7a25b8a3752299a933894.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kjsembed/docs/examples/multipart')
-rw-r--r-- | kjsembed/docs/examples/multipart/multipart.js | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/kjsembed/docs/examples/multipart/multipart.js b/kjsembed/docs/examples/multipart/multipart.js new file mode 100644 index 00000000..89402f79 --- /dev/null +++ b/kjsembed/docs/examples/multipart/multipart.js @@ -0,0 +1,56 @@ +#!/usr/bin/env kjscmd + +// +// Example of loading several parts from a script +// + +// +// Main +// +var qd = new QDir(); + +var dir = 'file://' + qd.path() + '/../'; +var file = dir + 'index.html'; + +// Create the UI +var mw = new KParts_MainWindow(); +var ac = mw.actionCollection(); + +var split = new QSplitter( mw ); +mw.setCentralWidget( split ); + +// +// Load the sidebar +// +var side = Factory.createROPart( "inode/directory", split, "sidebar" ); + +// +// Load the views +// +var views = new QSplitter( split ); +views.orientation = 1; + +var top = Factory.createROPart( "text/html", views, "html" ); + +var bottom = Factory.createROPart( "text/plain", views, "source" ); + +// +// Glue it together +// +top.connect(side.child(0), 'openURLRequest(const KURL&,const KParts::URLArgs&)', 'openURL(const KURL&)' ) +bottom.connect(side.child(0), 'openURLRequest(const KURL&,const KParts::URLArgs&)', 'openURL(const KURL&)' ) + +side.openURL( dir ); +top.openURL( file ); +bottom.openURL( file ); + +// +// Activate XMLGUI and show the window +// +StdAction.quit( mw, 'close()', mw.actionCollection() ); + +mw.resize( 700, 500 ); +split.child(1).maximumWidth = 200; + +mw.show(); +application.exec(); |