Date: Mon, 18 Dec 2000 13:23:40 +0100 To: Jacques Garrigue Cc: luther at dpt-info.u-strasbg.fr, lablgtk at kaba.or.jp Subject: file_selection_complete patch. Message-ID: <20001218132340.A29055 at lambda.u-strasbg.fr> References: <20001211163431.A15168 at lambda.u-strasbg.fr> <20001212104754R.garrigue at kurims.kyoto-u.ac.jp> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="+HP7ph2BbKc20aGI" Content-Disposition: inline In-Reply-To: <20001212104754R.garrigue at kurims.kyoto-u.ac.jp>; from garrigue at kurims.kyoto-u.ac.jp on Tue, Dec 12, 2000 at 10:47:54AM +0900 From: Sven LUTHER Sender: Sven LUTHER --+HP7ph2BbKc20aGI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello Jacques, ... I noticed the file_selection widget lacked support for the complete function, so i added it and am sending you here the corresponding patch. I hope it is ok especially as regarding the file_selection constructor, as i am not that familiar with the labels and optional argument. How do you program it so that if the filter optional argument is present, you call the complete method with it, or otherwise you don't do anything (maybe some of the may stuff i saw all over the place ?) Anyway, the patch is attached here. Friendly, Sven Luther --+HP7ph2BbKc20aGI Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="lablgtk-file_selection_complete.diff" --- lablgtk-1.00.2000.11.29.orig/gtkWindow.ml +++ lablgtk-1.00.2000.11.29/gtkWindow.ml @@ -111,6 +111,8 @@ = "ml_gtk_file_selection_set_filename" external get_filename : [>`filesel] obj -> string = "ml_gtk_file_selection_get_filename" + external complete : [>`filesel] obj -> string -> unit + = "ml_gtk_file_selection_complete" external show_fileop_buttons : [>`filesel] obj -> unit = "ml_gtk_file_selection_show_fileop_buttons" external hide_fileop_buttons : [>`filesel] obj -> unit --- lablgtk-1.00.2000.11.29.orig/gWindow.ml +++ lablgtk-1.00.2000.11.29/gWindow.ml @@ -92,6 +92,7 @@ method connect = new container_signals obj method set_filename = FileSelection.set_filename obj method get_filename = FileSelection.get_filename obj + method complete = FileSelection.complete obj method set_fileop_buttons = FileSelection.set_fileop_buttons obj method ok_button = new GButton.button (FileSelection.get_ok_button obj) method cancel_button = @@ -100,7 +101,7 @@ end let file_selection ?(title="Choose a file") ?filename - ?(fileop_buttons=false) + ?(filter="*") ?(fileop_buttons=false) ?wm_name ?wm_class ?position ?allow_shrink ?allow_grow ?auto_shrink ?modal ?x ?y ?border_width ?width ?height ?(show=false) () = @@ -110,7 +111,9 @@ ?allow_shrink ?allow_grow ?auto_shrink ?modal ?x ?y; Container.set w ?border_width ?width ?height; if show then Widget.show w; - new file_selection w + let file_selection = new file_selection w in + file_selection#complete filter; + file_selection class font_selection_dialog obj = object inherit [window] window_skel (obj : Gtk.font_selection_dialog obj) --- lablgtk-1.00.2000.11.29.orig/ml_gtk.c +++ lablgtk-1.00.2000.11.29/ml_gtk.c @@ -445,6 +445,7 @@ ML_1 (gtk_file_selection_new, String_val, Val_GtkWidget_window) ML_2 (gtk_file_selection_set_filename, GtkFileSelection_val, String_val, Unit) ML_1 (gtk_file_selection_get_filename, GtkFileSelection_val, Val_string) +ML_2 (gtk_file_selection_complete, GtkFileSelection_val, String_val, Unit) ML_1 (gtk_file_selection_show_fileop_buttons, GtkFileSelection_val, Unit) ML_1 (gtk_file_selection_hide_fileop_buttons, GtkFileSelection_val, Unit) Make_Extractor (gtk_file_selection_get, GtkFileSelection_val, ok_button, --+HP7ph2BbKc20aGI--