caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Angela Zhu" <angela22.zhu@gmail.com>
To: "Julien Moutinho" <julien.moutinho@gmail.com>, caml-list@yquem.inria.fr
Subject: Re: [Caml-list] problem with gbutton
Date: Fri, 2 Nov 2007 22:20:24 -0500	[thread overview]
Message-ID: <f82e818a0711022020r36363925nba61dac4e4dadd87@mail.gmail.com> (raw)
In-Reply-To: <20071102234738.GA7257@localhost>

[-- Attachment #1: Type: text/plain, Size: 1679 bytes --]

I also want to add

      GMain.Idle.add ~callback:(fun () ->  true);

But I keep getting:

***********
Expecting function has type ?prio:int -> (unit -> bool) -> Glib.Idle.id
This argument cannot be applied with label ~callback

Any idea?

Thanks,
Angela



On 11/2/07, Julien Moutinho <julien.moutinho@gmail.com> wrote:
>
> On Fri, Nov 02, 2007 at 05:48:01PM -0500, Angela Zhu wrote:
> > Can anyone give me an example how to set a GButton.button to be
> > insensitive or not according to a boolean value "isActive"?
>
> The method #misc#set_sensitive, used by a few examples
> in the sources of LablGTK, and documented here:
>
> http://plus.kaist.ac.kr/~shoh/ocaml/lablgtk2/lablgtk-2.4.0/doc/html/GObj.misc_ops.html#METHODset_sensitive
> may do the job:
>
> % cat test.ml
> let _ =
>     let window = GWindow.window ()
>       ~show: true in
>     let button = GButton.button ()
>       ~label: "hello"
>       ~packing: window#add in
>     let isActive = false in
>     button#misc#set_sensitive isActive;
>     ignore (window#connect#destroy
>       ~callback: GMain.quit);
>     GMain.main ()
>
> % ocamlc -o test -I +lablgtk2 lablgtk.cma gtkInit.cmo test.ml
> % ./test
>
> HTH,
>   Julien.
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>



-- 
Regards,
Angela Zhu
------------------------------------------
Dept. of CS, Rice University
http://www.cs.rice.edu/~yz2/
------------------------------------------

[-- Attachment #2: Type: text/html, Size: 2888 bytes --]

  reply	other threads:[~2007-11-03  3:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-02 22:48 Angela Zhu
2007-11-02 23:47 ` [Caml-list] " Julien Moutinho
2007-11-03  3:20   ` Angela Zhu [this message]
2007-11-03  4:02     ` Julien Moutinho
2007-11-03  4:17       ` Angela Zhu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f82e818a0711022020r36363925nba61dac4e4dadd87@mail.gmail.com \
    --to=angela22.zhu@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=julien.moutinho@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).