[fxruby-users] Message Popup

elKano d.cano.lagneaux at gmail.com
Mon Feb 6 09:34:39 EST 2006


Hello,
I am writing an interface to a database. While the code is loading the  
initial data, the program freezes for some 4 or 5 seconds. I would like to  
inform the user that we are loading the data, so I use a little popup (the  
code follows).
My problem is that the popup does not show as it should; the little  
rectangle comes up, but instead of being filled with a label, it is filled  
with the desktop background.

Any idea of how should I do?

class LoadingPopup
    # Helper class showing a little popup with the given text

    def initialize(app, text)
       @text=text
       @app= app
    end

    def show
          @popup=FXPopup.new(@app.mainWindow) do |thePopup|
             w=@app.mainWindow
             frame=FXHorizontalFrame.new(thePopup)
             FXLabel.new(frame, @text)
             thePopup.create
             thePopup.show
             thePopup.popup(nil, w.x+w.width/2, w.y+w.height/2)
          end
    end

    def hide
       @popup.destroy
    end
end


More information about the fxruby-users mailing list