Need some addition in Ruby/Tk

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.

  2. Both of the List box and combo box should have the option to provide two values as in Visual Basic (Bound Column)

  3. Need something like Grid. I think there is TkTable but I am not sure about it.

    I have used 1.6 version. May be in 1.8 the problems are solved. What is your opinion?

With Regards,
Sabyasachi Mustafi

Hi,

···

From: “Sabyasachi Mustafi” sabymus@rediffmail.com
Subject: Need some addition in Ruby/Tk
Date: Sat, 8 Nov 2003 16:24:55 +0900
Message-ID: 20031108072219.9857.qmail@webmail18.rediffmail.com

  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.

  1. 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.

  1. 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.

                              Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

Hi,

···

From: “Sabyasachi Mustafi” sabymus@rediffmail.com
Subject: Need some addition in Ruby/Tk
Date: Sat, 8 Nov 2003 16:24:55 +0900
Message-ID: 20031108072219.9857.qmail@webmail18.rediffmail.com

  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
    ---------------------------------------
    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
    ---------------------------------------
    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
    ---------------------------------------
    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)
    }

Those will be included in ext/tk/sample/ directory of 1.8.1-preview3.
Welcome to comments and bug reports.

                              Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

Hello Hidetoshi,
Monday, November 10, 2003, 5:01:23 AM, you wrote:

  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.

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

  1. 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.

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

···


Best regards,
Nikolay