Skip to content

Instantly share code, notes, and snippets.

@opamp
Created October 6, 2011 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save opamp/1267292 to your computer and use it in GitHub Desktop.
Save opamp/1267292 to your computer and use it in GitHub Desktop.
QtRuby超簡易メモ帳
require 'Qt4'
class MainWidget < Qt::Widget
def initialize
super
q_button = Qt::PushButton.new('quit')
connect(q_button,SIGNAL('clicked()'),$qApp,SLOT('quit()'))
txtedit = Qt::TextEdit.new
layout = Qt::VBoxLayout.new
layout.add_widget(txtedit)#,0,Qt::AlignCenter)
layout.add_widget(q_button)#,0,Qt::AlignRight)
self.setLayout(layout)
end
end
class Mainwin < Qt::MainWindow
def initialize
super
@mainwid = MainWidget.new
self.window_title = "easye"
resize(500,400)
setCentralWidget(@mainwid)
end
end
#!/usr/bin/env ruby
#-*- encoding:utf-8 -*-
#require 'easye'
require './easye'
easye = Qt::Application.new ARGV
window = Mainwin.new
window.show
easye.exec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment