jehenrik at yahoo.com
Thu May 3 07:18:14 CEST 2001
I'm a new lablgtk user, and I have a few questions:
1) are all the examples known to work on windows? I get segfaults on some of them. In particular, one bug I tracked down was that
all calls to the Gtk timer callback mechanism result in a crash upon the second callback. (lissajous.ml is one such example. You
can observe the one successful callback by setting the time value to be large.) As I am new to the Caml FFI (and Caml in general)
I do not know where to suspect a bug.
2) Is there a way to repaint a window in a multithreaded app from a non-drawing thread? It seems that most of the examples just
call their own paint handlers directly. This is bad when you have multiple theads because to get your drawing right it's best to
have only one thread drawing. The ordinary way to deal with this is to send an expose message to yourself when you want to paint.
But I can't figure out how to use any of the "emit" functions in gtkSignal.ml or anywhere else:
let emit (obj : 'a obj) ~(sgn : ('a, 'b) t)
~(emitter : 'a obj -> name:string -> 'b) =
emitter obj ~name:sgn.name
external emit_none : 'a obj -> name:string -> unit -> unit
let emit_unit obj ~sgn = emit obj ~emitter:emit_none ~sgn ()
external emit_int : 'a obj -> name:string -> int -> unit
let emit_int = emit ~emitter:emit_int
In particular, I don't understand what the type "obj" is, what namespace it's from, and how it relates to an ordinary GWindow.
More information about the Lablgtk-list