Forum: FXRuby Dynamic Text in FXButton

Posted by Alex DeCaria (deke)
on 2008-07-20 21:47
Is there a way to have the text in a button change when you press the
button?  For example, a button that says "Hi", and when you click it
says "Bye".  I can't find how to do this.

Thanks,

Alex
Posted by Mateusz Tybura (wujciol)
on 2008-08-02 12:28
Alex DeCaria wrote:
> Is there a way to have the text in a button change when you press the
> button?  For example, a button that says "Hi", and when you click it
> says "Bye".  I can't find how to do this.
> 
> Thanks,
> 
> Alex

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

require 'fox16'

include Fox

app = FXApp.new

mw= FXMainWindow.new(app, "Hello ",:width => 320, :height => 240)

button = FXButton.new(mw,"Hey")
button.connect(SEL_COMMAND) do
  button.text = "Bye"
end

app.create

mw.show(Fox::PLACEMENT_SCREEN)

app.run
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: http://getfiregpg.org

iD8DBQFIlDbBDbyapJB9FLwRAiR+AJ9xhftoZEX/pJZ+/Vf8X3BIZERrIwCbBdu9
YuoycBuIRg5lH6ByTdk61Ck=
=qOm9
-----END PGP SIGNATURE-----
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.