From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=HTML_MESSAGE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 623E8BC6B for ; Wed, 31 Oct 2007 05:19:39 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAMifJ0eAKs4Fnmdsb2JhbACCQjCLcwIBAQcEBhEYgRM X-IronPort-AV: E=Sophos;i="4.21,349,1188770400"; d="scan'208,217";a="3757217" Received: from netscaler2.rice.edu (HELO mh2.mail.rice.edu) ([128.42.206.5]) by mail2-smtp-roc.national.inria.fr with ESMTP; 31 Oct 2007 05:19:26 +0100 Received: from mh2.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh2.mail.rice.edu (Postfix) with ESMTP id A7F2736D421 for ; Tue, 30 Oct 2007 23:19:24 -0500 (CDT) X-Virus-Scanned: by amavis-2.4.4 at mh2.mail.rice.edu Received: from mh2.mail.rice.edu ([127.0.0.1]) by mh2.mail.rice.edu (mh2.mail.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pt6UqIezKOII for ; Tue, 30 Oct 2007 23:19:24 -0500 (CDT) Received: from [10.194.94.87] (unknown [10.194.94.87]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mh2.mail.rice.edu (Postfix) with ESMTP id 65D1C36D419 for ; Tue, 30 Oct 2007 23:19:24 -0500 (CDT) Mime-Version: 1.0 (Apple Message framework v752.3) To: caml-list@yquem.inria.fr Message-Id: <1DAD7447-1297-4E8A-88FC-971A235AE270@cs.rice.edu> Content-Type: multipart/alternative; boundary=Apple-Mail-61-748794398 From: Angela Zhu Subject: GWindow message_dialog Date: Tue, 30 Oct 2007 23:19:19 -0500 X-Mailer: Apple Mail (2.752.3) X-Spam: no; 0.00; gwindow:01 gwindow:01 angela:98 angela:98 monaco:98 monaco:98 defining:02 defining:02 let:03 let:03 gui:03 gui:03 zhu:04 zhu:04 click:92 --Apple-Mail-61-748794398 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Dear all, I want to create a GWindow.message_dialog with the following functionality in my GUI: If I click on a button "reset" or "run", it prompt out a message " program is running, please wait..." And it disappear after, say, 3 seconds. (I want this message here is to let the user know the program is responding, but it will take a while before getting the result. ) I am defining a function like this: let print_sim_wait str win () = let my_message = if (str="run") then "Program running, please wait ... " else "System state resetting, please wait ... " in let diag = GWindow.message_dialog ~message_type:`INFO ~buttons:GWindow.Buttons.ok ~message: my_message ~destroy_with_parent: true ~parent:win () in let res = diag#run () = `OK in diag#destroy () However, this requires the user to click on "OK" every time to close the window. Can we set a timeline, such that the window will destroy itself after a while, without requiring any action? Thanks, Angela ------------------------------------------ Dept. of CS, Rice Unitersity http://www.cs.rice.edu/~yz2/ ------------------------------------------ --Apple-Mail-61-748794398 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1 Dear all,

I want to create a = GWindow.message_dialog with the following functionality in my = GUI:

If I = click on a button "reset" or "run",
it prompt out a message " = program is running, please wait..."
And it disappear after, = say, 3 seconds.
(I want this message here is to let the user = know the program is responding, but it=A0
will take a while = before getting the result. )

I am defining a function = like this:

let print_sim_wait = str win () =3D
=A0 = let my_message =3D = if = (str=3D"run") = then = "Program running, please wait ... = "=A0
else=A0"System state resetting, please wait ... = " =
=A0 in
=A0 = let diag =3D = GWindow.message_dialog ~message_type:`INFO
~buttons:GWindow.Buttons.ok
~message: my_message=A0
~destroy_with_parent: true = ~parent:win () in
=A0 =A0 = let res =3D diag#run = () =3D `OK in
diag#destroy = ()

However, this requires the = user to click on "OK" every time to close the window.
Can we = set a timeline, such that the window will=A0destroy itself after a = while,
without requiring any action?

Thanks,
Angela
------------------------------------------
Dept. of CS, Rice Unitersity
http://www.cs.rice.edu/~yz2/
------------------------------------------

= --Apple-Mail-61-748794398--