Sha256: d138e54a09b82c49ba3b2c5ecac4a14692914aa2e1c6fdb764e93e5801434b8a
Contents?: true
Size: 954 Bytes
Versions: 11
Compression:
Stored size: 954 Bytes
Contents
#!/usr/bin/env ruby require 'Qt' class PassiveWindow < Qt::Frame MARGIN = 20 def initialize(message) super(nil, Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint | Qt::Tool | Qt::FramelessWindowHint) setFrameStyle(Qt::Frame::Box| Qt::Frame::Plain) setLineWidth(2) setMinimumWidth(100) layout = Qt::VBoxLayout.new(self) do |l| l.spacing = 11 l.margin = 6 end 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]) win.show app.exec
Version data entries
11 entries across 11 versions & 1 rubygems