From: Ronald Fischer <ronaldf / eml.cc>
Subject: Re: Ruby/Tk : How to show tooltips (please correct my ugly implementation)
Date: Tue, 8 Aug 2006 15:45:10 +0900
Message-ID: <1155019481.65 / user.newsoffice.de>
> I see the flicker, because as soon as the toplevel widget
> (my help-tooltip) is displayed, the underlying text field
> looses focus and the tooltip is destroyed. Did I understand
> this correct?

Yes. You are right. :-)

> This means that other Tk classes (such as the geometry manager)
> expect those variables to exist? Because in the example, I
> haven't seen any actual use for them.

Those important definition is done in TkWindow#initialize.
So, if you want to create a new widget class, 
the class should inherit TkWindow (or some subclass of TkWindow).
TkWindow#initialize parse arguments of `new' method in general 
rules of Ruby/Tk, and calls `create_self' method to create 
a widget on the Tk interpreter.
The rule makes definition of a new widget class easier.

> The only unsolved problem is that I am still using a TkLabel
> for the balloon text. As I mentioned in my original posting,
> I am looking for a widget which I can give an arbitrary size,
> and which formats multi-line text (i.e. arranging for line
> breaks automatically). 

Please try TkMessage class. 

    editable   |   not editable
  -------------+----------------
    TkEntry    |   TkLabel
    TkText     |   TkMessage


BTW, I'll do presentation about achivement of Ruby/TkORCA project 
the day after tomorrow. 
By using Ruby/TkORCA framework, you can make your Ruby/Tk application 
a network GUI application.
For example, 

 1. Make a Ruby/Tk application (e.g. "app.rb") which works on the 
    local window system. You can use any helper libraries or programs 
    for your application, if such helpers never draws on the display
    or can embed its drawings on Tk's container widgets. 

 2. Try "tkorca.rb app.rb". It shows a mother window on your 
    local window system, and load your application ("app.rb") 
    in a daughter (a sandbox). The mother can check and control
    the daughter includes the daughter's window management
    (the mother works the window manager for the daughter also). 
    If the application does not work on the daughter, 
    you have to change some parameters of the mother, or add some 
    wrapper operations for the daughter, or modify the source of 
    application. But probably, amount of modification will not 
    so much.

 3. Start server (e.g. "tkorca_daemon app.rb app2.rb ...").
    Then your application is a public-use network GUI application.
    Clients who connects with a kind of VNCviewr can see and use 
    your application by same view and control as you tested at Step2.
    Of course, there is no native window manager, and each client 
    can see and access his own mother and daughters only.
    You can get logs about connections, and can do just-on-time checks 
    and controls of the running application.
    (For example, you can show an emergency dialog box on the client's
    window independently of the status of the application.)

I think, the cost of each step is, 
   Step1  => 1.0, 
   Step2  => 0.5 (or less), 
   Step3  => + alpha.
The total is "1.5+alpha".
Probably, you can make "Hello, World" netowork GUI application 
in only 5 minutes or less. :-)
When based on Ruby/TkORCA, a network GUI application will require 
lower cost and get faster development than other frameworks.
Maybe... ;-)
-- 
Hidetoshi NAGAI (nagai / ai.kyutech.ac.jp)