[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Ruby/tk: Static text on a terminal window?

Tim Mcd

1/17/2009 4:06:00 AM

I haven't been able to find it, but is there a way to handle static text
and screen seperation with TK? On a basic terminal?
such as;

scrollingtexxt
scrollingtext
scrollingtext
--staticline--
place for 'gets'/user input
--
Posted via http://www.ruby-....

2 Answers

Hidetoshi NAGAI

1/17/2009 4:43:00 PM

0

From: Tim Mcd <tmcdowell@gmail.com>
Subject: Ruby/tk: Static text on a terminal window?
Date: Sat, 17 Jan 2009 13:06:06 +0900
Message-ID: <206d5ada20131e062c6616499477b12c@ruby-forum.com>
> such as;
>
> scrollingtexxt
> scrollingtext
> scrollingtext
> --staticline--
> place for 'gets'/user input

Maybe, I don't understand what you want.
Did you say such like a following?
------------------------------------------------------------------------
require 'tk'

f = TkFrame.new.pack(:expand=>true, :fill=>:both)
e = TkEntry.new(f).pack(:side=>:bottom, :fill=>:x)
l = TkLabel.new(f, :anchor=>:w).pack(:side=>:bottom, :fill=>:x)
l.text '--- mode line ---'

t = TkText.new(f){
yscrollbar(TkScrollbar.new(f).pack(:side=>:right, :fill=>:y,
:expand=>false))
pack(:side=>:left, :fill=>:both, :expand=>true)
}

e.bind('Return'){
t.insert(:end, e.value + "\n").see(:end)
e.delete(0, :end)
}

e.focus

Tk.mainloop
------------------------------------------------------------------------
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

Tim Mcd

1/18/2009 3:57:00 AM

0

Not what I was talking about, but awesome non the less. Thanks a bunch!

--
Posted via http://www.ruby-....