summaryrefslogtreecommitdiffstats
path: root/qtruby/rubylib/examples/passivepopup/passivepopup.rb
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit90825e2392b2d70e43c7a25b8a3752299a933894 (patch)
treee33aa27f02b74604afbfd0ea4f1cfca8833d882a /qtruby/rubylib/examples/passivepopup/passivepopup.rb
downloadtdebindings-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 'qtruby/rubylib/examples/passivepopup/passivepopup.rb')
-rw-r--r--qtruby/rubylib/examples/passivepopup/passivepopup.rb39
1 files changed, 39 insertions, 0 deletions
diff --git a/qtruby/rubylib/examples/passivepopup/passivepopup.rb b/qtruby/rubylib/examples/passivepopup/passivepopup.rb
new file mode 100644
index 00000000..37f60c1f
--- /dev/null
+++ b/qtruby/rubylib/examples/passivepopup/passivepopup.rb
@@ -0,0 +1,39 @@
+#!/usr/bin/env ruby
+
+require 'Qt'
+
+class PassiveWindow < Qt::Frame
+ MARGIN = 20
+
+ def initialize(message)
+ super(nil, "passivedlg",
+ Qt::WStyle_Customize | Qt::WX11BypassWM | Qt::WStyle_StaysOnTop |
+ Qt::WStyle_Tool | Qt::WStyle_NoBorder)
+
+ setFrameStyle(Qt::Frame::Box| Qt::Frame::Plain)
+ setLineWidth(2)
+
+ setMinimumWidth(100)
+ layout=Qt::VBoxLayout.new(self, 6, 11)
+ layout.setAutoAdd(true)
+ Qt::Label.new(message, self)
+
+ quit=Qt::PushButton.new(tr("Close"), self)
+ connect(quit, SIGNAL("clicked()"), SLOT("close()"))
+ end
+
+ def show
+ super
+ move(Qt::Application.desktop().width() - width() - MARGIN,
+ Qt::Application.desktop().height() - height() - MARGIN)
+ end
+end
+
+if (Process.fork != nil)
+ exit
+end
+app = Qt::Application.new(ARGV)
+win = PassiveWindow.new(ARGV[0])
+app.mainWidget = win
+win.show
+app.exec