百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
W

wxRuby3

> 数据库
开源

Ruby 跨平台 GUI 扩展

183 stars0 点赞4 次浏览
访问官网GitHub

工具介绍

Ruby 跨平台 GUI 扩展

README for wxRuby3

Reviving wxRuby

Introduction

wxRuby3 is a cross-platform GUI library for Ruby, based on the mature wxWidgets GUI toolkit for C++. It uses native widgets wherever possible, providing the correct look, feel and behaviour to GUI applications on Windows, macOS and Linux/GTK. wxRuby aims to provide a comprehensive solution to developing professional-standard desktop applications in Ruby.

Usage examples

Hello world

wxRuby3 is very easy to use.

ruby
require 'wx'

Wx::App.run do
  Wx::Frame.new(nil, title: 'Hello world!').show
end

Hello Button

Anyone who is familiar with wxWidgets should feel right at home since the API may be Ruby-fied, it is still easily recognizable (but being Ruby-fied allowing for elegant and compact coding). And for those that do not have previous experience, do not fear, wxRuby3 comes with an extensive User Guide and detailed reference documentation and lots of examples and tests.

…

shell gem install wxruby3


The wxRuby3 installation procedure will check the availability of a prebuilt, binary package matching the platform
being installed on and if found will download and install that package resulting in a ready-to-run wxRuby3 installation.

If no matching package is found the installation reverts to a source installation which will require an additional setup
step to finalize the wxRuby3 installation by executing the following command:

```shell
wxruby setup

This last command is a fully automated setup procedure provided by the wxRuby3 CLI installed with the gem. This procedure (by default) will analyze your system and install (after asking your consent) any missing software requirements and build the wxRuby3 extension libraries (including an embedded copy of wxWidgets if necessary). It may take quite a while depending on your system (around 10-15 minutes on a modern PC but could be significantly longer on 'older' PC's) but you can mostly sit back and relax.

NOTE

A source based installation requires the availability of the Ruby development headers. User installed Rubies in most cases will already include those but (especially on Linux) system installed Rubies may require having an additional '-dev/-devel' package installed (although actually you may already have needed those to install the gems that the wxRuby3 gem depends on like the nokogiri gem).

The wxRuby3 CLI also provides a 'check' command with which the runtime status of the wxRuby3 installation can be checked at any time. By default, running wxruby check will display a message reporting the runtime and suggestions on finalizing the installation if not finalized yet. No message is displayed if wxRuby3 is ready to run. Run wxruby check -h for details concerning this command.

A selection of (prebuilt) binary packages is provided as release assets on GitHub. See the INSTALL document for more details.

This install procedure can of course be tweaked and customized with commandline arguments. See the INSTALL document for more details.

Where can I ask a question, or report a bug?

Use GitHub Issues.

When asking a question, if something is not working as you expect, please provide a minimal, runnable sample of code that demonstrates the problem, and describe clearly what you expected to happen and what actually happened. Please also provide basic details of your platform, Ruby, wxRuby and wxWidgets version, and make a reasonable effort to find answers in the archive, wiki and/or documentation before posting. People are mostly happy to help, but it's too much to expect them to guess what you're trying to do, or try and debug 1,000 lines of your application. Very important also; do not use offensive language and be polite.

How can I learn to use wxRuby?

wxRuby3 is a large API and takes some time to learn. The wxRuby3 distribution comes with numerous samples which illustrate how to use many specific parts of the API. A good one to start with is the 'minimal' sample, which provides an application skeleton. All the bundled samples are expected to work with current wxRuby3, although some use a more modern coding style than others. Use the bundled wxruby CLI to access the samples (see the section Bundled CLI in the INSTALL document for more details).

An extensive User Guide is available at the wxRuby3 Wiki providing detailed information about how to build desktop applications with wxRuby3.

Complete (more or less) wxRuby API documentation should be part of any complete wxRuby3 build. This tends to focus on providing a reference of all available modules, classes and methods and how to use specific classes and methods, rather than on how to construct an application overall. This documentation (for the latest release) is also available online here.

One of the advantages of wxRuby3 is the much larger ecosystem of wxWidgets and wxPython resources out there. There is a book for wxWidgets, "Cross-Platform Programming in wxWidgets", which can be freely downloaded as a PDF. This provides very comprehensive coverage of the wxWidgets API in C++. The code may not be directly useful but the descriptions of how widgets and events and so forth work are almost always relevant to wxRuby3 (and should be fairly easily relatable).

When using a search engine to find answers about a wxRuby3 class, it can be worth searching for the same term but with 'wx' prepended. For example, if you wanted answers about the "Grid" class, try searching for "wxGrid" as this will turn up results relating to wxWidgets and wxPython which may be relevant.

How does wxRuby3 relate to the wxRuby 2.0 (and even older 0.6.0) release?

wxRuby 0.6.0 was the last in a series of releases developed using a different approach in the early days of wxRuby. Work on this series stopped in early 2005, in favour of what became wxRuby 2.0. This project in turn stopped being supported in 2013. Several years of development have passed for wxWidgets and Ruby respectively, improving code quality, adding new classes and new language features. In 2022, I finally found the time and the inspiration to pick up this project with the idea of reviving it to build some applications I had in mind. wxRuby 3 intends to provide Ruby interfaces for all relevant (!) wxWidget classes of the latest version 3.2 and beyond. Building on the experiences of the previous wxRuby (2) developments as well as the wxPython Phoenix project it is expected to provide a better and more maintainable solution.

I am getting an error trying to install or compile wxRuby3

Please double-check the instructions above and in the INSTALL document and search issue archives. If this doesn't help, please post your question using GitHub Issues.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rubycocoacross-platform-desktopcross-platform-guidesktop

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类数据库
定价开源

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库