Thread Rating:
  • 355 Vote(s) - 2.84 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Applet 終了中にはサブアプレットを表示できない?
07-28-2013, 05:21 AM,
#2
RE: Applet 終了中にはサブアプレットを表示できない?
register-exit-proc はCurl IDE ドキュメントをみると
「一般的には、ダイアログ ボックスの作成およびイベントの処理は、exit-procs では避けるようにしてください。」
と書かれているので、この時点では終了処理が進みすぎてスプラッシュウィンドウを表示するには手遅れなのでは。

アプリケーションが終了しようとしていることを知る方法ですが、WindowClose イベントハンドラを実装しては
どうでしょうか?

他のウィンドウシステムでも、アプリケーションが終了のリクエストを察知して、終了処理に入る前になにか処理を
行ったり終了をキャンセルするのにウィンドウのcloseイベントを利用していたと思うので、Curlでも同じように
実現できるのでは。

試しに独立型アプレットで終了確認と、終了前にスプラッシュスクリーンを表示するコードを書いてみました。
Code:
{curl 8.0 applet}
{import * from CURL.ENGINE.BROWSER}

{do
def layout =
    {VBox
        width = 4cm, height = 1cm,
        halign="center",
        {CommandButton
            label = "Exit",
            {on Action at btn:CommandButton do
                def graphic-root = {btn.get-graphical-root}
                {type-switch graphic-root
                 case v:View do
                    {v.close}
                }
            }
        }        
    }

def v =
    {View
        layout,
        visibility = "normal",
        {on wc:WindowClose do
            let x:String =
                {popup-question
                    "Are you sure you want to exit?"
                }
            
            {if x == Dialog.yes then
                {SplashScreen.setup
                    title = "Existing Applet ...",
                    footer = "Test Example ..."
                }
                || We will now be in a loop and sleep in the loop to fake
                || some work..
                {for i = 0 below 5 do
                    {sleep 1s}
                }
                || We are done. Destroy the Splash Screen.
                {SplashScreen.destroy}
                
                {exit}
             else
                {wc.consume}
            }
        }
    }
}

v





Messages In This Thread
RE: Applet 終了中にはサブアプレットを表示できない? - by dyoshida - 07-28-2013, 05:21 AM

Possibly Related Threads...
Thread Author Replies Views Last Post
Sad How to embedded windows media player control to applet or detach applet hungncv 1 2,941 02-09-2014, 02:19 AM
Last Post: wbardwell
  applet 終了中にはサブアプレットを表示できない? umemura 1 2,891 02-22-2013, 05:46 PM
Last Post: umemura
  forced applet resync RobertShiplett 1 2,928 07-13-2012, 12:20 PM
Last Post: wbardwell
Forum Jump:


Users browsing this thread:
1 Guest(s)

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: 'mybb_threadviews' (errno: 2)
Query:
INSERT INTO mybb_threadviews (tid) VALUES('945')