# What type of variable use? (setting text on another class va

**URL:** <https://www.ruby-forum.com/t/what-type-of-variable-use-setting-text-on-another-class-va/136585>\
**Category:** wxRuby\
**Created:** [May 3, 2008, 11:52pm UTC](https://www.ruby-forum.com/t/what-type-of-variable-use-setting-text-on-another-class-va/136585 "2008-05-03T23:52:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gerapcik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/edb3f5/32.png) [@gerapcik](https://www.ruby-forum.com/u/gerapcik)\
**Post date:** [May 3, 2008, 11:52pm UTC](https://www.ruby-forum.com/t/what-type-of-variable-use-setting-text-on-another-class-va/136585/1 "2008-05-03T23:52:43Z")

</div>

so, i have a MinimalFrame class where i have a form, then, after a user  
add a new client i would like to send a log message on MainFrame  
status\_bar.

---

<div class="post-metadata">

**Author:** ![gerapcik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/edb3f5/32.png) [@gerapcik](https://www.ruby-forum.com/u/gerapcik)\
**Post date:** [May 4, 2008, 12:17am UTC](https://www.ruby-forum.com/t/what-type-of-variable-use-setting-text-on-another-class-va/136585/2 "2008-05-04T00:17:39Z")

</div>

If this is from the Form, you would need to do the following:  
self.get\_parent.get\_status\_bar().set\_status\_text(message)

And when I mean, if this is from the Form, I mean, that evt\_button() is  
defind within the Form class, if it’s defined within the MinimalFrame  
class,  
then you just need self.get\_status\_bar().set\_status\_text(message)

Example of it being within the Form:

class Form \< Panel  
def initialize()  
# creation of all your controls here  
evt\_button(@add\_user) do  
self.get\_parent.get\_status\_bar().set\_status\_text(“Contact  
created.”)  
end  
end  
end

Example of it being within the MinimalFrame

class MinimalFrame \< Frame  
def initialize()  
@form = Form.new()  
evt\_button(ID\_ADD) do  
self.get\_status\_bar().set\_status\_text(“Contact created.”)  
end  
end  
end

You may also want to consider stopping by the IRC Chat Room on  
[irc.freenode.net](http://irc.freenode.net), as there are people there, willing to help as well as  
on  
the mailing list.

L8ers,

---

<div class="post-metadata">

**Author:** ![gerapcik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/edb3f5/32.png) [@gerapcik](https://www.ruby-forum.com/u/gerapcik)\
**Post date:** [May 4, 2008, 12:26am UTC](https://www.ruby-forum.com/t/what-type-of-variable-use-setting-text-on-another-class-va/136585/3 "2008-05-04T00:26:32Z")

</div>

thanks again,  
howevevr i tried to get help on irc, but there was silence, for this i  
asked here. i realize that these are newbie questions and i would get  
answers on irc faster…

thank however, next time i will be more patient on IRC

---

<div class="post-metadata">

**Author:** ![gerapcik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/edb3f5/32.png) [@gerapcik](https://www.ruby-forum.com/u/gerapcik)\
**Post date:** [May 4, 2008, 12:41am UTC](https://www.ruby-forum.com/t/what-type-of-variable-use-setting-text-on-another-class-va/136585/4 "2008-05-04T00:41:40Z")

</div>

I would suggest looking at this:  
[http://wxruby.rubyforge.org/wiki/wiki.pl?ChatRoom](http://wxruby.rubyforge.org/wiki/wiki.pl?ChatRoom)

A lot of times, people are not watching the Chat Room, so it is hard for  
some to realize this, and get discouraged. Don’t let it. Someone will  
eventually respond. I am there with a couple of other people, so feel  
free  
to stop by.

L8ers,
