Professional Web Applications Themes

Graphical Ruby/Tk GUI designer? - Ruby

Hi, I need to design a GUI - are there any tools available? I don't want to use Java for my project, even though I'm familiar with the JFC/Swing, but may have to since I'm not familiar with Tk. Help? :-) Thanks, Asfand Yar -- http://www.it-is-truth.org/...

  1. #1

    Default Graphical Ruby/Tk GUI designer?

    Hi,

    I need to design a GUI - are there any tools available? I don't want to
    use Java for my project, even though I'm familiar with the JFC/Swing,
    but may have to since I'm not familiar with Tk.

    Help? :-)

    Thanks,
    Asfand Yar




    --
    http://www.it-is-truth.org/

    Asfand Guest

  2. #2

    Default Re: Graphical Ruby/Tk GUI designer?

    Asfand Yar Qazi wrote: 

    Allow me to clarify (I do this often ):

    I would like a GUI designer tool for Ruby/Tk, like NetBeans, etc.

    Thanks,
    Asfand Yar



    --
    http://www.it-is-truth.org/

    Asfand Guest

  3. #3

    Default Re: Graphical Ruby/Tk GUI designer?

    Hi,

    From: Thomas Adam <com>
    Subject: Re: Graphical Ruby/Tk GUI designer?
    Date: Mon, 23 Feb 2004 06:51:00 +0900
    Message-ID: <mail.> 

    Ruby/Tk can load a Tcl script on its Tk interpreter.
    Therefore, you'll be able to use the output script of the GUI
    builder. It is not difficult to control widgets generated by
    the tcl script.
    For example, when there is a Tcl/Tk script 'entry.tcl' as below,

    -----< entry.tcl >------------------------------------
    #!/usr/bin/wish

    wm geometry . +30+30

    frame .buttons
    pack .buttons -side top -fill x
    button .buttons.quit -text Quit -command exit
    button .buttons.print -text Print -command {puts $e_val}
    pack .buttons.quit .buttons.reset -side right

    entry .buttons.e -textvariable e_val -relief sunken
    pack .buttons.e -side left -fill x
    ------------------------------------------------------

    you can load the script to Ruby/Tk and control widgets (generated
    by the script) along the following lines.

    ------------------------------------------------------
    $ /usr/local/bin/irb -r tk
    irb(main):001:0> Tk.tk_call('source', 'entry.tcl')
    => ""
    irb(main):002:0> root = TkRoot.new
    => #<TkRoot:0x402bf2c8 path=".">
    irb(main):003:0> root.winfo_children
    => [#<TkFrame:0x402bcc94 db_class=TkFrame, container=nil, visual=nil, colormap=nil, path=".buttons", classname="Frame">]
    irb(main):004:0> widgets = root.winfo_children[0].winfo_children
    => [#<TkButton:0x402b7a50 path=".buttons.quit">, #<TkButton:0x402b6f60 path=".buttons.print">, #<TkEntry:0x40236774 path=".buttons.e">]
    irb(main):005:0> btn_q, btn_p, ent = widgets
    => [#<TkButton:0x402b7a50 path=".buttons.quit">, #<TkButton:0x402b6f60 path=".buttons.print">, #<TkEntry:0x40236774 path=".buttons.e">]
    irb(main):006:0> ent['textvariable']
    => "e_val"
    irb(main):007:0> v = TkVarAccess.new(ent['textvariable'])
    => #<TkVariable: e_val>
    irb(main):008:0> v.value = 'foo bar'
    => "foo bar"
    irb(main):009:0> btn_p.invoke
    foo bar
    => ""
    irb(main):010:0> Tk.mainloop
    ------------------------------------------------------
    --
    Hidetoshi NAGAI (kyutech.ac.jp)


    Hidetoshi Guest

Similar Threads

  1. Graphical Interfase
    By carlossm in forum Informix
    Replies: 4
    Last Post: November 10th, 10:03 PM
  2. Making a graphical editor with Ruby. How?
    By Joao Barros in forum Ruby
    Replies: 10
    Last Post: October 31st, 12:03 AM
  3. graphical presentation
    By Larry in forum Microsoft Access
    Replies: 2
    Last Post: September 10th, 02:43 PM
  4. [ANN] ruby-freedb, ruby-serialport, ruby-mp3info moved to Rubyforge
    By guillaume.pierronnet@ratp.fr in forum Ruby
    Replies: 0
    Last Post: August 31st, 11:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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