wxWindows for Ruby Again

Hello all,

Is anybody working on wxWindows for Ruby?

I know the project to wrap wxwindows for ruby called
wxruby(http://sourceforge.net/projects/wxruby/).
But I can’t see any change.

So I made my own version of wxruby adapted from wxPython only for
MS-Windows.
It just works but if fails to exit gracefully.
I wish someone maintain wxruby project for other platforms and document.

Download at http://www.physics.pe.ly/wxruby.zip

Requirement:
Visual C++ 6.0
wxWindows 1.3.2

Install:
Unzip wxruby.zip
nmake -f makefile.swig
nmake
ruby test.rb

Test code following

···

===========================================================
require 'wx’
include Wx

MENU_FILE_OPEN,MENU_FILE_SAVE,MENU_FILE_QUIT,MENU_INFO_ABOUT = 1…4

class TextFrame < WxFrame

def initialize(title,xpos,ypos,width,height)
super(nil, -1, title, WxPoint.new(xpos, ypos), WxSize.new(width, height))

@m_pTextCtrl = WxTextCtrl.new(self, -1, “Type some text…”,
Wx::wxDefaultPosition, Wx::wxDefaultSize, Wx::WxTE_MULTILINE)
@m_pMenuBar = WxMenuBar.new
@m_pFileMenu = WxMenu.new
@m_pFileMenu.Append(MENU_FILE_OPEN, “&Open”, “Opens an existing file”)
@m_pFileMenu.Append(MENU_FILE_SAVE, “&Save”, “Save the content”)
@m_pFileMenu.AppendSeparator();
@m_pFileMenu.Append(MENU_FILE_QUIT, “&Quit”, “Quit the application”)

@m_pMenuBar.Append(@m_pFileMenu, “&File”)
@m_pInfoMenu = WxMenu.new
@m_pInfoMenu.Append(MENU_INFO_ABOUT, “&About”, “Shows information about the
application”)
@m_pMenuBar.Append(@m_pInfoMenu, “&Info”)
SetMenuBar(@m_pMenuBar)
CreateStatusBar(3)
SetStatusText(“Ready”, 0)

end
def OnMenuFileOpen
puts "OnMenuFileOpen"
end
def OnMenuFileSave
puts "OnMenuFileSave"
end
def OnMenuFileQuit
Close(0)
end
def OnMenuInfoAbout
puts "OnMenuInfoAbout"
end

end

class WxApp < WxRbApp
def initialize
super
__wxStart(self)
end
def OnInit()
@frame = TextFrame.new(“Simple Text Editor”, 200, 200, 500, 500)
EVT_MENU(@frame, MENU_FILE_OPEN, “OnMenuFileOpen”)
EVT_MENU(@frame, MENU_FILE_SAVE, “OnMenuFileSave”)
EVT_MENU(@frame, MENU_FILE_QUIT, “OnMenuFileQuit”)
EVT_MENU(@frame, MENU_INFO_ABOUT, “OnMenuInfoAbout”)
@frame.Show()
SetTopWindow(@frame)
end

end

a = WxApp.new
a.MainLoop()

exit!

  • Park Heesob

Park Heesob wrote:

Hello all,

Is anybody working on wxWindows for Ruby?

I know the project to wrap wxwindows for ruby called
wxruby(http://sourceforge.net/projects/wxruby/).
But I can’t see any change.

We have just goten started on wxRuby, which is now hosted at savannah (we
plan, eventually, to mirror the project at sourceforge). The main homepage
for the project is the wiki which you can find at www.wxruby.org but you
won’t find much substance there, yet (as I said we are just getting
started).

So I made my own version of wxruby adapted from wxPython only for
MS-Windows.
It just works but if fails to exit gracefully.
I wish someone maintain wxruby project for other platforms and document.

Download at http://www.physics.pe.ly/wxruby.zip

Thanks, I just downloaded this and will evaluate it this weekend to see if
we can use your initial work to accelerate the project.

What is it about this port that makes it windows only?

Curt

···

Requirement:
Visual C++ 6.0
wxWindows 1.3.2

Install:
Unzip wxruby.zip
nmake -f makefile.swig
nmake
ruby test.rb

Test code following

require 'wx’
include Wx

MENU_FILE_OPEN,MENU_FILE_SAVE,MENU_FILE_QUIT,MENU_INFO_ABOUT = 1…4

class TextFrame < WxFrame

def initialize(title,xpos,ypos,width,height)
super(nil, -1, title, WxPoint.new(xpos, ypos), WxSize.new(width, height))

@m_pTextCtrl = WxTextCtrl.new(self, -1, “Type some text…”,
Wx::wxDefaultPosition, Wx::wxDefaultSize, Wx::WxTE_MULTILINE)
@m_pMenuBar = WxMenuBar.new
@m_pFileMenu = WxMenu.new
@m_pFileMenu.Append(MENU_FILE_OPEN, “&Open”, “Opens an existing file”)
@m_pFileMenu.Append(MENU_FILE_SAVE, “&Save”, “Save the content”)
@m_pFileMenu.AppendSeparator();
@m_pFileMenu.Append(MENU_FILE_QUIT, “&Quit”, “Quit the application”)

@m_pMenuBar.Append(@m_pFileMenu, “&File”)
@m_pInfoMenu = WxMenu.new
@m_pInfoMenu.Append(MENU_INFO_ABOUT, “&About”, “Shows
information about the
application”)
@m_pMenuBar.Append(@m_pInfoMenu, “&Info”)
SetMenuBar(@m_pMenuBar)
CreateStatusBar(3)
SetStatusText(“Ready”, 0)

end
def OnMenuFileOpen
puts "OnMenuFileOpen"
end
def OnMenuFileSave
puts "OnMenuFileSave"
end
def OnMenuFileQuit
Close(0)
end
def OnMenuInfoAbout
puts "OnMenuInfoAbout"
end

end

class WxApp < WxRbApp
def initialize
super
__wxStart(self)
end
def OnInit()
@frame = TextFrame.new(“Simple Text Editor”, 200, 200, 500, 500)
EVT_MENU(@frame, MENU_FILE_OPEN, “OnMenuFileOpen”)
EVT_MENU(@frame, MENU_FILE_SAVE, “OnMenuFileSave”)
EVT_MENU(@frame, MENU_FILE_QUIT, “OnMenuFileQuit”)
EVT_MENU(@frame, MENU_INFO_ABOUT, “OnMenuInfoAbout”)
@frame.Show()
SetTopWindow(@frame)
end

end

a = WxApp.new
a.MainLoop()

exit!

  • Park Heesob

Park Heesob wrote:

Hello all,

Is anybody working on wxWindows for Ruby?

I know the project to wrap wxwindows for ruby called
wxruby(http://sourceforge.net/projects/wxruby/).
But I can’t see any change.

So I made my own version of wxruby adapted from wxPython only for
MS-Windows.
It just works but if fails to exit gracefully.
I wish someone maintain wxruby project for other platforms and document.

Download at http://www.physics.pe.ly/wxruby.zip

Could you contribute this to the SourceForge/Savannah project?

···


Giuseppe “Oblomov” Bilotta

“E la storia dell’umanità, babbo?”
“Ma niente: prima si fanno delle cazzate,
poi si studia che cazzate si sono fatte”
(Altan)
(“And what about the history of the human race, dad?”
“Oh, nothing special: first they make some foolish things,
then you study which foolish things have been made”)

Hi,
“Curt Hibbs” curt@hibbs.com wrote in message
news:INEGJNJOFAMNDPNEABNEGEMJELAA.curt@hibbs.com

Park Heesob wrote:

Hello all,

Is anybody working on wxWindows for Ruby?

I know the project to wrap wxwindows for ruby called
wxruby(http://sourceforge.net/projects/wxruby/).
But I can’t see any change.

We have just goten started on wxRuby, which is now hosted at savannah (we
plan, eventually, to mirror the project at sourceforge). The main homepage
for the project is the wiki which you can find at www.wxruby.org but you
won’t find much substance there, yet (as I said we are just getting
started).

I’d glad to see www.wxruby.org is working on.
I belive WxRuby will be as powerful as WxPython in a few months.

So I made my own version of wxruby adapted from wxPython only for
MS-Windows.
It just works but if fails to exit gracefully.
I wish someone maintain wxruby project for other platforms and document.

Download at http://www.physics.pe.ly/wxruby.zip

Thanks, I just downloaded this and will evaluate it this weekend to see if
we can use your initial work to accelerate the project.

What is it about this port that makes it windows only?

Because I tested only in Windows XP.
It needs some modifications for other platforms.

Curt

Park Heesob

Giuseppe Bilotta wrote

Could you contribute this to the SourceForge/Savannah project?

He already did !

Curt

Curt Hibbs wrote:

Giuseppe Bilotta wrote

Could you contribute this to the SourceForge/Savannah project?

He already did !

Lovely :slight_smile:

···


Giuseppe “Oblomov” Bilotta

“E la storia dell’umanità, babbo?”
“Ma niente: prima si fanno delle cazzate,
poi si studia che cazzate si sono fatte”
(Altan)
(“And what about the history of the human race, dad?”
“Oh, nothing special: first they make some foolish things,
then you study which foolish things have been made”)