[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] wxRuby 1.9.4

Alex Fenton

1/17/2008 10:31:00 PM

The wxRuby team is pleased to invite you to try the latest version of
wxRuby, 1.9.4. [ http://wxruby.rub... ]

wxRuby is a cross-platform GUI toolkit for Ruby that provides native
widgets and application behaviour on the three major OSes. It's easy to
install, fully featured, and liberally licensed, and comes with a wide
set of samples and complete ruby API documentation.

wxRuby 1.9.4 now supports almost all of the extensive wxWidgets API, and
is near production quality in terms of stability.

== MINIMAL EXAMPLE ==

require 'wx'
Wx::App.run do
frame = Wx::Frame.new(nil, :title => "Minimal wxRuby App")
button = Wx::Button.new(frame, :label => 'Press me')
evt_button(button) { puts 'Clicked!' }
frame.show
end

== WHAT'S NEW ==

Thanks to a number of contributors, this is a feature-packed release;
key changes include:

* GraphicsContext, for high-quality, anti-aliased drawing and
sophisticated image transforms
* MediaCtrl, for playing and controlling sound and video files
* GLCanvas, for drawing with OpenGL (requires ruby-opengl)
* Drag'n'drop and Clipboard support for exchanging data within and
between applications
* Other minor additions, including SearchCtrl and GridTableBase
* Support for universal binaries on OS X, and dynamic linking on Linux
* Support for building with ruby 1.9 (although there are problems with
ruby 1.9 bugs)
* Many bugfixes and enhancements to existing classes
* Additions to the samples and documentation

== INSTALLATION ==

As usual, the easiest way to get wxRuby is to install an all-in-one
precompiled rubygem:

gem install wxruby

Gems are currently available for Microsoft Windows, OS X 10.4/10.5
universal and Linux i686.

== THANKS ==

Thank you very much to everyone who helped with this release with
patches, bug reports and suggestions and discussions on the mailing
lists. Contributors to the 1.9.3 code include Sean Long, Mario Steele,
Albin Holmgren, Ryuichi Sakamoto and Dale Edmons

cheers
alex
12 Answers

Arturas Šlajus

1/18/2008 12:11:00 AM

0

Cool ;)

Your message was last drop in my inner debate of wxruby vs fxruby ;)

Only thing thou - do you have a gui builder?
--
Posted via http://www.ruby-....

fedzor

1/18/2008 1:19:00 AM

0


On Jan 17, 2008, at 7:11 PM, Art=C5=ABras =C5=A0lajus wrote:

> Cool ;)
>
> Your message was last drop in my inner debate of wxruby vs fxruby ;)
>
> Only thing thou - do you have a gui builder?

There's one that I've found, called FarPY, which was initially for =20
python wx, but it has support for ruby.

I hope there's a better one, however!=

Alex Fenton

1/18/2008 8:07:00 AM

0

Artūras Šlajus wrote:

> Only thing thou - do you have a gui builder?

There are numerous free and commercial GUI builders for wxWidgets, and
they all output an XML format which can be used with wxRuby, wxPython
etc. I like DialogBlocks myself.

There's also a tool for wxRuby which will generate all the Ruby code
needed to use these XML-based layouts. It's a nice way to separate
design (widget layout) and program logic, as well as speeding development.

http://wxruby.rubyforge.org/wiki/wiki.pl?Using_GUI...
http://www.wxwidgets.org/wiki/index...
http://wxruby.rubyforge.org/wiki/wiki.pl?U...

alex


Daniel Lucraft

1/18/2008 5:15:00 PM

0

