How to use file_chooser_dialog

Richard Jones rich at annexia.org
Fri Mar 4 11:39:48 CET 2005


Thanks, that works.  For future reference, I now have the following
code which works correctly.

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

Rich.

-- 
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com




More information about the Lablgtk-list mailing list