Created
October 6, 2011 12:32
-
-
Save opamp/1267292 to your computer and use it in GitHub Desktop.
QtRuby超簡易メモ帳
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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