Alex Fenton wrote:
> The wxRuby team is pleased to invite you to try the latest version of
> wxRuby, 1.9.4. [ http://wxruby.rub... ]

I'd love to give this a go for my latest project, but there's one thing
I need and it's non-negotiable: a browser widget (HTML/CSS/Javascript).
Could be Gecko, or Webkit or whatever. Does WxRuby have anything like
this? (I've tried looking around and haven't found anything, but I've
found you can easily miss this kind of thing.)

thanks,
Dan
--
Posted via http://www.ruby-....

Jari Williamsson

1/18/2008 6:51:00 PM

0

Daniel Lucraft wrote:
> Alex Fenton wrote:
>> The wxRuby team is pleased to invite you to try the latest version of
>> wxRuby, 1.9.4. [ http://wxruby.rub... ]
>
> I'd love to give this a go for my latest project, but there's one thing
> I need and it's non-negotiable: a browser widget (HTML/CSS/Javascript).
> Could be Gecko, or Webkit or whatever. Does WxRuby have anything like
> this? (I've tried looking around and haven't found anything, but I've
> found you can easily miss this kind of thing.)

http://wxruby.rub.../doc/#html


Best regards,

Jari Williamsson


Alex Fenton

1/18/2008 7:30:00 PM

0

Daniel Lucraft wrote:
> Alex Fenton wrote:
>> The wxRuby team is pleased to invite you to try the latest version of
>> wxRuby, 1.9.4. [ http://wxruby.rub... ]
>
> I'd love to give this a go for my latest project, but there's one thing
> I need and it's non-negotiable: a browser widget (HTML/CSS/Javascript).

Thanks for the interest, but unfortunately there's nothing that meets
that spec. Wx::HtmlWindow is a nice hypertext+images widget, but no CSS
or JS.

There are various projects wrapping Webkit and Gecko for wxWidgets, but
nothing stable or integrated enough to add to wxRuby yet.

Maybe your best bet would be to see if Qt/Ruby includes a KHTML-based
widget. However I've not been able to find a Qt/Ruby API reference to check.

alex

Daniel Brumbaugh Keeney

1/18/2008 8:09:00 PM

0

On Jan 18, 2008 1:35 PM, Alex Fenton <alex@deleteme.pressure.to> wrote:
> > I'd love to give this a go for my latest project, but there's one thing
> > I need and it's non-negotiable: a browser widget (HTML/CSS/Javascript).

The one toolkit I know it's possible with is GTK, because Kazehakase uses it.

http://kazehakase.sourc...
http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%...

Daniel Brumbaugh Keeney

Daniel Lucraft

1/18/2008 8:50:00 PM

0

Alex Fenton wrote:
> Thanks for the interest, but unfortunately there's nothing that meets
> that spec. Wx::HtmlWindow is a nice hypertext+images widget, but no CSS
> or JS.

Thank you for your replies. WxRuby looks very nice though! Looking
forward to using it for something.

best,
Dan
--
Posted via http://www.ruby-....

Dominik Honnef

1/19/2008 12:39:00 PM

0

In my opinion, a binding to wxWidgets is a great chance for GUIs with ruby, but I'm wondering, if its very ruby-like.
Lets take the following extract of the tutorial (frames, part 1)

[code]
btn = Wx::Button.new(panel, -1, name + " (Close me)", Wx::Point.new(45,55))
evt_button(btn.get_id()) {|event| destroy()}
[/code]

In my opinion, the button itself should handle its events and not the frame.
And even if the frame has to handle it, why does evt_button await an ID and not simply the button instance itself?

Maybe there are good reasons for this behaviour, but I cant see them.

--


Alex Fenton

1/20/2008 11:52:00 PM

0

Dominik Honnef wrote:
> In my opinion, a binding to wxWidgets is a great chance for GUIs with ruby, but I'm wondering, if its very ruby-like.
> Lets take the following extract of the tutorial (frames, part 1)

As the tutorial front page warns, some of that material is dated. Much
more ruby-like syntax is permitted now. The API docs and many of the
bundled samples are more current.

> [code]
> btn = Wx::Button.new(panel, -1, name + " (Close me)", Wx::Point.new(45,55))
> evt_button(btn.get_id()) {|event| destroy()}
> [/code]

could be written:

btn = Wx::Button.new(panel,
:label => "#{name} (Close me)",
:pos => [45, 55])
evt_button(btn) { close }


> In my opinion, the button itself should handle its events and not the frame.

Both are valid programming strategies: you might want to encapsulate a
set of behaviours in a ruby subclass of a widget like a button, or have
a coherent group of interactions managed by a particular frame or dialog.

Anyway, either is possible. CommandEvents from controls like Button
bubble upwards to their containing windows. The event handling page in
the docs discusses this in detail:
http://wxruby.rubyforge.org/doc/eventhandlingove...

> And even if the frame has to handle it, why does evt_button await an ID and not simply the button instance itself?

Event handlers have for numerous versions accepted IDs or just the
instance itself.

> Maybe there are good reasons for this behaviour, but I cant see them.

In most cases, like you say, using an object is preferable.

You'd normally only use an ID now with "special" identifiers like
Wx::ID_EXIT or Wx::ID_ABOUT. The great advantage of using these special
ids to identify, for example, menu items is that they will get all the
OS-standard behaviour on different platforms. A Wx::ID_EXIT menu item
will be labelled "Exit" on Windows and GTK, and will get the
desktop-standard menu icon on the latter. But on OS X it will be called
"Quit" and will be located in the Application-name menu, not the File menu.

This kind of attention to GUI platform standards is one of
wxRuby/wxWidget's strengths, along with accessibility. GTK apps, for
example, feel clumsy and look foreign on OS X in particular. I'm not
picking on GTK - it's an excellent toolkit too, and wxRuby uses it on
Linux - but it's a matter of choosing the right GUI library given the
target platforms and user group for any given project.

cheers
alex