Sha256: 334442180555cf64f9db220432fecca334d1e3037535c94fcb6c02f060df9071

Contents?: true

Size: 916 Bytes

Versions: 25

Compression:

Stored size: 916 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

25 entries across 23 versions & 3 rubygems

Version Path
rock-qtbindings-4.8.6.5 examples/passivepopup/passivepopup.rb
qtbindings-4.8.6.5 examples/passivepopup/passivepopup.rb
qtbindings-4.8.6.4 examples/passivepopup/passivepopup.rb
qtbindings-4.8.6.2 examples/passivepopup/passivepopup.rb
qtbindings-4.8.6.1 examples/passivepopup/passivepopup.rb
qtbindings-4.8.6.0 examples/passivepopup/passivepopup.rb
qtbindings-4.8.6.0-x86-mingw32 examples/passivepopup/passivepopup.rb
qtbindings-4.8.5.2 examples/passivepopup/passivepopup.rb
qtbindings-4.8.5.2-x86-mingw32 examples/passivepopup/passivepopup.rb
qtbindings-4.8.5.1 examples/passivepopup/passivepopup.rb
qtbindings-4.8.5.0 examples/passivepopup/passivepopup.rb
qtbindings-4.8.3.0-x86-mingw32 examples/passivepopup/passivepopup.rb
qtbindings-4.8.3.0 examples/passivepopup/passivepopup.rb
qtbindings-4.6.3.4-x86-mingw32 examples/passivepopup/passivepopup.rb
qtbindings-4.6.3.4 examples/passivepopup/passivepopup.rb
qtbindings-4.6.3.3 examples/passivepopup/passivepopup.rb
qtbindings-4.6.3.2-x86-mingw32 examples/passivepopup/passivepopup.rb
qtbindings-4.6.3.2 examples/passivepopup/passivepopup.rb
qtbindings-4.6.3.1 examples/passivepopup/passivepopup.rb
qtbindings-4.6.3.1-x86-mingw32 examples/passivepopup/passivepopup.rb