Class: QtWindow

Inherits:
Object show all
Defined in:
lib/knj/libqt_window.rb

Class Method Summary collapse

Class Method Details

.doCenter(tha_window) ⇒ Object



2
3
4
5
6
7
8
9
# File 'lib/knj/libqt_window.rb', line 2

def self.doCenter(tha_window)
  qdw = Qt::DesktopWidget.new
  
  move_left = (qdw.width / 2) - (tha_window.width / 2)
  move_top = (qdw.height / 2) - (tha_window.height / 2)
  
  tha_window.move(move_left, move_top)
end