How to use file_chooser_dialog

Richard Jones rich at
Fri Mar 4 01:04:59 CET 2005

I can't work this one out.

So far I have this, but the Cancel button acts as an accept button.

  let callback () =
    let dialog = GWindow.file_chooser_dialog ~action:`OPEN () in
    dialog#add_select_button_stock `CANCEL `CANCEL;
    dialog#add_select_button_stock `OPEN `ACCEPT;
    if dialog#run () = `ACCEPT then (
      let filename = dialog#filename in
	(fun filename -> prerr_endline ("filename = " ^ filename)) filename;
    dialog#destroy ()
  open_item#connect#activate ~callback;


Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology -
Team Notepad - intranets and extranets for business -

More information about the Lablgtk-list mailing list