Need some addition in Ruby/Tk

Ask a Question related to Ruby, Design and Development.

  1. #1

    Default Need some addition in Ruby/Tk

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

    Sabyasachi Mustafi Guest

  2. Similar Questions and Discussions

    1. addition....
      The half transparent grey square going on and off with the light switch is actualy to be a backgroung for a text MC. And the...
    2. Fields + Addition + Help
      okay. I have a button. when user clicks the button, I want a field to add +1 to its total. this should be extremely easy to figure out for someone...
    3. Hyperlink HTML addition
      I read on David's site how to get rid of the underline in hyperlinks: <style> a{text-decoration:none} </style> Can I put this somewhere on my...
    4. [ANN] ruby-freedb, ruby-serialport, ruby-mp3info moved to Rubyforge
      http://ruby-freedb.rubyforge.org/ http://ruby-serialport.rubyforge.org/ http://ruby-mp3info.rubyforge.org/ bye! --...
    5. my passwords - XP home addition
      every time the prompt comes up to remember a user name and password I check the box to have it remembered and it does not work. This is a major...
  3. #2

    Default Re: 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. :-( 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:

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

    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
    Ferenc Engard Guest

  4. #3

    Default Re: Need some addition in Ruby/Tk

    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.co m>
    > 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.
    --
    Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

    Hidetoshi NAGAI Guest

  5. #4

    Default Re: Need some addition in Ruby/Tk

    Hello Hidetoshi,
    Monday, November 10, 2003, 5:01:23 AM, you wrote:
    >> 1. Tkcombobox should be added in the Ruby Distribution.
    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
    :)))
    >> 3. Need something like Grid. I think there is TkTable but I am not
    >> sure about it.
    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 ....

    --
    Best regards,
    Nikolay


    Nikolay Ponomarenko Guest

  6. #5

    Default Re: 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. :-( 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:

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

    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


    Ferenc Engard Guest

  7. #6

    Default Re: Need some addition in Ruby/Tk

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

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

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

    Hidetoshi NAGAI Guest

  8. #7

    Default Re: Need some addition in Ruby/Tk

    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. :-( 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.
    >
    > [url]http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/18167[/url]
    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


    Ferenc Engard Guest

  9. #8

    Default Re: Need some addition in Ruby/Tk

    >>>>> "F" == Ferenc Engard <ferenc@engard.hu> writes:

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

    TkComposite#initialize


    Guy Decoux


    ts Guest

  10. #9

    Default Re: Need some addition in Ruby/Tk

    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.co m>
    > 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=>:le ft)
    TkButton.new(self, :text=>'OFF',
    :command=>proc{l.scrollbar(false)}).pack(:side=>:r ight)
    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)


    Hidetoshi NAGAI Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139