Need some addition in Ruby/Tk

  • Thread starter Sabyasachi Mustafi
  • Start date
S

Sabyasachi Mustafi

--Next_1068276139---0-203.199.83.28-9851
Content-type: text/plain;
charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hello all,=0A Our software is expected to be installed in this month. Af=
ter two months of extensive use of Ruby/Tk I have something to say about it=
. I think to make real life applications quickly we need more in the area o=
f Ruby/Tk as in the following.=0A=0A1. Tkcombobox should be added in the Ru=
by Distribution.=0A2. Both of the List box and combo box should have the op=
tion to provide two values as in Visual Basic (Bound Column)=0A3. Need some=
thing like Grid. I think there is TkTable but I am not sure about it.=0A=0A=
I have used 1.6 version. May be in 1.8 the problems are solved. What is=
your opinion?=0A=0AWith Regards,=0ASabyasachi Mustafi
--Next_1068276139---0-203.199.83.28-9851--
 
F

Ferenc Engard

Hello,

Sabyasachi said:
Hello all,
Our software is expected to be installed in this month. After two months of extensive use of Ruby/Tk I have something to say about it I think to make real life applications quickly we need more in the area of Ruby/Tk as in the following.

1. Tkcombobox should be added in the Ruby Distribution.

Actually, combobox should be added to Tk. :-( There is at least five
combobox implementations, none of which are part of the core (Tcl/)Tk
distribution. I use (strictly for prototyping, later I will replace it)
TixComboBox.
2. Both of the List box and combo box should have the option to provide two values as in Visual Basic (Bound Column)

You can extend the widgets easily with addPair(), selectId(), text2id(),
currentId() functions, which simply manipulate a hash.
3. Need something like Grid. I think there is TkTable but I am not sure about it.

Yes, there is, and TkTable is great! I have written a wrapper to it, but
didn't released it yet. You can download it from here:

http://www.korus.hu/~fery/ruby/tktable.rb

In my opinion, the bare Tk without any extensions is a bit featureless
(no keyboard shortcuts, missing key widgets (combobox, grid etc.),
lacking framework for writing custom widgets...). If you use it from
tcl, it is compensated by the lots of widget and other libraries which
is available for tk. Unfortunately, if you use Tk from ruby, it is much
more harder to use these libs. Also, there are problems with the ruby/tk
implementation itself (e.g. callback and exceptions, maybe corrected in
CVS). If I could restart my (mainly GUI-oriented, database handling)
project, I think I would choose another GUI lib (or, shame, another
language). :-/

Regards,
Ferenc
 
H

Hidetoshi NAGAI

Hi,

From: "Sabyasachi Mustafi" <[email protected]>
Subject: Need some addition in Ruby/Tk
Date: Sat, 8 Nov 2003 16:24:55 +0900
Message-ID: said:
1. Tkcombobox should be added in the Ruby Distribution.

Which one do you talk about? There are some kinds of Ruby/Tk samples
and Tcl/Tk extensions.
2. Both of the List box and combo box should have the option to
provide two values as in Visual Basic (Bound Column)

I'm sorry but I'm not a Visual Basic user. Please show me a sample
code (and its effects) that you are imaging.
3. Need something like Grid. I think there is TkTable but I am not
sure about it.

Ruby/Tk depends on Tcl/Tk libraries linked to the tcltklib extension.
Do you say that Tcl/Tk's grid geometry manager is not enough?
If so, you'll have to create a wrapper of Tcl/Tk's geometry managers.
Or you can try to use Tcl/Tk extensions (e.g. TkTable) on Ruby/Tk.
 
N

Nikolay Ponomarenko

Hello Hidetoshi,
HN> Which one do you talk about? There are some kinds of Ruby/Tk samples
HN> and Tcl/Tk extensions.

It'll be nice to use something like
Hugecombo
Hugelist
:)))

HN> Ruby/Tk depends on Tcl/Tk libraries linked to the tcltklib extension.
HN> Do you say that Tcl/Tk's grid geometry manager is not enough?
HN> If so, you'll have to create a wrapper of Tcl/Tk's geometry managers.
HN> Or you can try to use Tcl/Tk extensions (e.g. TkTable) on Ruby/Tk.

There is an wrapper under TkTable written by
Ferenc Engard <ferenc(at) engard.hu>
May be it can be included into Ruby/Tk distribution ....
 
H

Hidetoshi NAGAI

Hi,

From: "Sabyasachi Mustafi" <[email protected]>
Subject: Need some addition in Ruby/Tk
Date: Sat, 8 Nov 2003 16:24:55 +0900
Message-ID: said:
1. Tkcombobox should be added in the Ruby Distribution.

I added new 4 sample scripts to CVS.

1. tktextframe.rb : simple text frame with 'scrollbar 0N/OFF' method

2. tkballoonhelp.rb : simple balloon help widget
------<sample of usage>---------------------------------
TkButton.new('text'=>'This button has another balloon help') {|b|
pack('fill'=>'x')
TkBalloonHelp.new(b, 'text'=>'configured message',
'interval'=>500, 'font'=>'courier',
'background'=>'gray', 'foreground'=>'red')
}
--------------------------------------------------------

3. tkmultilistbox.rb : multiple listboxes with pane tabs
------<sample of usage>---------------------------------
f = TkFrame.new(nil, 'width'=>300,
'height'=>200).pack('fill'=>'both', 'expand'=>'true')
l = TkMultiListbox.new(f, 150,
[ ['L1', 100],
['L2', 200],
['L3', 50] ],
'titlefont'=>'courier',
'titleforeground'=>'yellow',
'titlebackground'=>'navy'
).pack('fill'=>'both', 'expand'=>true)
l.insert('end', [1,2,3])
l.insert('end', [4,5,6])
l.insert('end', [4,5,6], [4,5,6])
l.insert('end', ['aaaaaaaaaaaaaaa','bbbbbbbbbbb','ccccccccccccccccc'])
p l.columns(1)
p l.columns(1..3)
p l.columns(1,2)
--------------------------------------------------------

4. tkcombobox.rb : listbox with auto-scroll tab, and combobox widget
------<sample of usage>---------------------------------
v = TkVariable.new
e = TkCombobox.new:)height=>7, :scrollbar=>true, :textvariable=>v,
:startwait=>400, :interval=>200).pack
e.values(%w(aa bb cc dd ee ff gg hh ii jj kk ll mm nn oo pp qq rr ss))
#e.see(e.list_index('end') - 2)
e.value = 'cc'
TkFrame.new{|f|
fnt = TkFont.new('Helvetica 10')
TkLabel.new(f, :font=>fnt,
:text=>'TkCombobox value :').pack:)side=>:left)
TkLabel.new(f, :font=>fnt, :textvariable=>v).pack:)side=>:left)
}.pack

TkFrame.new:)relief=>:raised, :borderwidth=>2,
:height=>3).pack:)fill=>:x, :expand=>true,
:padx=>5, :pady=>3)

l = TkAutoScrollbox.new(nil, :relief=>:groove, :borderwidth=>4,
:width=>20).pack:)fill=>:both, :expand=>true)
(0..20).each{|i| l.insert('end', "line #{i}")}

TkFrame.new:)relief=>:ridge, :borderwidth=>3){
TkButton.new(self, :text=>'ON',
:command=>proc{l.scrollbar(true)}).pack:)side=>:left)
TkButton.new(self, :text=>'OFF',
:command=>proc{l.scrollbar(false)}).pack:)side=>:right)
pack:)fill=>:x)
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top