Tk question

hello,
I would like to add some interactive help to my Tk app.
The better thing I see is the Tix extension: “Balloon” but it isn’t
implemented in ruby.
is there a way with “pure tk code” to implement such a thing ?
for example to make a widget without decoration child of the root
window of the screen ?

···


/ do you play Go? \

http://jeanfrancois.menon.free.fr/rubygo |
\ /


    \   ^__^
     \  (oo)\_______
        (__)\       )\/\
            >>----w |
            >>     >>

Hi,

···

From: MENON Jean-Francois Jean-Francois.MENON@meteo.fr
Subject: tk question
Date: Thu, 6 Jun 2002 17:01:27 +0900
Message-ID: 3CFF16C2.CC2EAC61@meteo.fr

The better thing I see is the Tix extension: “Balloon” but it isn’t
implemented in ruby.

‘tcltk-ext’ library (see RAA) maybe help you.

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

nagai@ai.kyutech.ac.jp wrote:

Hi,

From: MENON Jean-Francois Jean-Francois.MENON@meteo.fr
Subject: tk question
Date: Thu, 6 Jun 2002 17:01:27 +0900
Message-ID: 3CFF16C2.CC2EAC61@meteo.fr

The better thing I see is the Tix extension: “Balloon” but it isn’t
implemented in ruby.

‘tcltk-ext’ library (see RAA) maybe help you.

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

thank you
but I am afraid this does not help me. I want to distribute my app
under gpl for any platform and I can’t ask users to modify their ruby’s
installation ( in fact it’s already difficult to ask them to install
ruby at all :-<)

···


/ do you play Go? \

http://jeanfrancois.menon.free.fr/rubygo |
\ /


    \   ^__^
     \  (oo)\_______
        (__)\       )\/\
            >>----w |
            >>     >>

Hi,

···

From: MENON Jean-Francois Jean-Francois.MENON@meteo.fr
Subject: Re: tk question
Date: Thu, 6 Jun 2002 20:38:50 +0900
Message-ID: 3CFF49C1.33CE86EC@meteo.fr

but I am afraid this does not help me. I want to distribute my app
under gpl for any platform and I can’t ask users to modify their ruby’s
installation ( in fact it’s already difficult to ask them to install
ruby at all :-<)

If user’s Ruby/Tk returns no error for “TkPackage.require(‘Tix’)”,
he doesn’t need to modify their Ruby.
Extract needed classes from Tix.rb included tcltk-ext,
and add them to your application.

Of course, need “TkPackage.require(‘Tix’)” after “require ‘tk’”. :slight_smile:

If you want to use Balloon, use TixBalloon class.
The class-tree of TixBalloon is

TkWindow
±- TixInputOnly
±- TixPrimitive
±- TixShell
±- TixBalloon

Therefore, add TixInputOnly, TixPrimitive, TixShell, and TixBalloon
to your application.
Then you can use Balloon widget in your application.
e.g.
TkButton.new(nil, ‘text’=>‘hello’,
‘command’=>proc{print “hello\n”}) {|b|
TixBalloon.new(nil, ‘initwait’=>200, ‘state’=>‘balloon’) {
bind(b, ‘balloonmsg’=>‘Balloon Help’)
}
pack(‘fill’=>‘x’)
}
Tk.mainloop

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