#!/usr/local/bin/ruby
=begin
/****************************************************************
**
** Qt tutorial 5
**
****************************************************************/
=end
require "qt2"
include Qt2

class MyWidget  <  QVBox

def initialize( parent=0, name=0 )
     super (parent, name)

    quit = QPushButton.new( "Quit", self, "quit" )
    quit.setFont( QFont.new( "Times", 18, QFont::Bold ) )

    connect( quit, QSIGNAL("clicked()"), QApplication::qApp, "quit()" )

    lcd  = QLCDNumber.new( 2, self, "lcd" )

    slider = QSlider.new( 0,99,0,10,Horizontal, self, "slider" )
    slider.setRange( 0, 99 )
    slider.setValue( 0 )

    connect( slider, QSIGNAL("valueChanged(int)"), lcd, "display(int)" )
end
end

    a = QApplication.new( [$0]+ARGV )

    w = MyWidget.new
    a.setMainWidget( w )
    w.show()
    a.exec()

