Class: PassiveWindow

Inherits:
Qt::Frame
  • Object
show all
Defined in:
ext/ruby/qtruby/examples/passivepopup/passivepopup.rb

Constant Summary collapse

MARGIN =
20

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ PassiveWindow

Returns a new instance of PassiveWindow.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'ext/ruby/qtruby/examples/passivepopup/passivepopup.rb', line 8

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

Instance Method Details

#showObject



25
26
27
28
29
# File 'ext/ruby/qtruby/examples/passivepopup/passivepopup.rb', line 25

def show
       super
       move(Qt::Application.desktop().width() - width() - MARGIN,
           Qt::Application.desktop().height() - height() - MARGIN)
end