Need some addition in Ruby/Tk

Hello,

Sabyasachi Mustafi wrote:

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. :frowning: 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.

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

  1. 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). :-/

Anyway, what tk extension library wrappers (e.g., bwidgets?) are
available for ruby?

Regards,
Ferenc

Hi,

···

From: Ferenc Engard ferenc@engard.hu
Subject: Re: Need some addition in Ruby/Tk
Date: Fri, 14 Nov 2003 08:41:00 +0900
Message-ID: 3FB41689.1B1A917E@engard.hu

  1. Tkcombobox should be added in the Ruby Distribution.
    Actually, combobox should be added to Tk. :frowning: 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.

Why don’t you create your Tkcombobox class?
I think it is not so difficult.
You can find following samples on the Web.

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/18167
http://www-ps.kek.jp/thitoshi/ruby/


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

Hidetoshi NAGAI wrote:

Hi,

From: Ferenc Engard ferenc@engard.hu
Subject: Re: Need some addition in Ruby/Tk
Date: Fri, 14 Nov 2003 08:41:00 +0900
Message-ID: 3FB41689.1B1A917E@engard.hu

  1. Tkcombobox should be added in the Ruby Distribution.
    Actually, combobox should be added to Tk. :frowning: 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.

Why don’t you create your Tkcombobox class?
I think it is not so difficult.

Well, with proficient look-and-feel and proper bindings (both on
keyboard and mouse) it is not so small work IMHO…

You can find following samples on the Web.

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/18167

Megawidgets in ruby…? I didn’t try it yet, but sounds good… I have
some questions:

This is from tk.rb:

module TkComposite
include Tk
extend Tk

def initialize(parent=nil, *args)
[…]

What does it mean if a module has an initialize method? E.g.

class A
def initialize

end
end

class B < A
include TkComposite
def initialize

super # it calls TkComposite#initialize or A#initialize?
end
end

For automatically initializing a module, I wrote my own ‘before’ hack;
it was unnecessary? (Although, it calls the ascendant’s method even if
super is not called…)

I will look about this TkComposite…

Ferenc

class B < A
include TkComposite
  def initialize
    ...
    super # it calls TkComposite#initialize or A#initialize?

TkComposite#initialize

Guy Decoux