# Validator problem

**URL:** <https://www.ruby-forum.com/t/validator-problem/165577>\
**Category:** wxRuby\
**Created:** [April 15, 2009, 1:27pm UTC](https://www.ruby-forum.com/t/validator-problem/165577 "2009-04-15T13:27:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luciano\_Zanotto](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/a88e57/32.png) [@Luciano\_Zanotto](https://www.ruby-forum.com/u/Luciano_Zanotto)\
**Post date:** [April 15, 2009, 1:27pm UTC](https://www.ruby-forum.com/t/validator-problem/165577/1 "2009-04-15T13:27:00Z")

</div>

Hi everubody, I’m new to wxRuby and I have a problem with  
Validator/TextValidator object. I’m actually trying to develop an  
extension to OpenStudio, a plugin for Google SketchUp. When I create a  
Validator or a control using a Validator (I’m using the TextValidator)  
anything seems to work fine. But I don’t get to have the changes in the  
variables bound to the controls transferred to the window. From the  
wxWidgets documentation it seems I should call the TransferDataToWindow  
method of the Window object, but this method is not listed in the wxRuby  
port. Has anyone faced the problem before? Could anyone help me? It just  
seems that wxWidgets has not been fully ported yet.  
Thanks in advance  
Ciao Luciano

---

<div class="post-metadata">

**Author:** ![Luciano\_Zanotto](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/a88e57/32.png) [@Luciano\_Zanotto](https://www.ruby-forum.com/u/Luciano_Zanotto)\
**Post date:** [April 15, 2009, 2:15pm UTC](https://www.ruby-forum.com/t/validator-problem/165577/2 "2009-04-15T14:15:05Z")

</div>

Luciano Zanotto wrote:

> ported yet.  
> Validators in wxRuby only do the “validating” stuff, they don’t do  
> transferring data to and from variables - you can see if you look at the  
> Ruby docs for Validator:

[http://wxruby.rubyforge.org/doc/validator.html](http://wxruby.rubyforge.org/doc/validator.html)

This is a deliberate omission not an oversight - variables in Ruby are  
always references, just names for things, so the semantics of assignment  
are not the same as in C++. To retrieve values from controls in dialogs,  
just do normal assignment in an event handler (eg when the ‘OK’ button  
is pressed).

There are some parts of wxWidgets not in wxRuby, but these are with a  
few exceptions deliberate decisions reflecting the differences in the  
target languages.

a
