FXSplashWindow usage question

Discussion in 'Ruby' started by Nuralanur@aol.com, Feb 7, 2006.

  1. Guest

    -------------------------------1139303319
    Content-Type: text/plain; charset="US-ASCII"
    Content-Transfer-Encoding: 7bit


    Dear lopex, dear all,

    thank you for suggesting FXSplashWindow.
    Unfortunately, I have not been able to use it so far --
    these are my very first steps in FXRuby (not in Ruby, though).
    The code below is combined from the "hello.rb" code from the FXRuby tutorial
    and from the FXSplashWindow.rb file.
    It only shows the Hello-world Window, but not the SplashScreen.
    What am I missing ?

    Thank you,
    Axel

    ---------------------------------------------------------------

    require "fox14"


    include Fox

    module Fox
    #
    # The Splash Window is a window typically shown during startup
    # of an application. It comprises a large icon, which is also
    # used as the shape of the window if +SPLASH_SHAPED+ is passed;
    # with the +SPLASH_SIMPLE+ option the window will be simply rectangular.
    #
    # === Splash window options
    #
    # +SPLASH_SIMPLE+:: Simple rectangular splash window
    # +SPLASH_SHAPED+:: Shaped splash window
    # +SPLASH_OWNS_ICON+:: Splash window will own the icon and destroy it
    # +SPLASH_DESTROY+:: Splash window will destroy itself when timer expires
    #
    class FXSplashWindow < FXTopWindow
    # The splash window's icon [FXIcon]
    attr_accessor :icon

    # The delay before hiding the splash window, in milliseconds [Integer]
    attr_accessor :delay

    # Construct splash window
    def initialize(app, ic, opts=SPLASH_SIMPLE, ms=5000) # :yields:
    theSplashWindow
    end

    # Construct splash window
    def initialize(ow, ic, opts=SPLASH_SIMPLE, ms=5000) # :yields:
    theSplashWindow
    end
    end
    end



    application = FXApp.new("Hello", "FoxTest")
    app = FXSplashWindow.new(application,'sc30.png',opts=SPLASH_SIMPLE, ms=5000)

    main = FXMainWindow.new(application, "Hello", nil, nil, DECOR_ALL)
    FXButton.new(main, "&Hello, World!", nil, application, FXApp::ID_QUIT)
    application.create()
    main.show(PLACEMENT_SCREEN)
    application.run()





    -------------------------------1139303319--
    , Feb 7, 2006
    #1
    1. Advertising

  2. According to solution 1 found at:
    http://www.fox-toolkit.net/cgi-bin/wiki.pl?Tutorial_13_SplashScreen


    require "fox14"
    include Fox

    app=FXApp.new("Hello", "FoxTest")

    ico=FXPNGIcon.new(app,open("splash.png","rb").read)
    splash=FXSplashWindow.new(app,ico,SPLASH_SIMPLE,5000)

    app.create()
    splash.show(PLACEMENT_SCREEN)
    app.runModalWhileShown(splash);

    main=FXMainWindow.new(app, "Hello", nil, nil, DECOR_ALL)
    FXButton.new(main, "&Hello, World!", nil, app, FXApp::ID_QUIT)


    main.create
    main.show(PLACEMENT_SCREEN)

    app.run




    lopex
    Marcin Mielżyński, Feb 7, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. metfan
    Replies:
    2
    Views:
    4,832
    Robert Olofsson
    Oct 21, 2003
  2. Colin J. Williams

    Webchecker Usage - a problem with local usage

    Colin J. Williams, Feb 25, 2004, in forum: Python
    Replies:
    1
    Views:
    520
    Colin J. Williams
    Feb 26, 2004
  3. hvt
    Replies:
    0
    Views:
    1,192
  4. hvt
    Replies:
    0
    Views:
    1,447
  5. Krist
    Replies:
    8
    Views:
    6,336
    Arne Vajhøj
    Feb 10, 2010
Loading...

Share This Page