- g#set_progress_callback (
- fun proc_nr serial position total ->
- debug "progress callback proc_nr=%d serial=%d posn=%Ld total=%Ld"
- proc_nr serial position total;
- GtkThread.async !progress_hook (position, total)
+ ignore (
+ g#set_event_callback (
+ fun g event handle buf array ->
+ if event == G.EVENT_PROGRESS && Array.length array >= 4 then (
+ let proc_nr = array.(0)
+ and serial = array.(1)
+ and position = array.(2)
+ and total = array.(3) in
+ debug "progress callback proc_nr=%Ld serial=%Ld posn=%Ld total=%Ld"
+ proc_nr serial position total;
+ GtkThread.async !progress_hook (position, total)
+ )
+ ) [ G.EVENT_PROGRESS ]