wxruby-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wxruby-dev] RE: wxWindows for Ruby Again


From: Curt Hibbs
Subject: [Wxruby-dev] RE: wxWindows for Ruby Again
Date: Fri, 20 Sep 2002 07:49:47 -0700

-----Original Message-----
From: Curt Hibbs [mailto:address@hidden
Sent: Friday, September 20, 2002 3:05 AM
To: ruby-talk ML
Cc: wxRuby
Subject: RE: wxWindows for Ruby Again


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
>
>
>
>






reply via email to

[Prev in Thread] Current Thread [Next in Thread]