Date: Fri, 18 Jun 2004 15:31:59 +0900 (JST) Message-Id: <20040618.153159.68559660.garrigue at kurims.kyoto-u.ac.jp> To: arnold.guillaumot at wanadoo.fr Cc: lablgtk at kaba.or.jp Subject: Re: Rsvg and GTree problems From: Jacques GARRIGUE In-Reply-To: <19575998.1087535511200.JavaMail.www at wwinf0101> References: <19575998.1087535511200.JavaMail.www at wwinf0101> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: arnold.guillaumot at wanadoo.fr > I am currently playing on win32 and linux with lablgtk2 (snapshot > 20040319 from CVS) and I encountered few problems. That's very courageous of you, thank you :-) (Gtk on windows is not always easy) > 1/ Rsvg > It is not possible to load rsvg files on win32 platform with the > render_from_file function. Changing opening files with open_in_bin > instead of open_in should fix it in rsvg.ml By should, do you mean that it worked for you? Since we don't often try on windows, we would like to know for sure. > 2/ GTree > When I was trying to know in which column of the tree view was the > cursor, I could not use the method get_cursor of the view class. I > think there is an error in the type declaration of this method. If > you check the gtk doc a GtkTreeViewColumn should be returned by the > function gtk_tree_view_get_cursor (). So the type of the method > should be changed like this (tree_path option * tree_view_column obj > option) instead of (tree_path option * tree_view_column option). The > "obj " is important if you look at the type tree_view_column in > gtk.ml (note that the module TreeView in gtkTree.ml should be > changed accordingly). You're completely right. I've just fixed it. I join the patch. > Then the last point, I cannot succeed having the method > set_visible_func (model_filter class) to work. I have always a > segfault. There is a simple test to do changing the tree_model.ml > example as follows : > replace (in let make_model data) : > f#set_visible_column vis_col > by : > f#set_visible_func (fun m row -> > let b = m#get ~row ~column:vis_col in > b) > > I do not know what I am doing wrong here, but I am stuck. > Any help would be appreciated. Probably Olivier would answer you on this problem. The code seems correct... Jacques Index: src/gTree.ml =================================================================== RCS file: /staff2/garrigue/repos/lablgtk/src/gTree.ml,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- src/gTree.ml 18 Mar 2004 07:05:28 -0000 1.48 +++ src/gTree.ml 18 Jun 2004 06:12:32 -0000 1.49 @@ -365,8 +365,14 @@ | Some cell -> TreeView.set_cursor_on_cell obj ~edit row (as_column col) cell#as_renderer - method get_cursor () = TreeView.get_cursor obj - method get_path_at_pos = TreeView.get_path_at_pos obj + method get_cursor () = + match TreeView.get_cursor obj with + path, Some vc -> path, Some (new view_column vc) + | _, None as pair -> pair + method get_path_at_pos ~x ~y = + match TreeView.get_path_at_pos obj ~x ~y with + Some (p, c, x, y) -> Some (p, new view_column c, x, y) + | None -> None end let view ?model ?hadjustment ?vadjustment = let model = may_map (fun m -> m#as_model) model in Index: src/gTree.mli =================================================================== RCS file: /staff2/garrigue/repos/lablgtk/src/gTree.mli,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- src/gTree.mli 18 Mar 2004 07:05:29 -0000 1.44 +++ src/gTree.mli 18 Jun 2004 06:12:32 -0000 1.45 @@ -360,9 +360,9 @@ method expander_column : view_column option method fixed_height_mode : bool method get_column : int -> view_column - method get_cursor : unit -> tree_path option * tree_view_column option + method get_cursor : unit -> tree_path option * view_column option method get_path_at_pos : - x:int -> y:int -> (tree_path * tree_view_column obj * int * int) option + x:int -> y:int -> (tree_path * view_column * int * int) option method hadjustment : GData.adjustment method headers_visible : bool method insert_column : view_column -> int -> int Index: src/gtkTree.ml =================================================================== RCS file: /staff2/garrigue/repos/lablgtk/src/gtkTree.ml,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- src/gtkTree.ml 18 Mar 2004 07:05:29 -0000 1.39 +++ src/gtkTree.ml 18 Jun 2004 06:12:32 -0000 1.40 @@ -304,7 +304,7 @@ [>`treeviewcolumn] obj -> [>`cellrenderer] obj -> edit:bool -> unit = "ml_gtk_tree_view_set_cursor_on_cell" external get_cursor : - [>`treeview] obj -> tree_path option * tree_view_column option + [>`treeview] obj -> tree_path option * tree_view_column obj option = "ml_gtk_tree_view_get_cursor" external get_path_at_pos : [>`treeview] obj -> x:int -> y:int ->