Date: Fri, 4 Mar 2005 00:04:59 +0000 To: lablgtk at math.nagoya-u.ac.jp Subject: How to use file_chooser_dialog Message-ID: <20050304000458.GA28358 at furbychan.cocan.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline From: Richard Jones 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 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