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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id DF100BC6B for ; Wed, 31 Oct 2007 06:21:24 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAANetJ0eAKs4Fnmdsb2JhbACCcotzAgEBBwQGERiBEw X-IronPort-AV: E=Sophos;i="4.21,349,1188770400"; d="scan'208,217";a="5304800" Received: from netscaler2.rice.edu (HELO mh1.mail.rice.edu) ([128.42.206.5]) by mail3-smtp-sop.national.inria.fr with ESMTP; 31 Oct 2007 06:21:22 +0100 Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 09F23385D67 for ; Wed, 31 Oct 2007 00:21:21 -0500 (CDT) X-Virus-Scanned: by amavis-2.4.4 at mh1.mail.rice.edu Received: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PsoE6qfUPG7b for ; Wed, 31 Oct 2007 00:21:20 -0500 (CDT) Received: from [192.168.1.102] (c-98-195-25-217.hsd1.tx.comcast.net [98.195.25.217]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mh1.mail.rice.edu (Postfix) with ESMTP id B8F47385B40 for ; Wed, 31 Oct 2007 00:21:20 -0500 (CDT) Mime-Version: 1.0 (Apple Message framework v752.3) To: caml-list@yquem.inria.fr Message-Id: Content-Type: multipart/alternative; boundary=Apple-Mail-64-752513599 From: Angela Zhu Subject: GWindow message_dialog Date: Wed, 31 Oct 2007 00:21:18 -0500 X-Mailer: Apple Mail (2.752.3) X-Spam: no; 0.00; gwindow:01 gwindow:01 angela:98 angela:98 defining:02 defining:02 let:03 let:03 gui:03 gui:03 zhu:04 zhu:04 click:92 click:92 function:08 --Apple-Mail-64-752513599 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-64-752513599 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 ... "
else = "System state resetting, please wait ... "
=A0 in =
=A0 let diag =3D GWindow.message_dialog = ~message_type:`INFO
= ~buttons:GWindow.Buttons.ok
~message: = my_message
~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,
Dept. of CS, Rice Unitersity
http://www.cs.rice.edu/~yz2/
------------------------------------------

= --Apple-Mail-64-752513599-- 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.4 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 822DEBC6B for ; Wed, 31 Oct 2007 08:58:44 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAN/SJ0eFBoIFh2dsb2JhbACOZAIBCAopgRM X-IronPort-AV: E=Sophos;i="4.21,350,1188770400"; d="scan'208";a="18791651" Received: from rabbit.math.nagoya-u.ac.jp ([133.6.130.5]) by mail4-smtp-sop.national.inria.fr with ESMTP; 31 Oct 2007 08:58:43 +0100 Received: from localhost (millas [172.16.30.29]) by rabbit.math.nagoya-u.ac.jp (8.12.11/3.7W) with ESMTP id l9V7wMTc029123; Wed, 31 Oct 2007 16:58:22 +0900 (JST) Date: Wed, 31 Oct 2007 16:58:38 +0900 (JST) Message-Id: <20071031.165838.28790725.garrigue@math.nagoya-u.ac.jp> To: angela.zhu@cs.rice.edu Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] GWindow message_dialog From: Jacques Garrigue In-Reply-To: References: X-Mailer: Mew version 4.0.69 on Emacs 22.0.50 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; gwindow:01 gwindow:01 gmain:01 lablgtk:01 lablgtk:01 angela:98 angela:98 caml-list:01 callback:02 defining:02 garrigue:03 garrigue:03 jacques:03 jacques:03 let:03 From: Angela Zhu > 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? Very easy: just add the following line before diag#run. GMain.Timeout.add ~ms:3000 ~callback:(fun () -> diag#activate_default(); false); Jacques Garrigue By the way, there is a mailing list devoted to LablGTK, http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk 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=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 83E0CBC6B for ; Wed, 31 Oct 2007 13:25:17 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAPoQKEeAKs4Fnmdsb2JhbACOZQIBAQcEBhEYgRM X-IronPort-AV: E=Sophos;i="4.21,351,1188770400"; d="scan'208";a="18800637" Received: from netscaler2.rice.edu (HELO mh1.mail.rice.edu) ([128.42.206.5]) by mail4-smtp-sop.national.inria.fr with ESMTP; 31 Oct 2007 13:25:16 +0100 Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 608A03851DD; Wed, 31 Oct 2007 07:25:15 -0500 (CDT) X-Virus-Scanned: by amavis-2.4.4 at mh1.mail.rice.edu Received: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9leK1Pms8PUS; Wed, 31 Oct 2007 07:25:15 -0500 (CDT) Received: from [192.168.1.100] (c-98-195-25-217.hsd1.tx.comcast.net [98.195.25.217]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mh1.mail.rice.edu (Postfix) with ESMTP id 208C9384710; Wed, 31 Oct 2007 07:25:15 -0500 (CDT) In-Reply-To: <20071031.165838.28790725.garrigue@math.nagoya-u.ac.jp> References: <20071031.165838.28790725.garrigue@math.nagoya-u.ac.jp> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <6097906A-BB5A-44DA-9D00-CD834D6501D2@cs.rice.edu> Cc: caml-list@yquem.inria.fr Content-Transfer-Encoding: 7bit From: Angela Zhu Subject: Re: Re: [Caml-list] GWindow message_dialog Date: Wed, 31 Oct 2007 07:25:10 -0500 To: Jacques Garrigue X-Mailer: Apple Mail (2.752.3) X-Spam: no; 0.00; gwindow:01 gmain:01 lablgtk:01 lablgtk:01 angela:98 angela:98 caml-list:01 callback:02 garrigue:03 jacques:03 zhu:04 zhu:04 timeout:05 inria:06 fun:08 > THanks a lot! Angela ------------------------------------------ Dept. of CS, Rice Unitersity http://www.cs.rice.edu/~yz2/ ------------------------------------------ > Very easy: just add the following line before diag#run. > GMain.Timeout.add ~ms:3000 > ~callback:(fun () -> diag#activate_default(); false); > > Jacques Garrigue > > By the way, there is a mailing list devoted to LablGTK, > http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk >