Ruby Forum wxRuby > what type of variable use? (setting text on another class va

Posted by Gerard Rakoczy (gerapcik)
on 03.05.2008 23:52
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.
Posted by Mario Steele (Guest)
on 04.05.2008 00:17
(Received via mailing list)
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, as there are people there, willing to help as well as 
on
the mailing list.

L8ers,
Posted by Gerard Rakoczy (gerapcik)
on 04.05.2008 00:26
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
Posted by Mario Steele (Guest)
on 04.05.2008 00:41
(Received via mailing list)
I would suggest looking at this:
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,