To: luther at dpt-info.u-strasbg.fr Cc: lablgtk at kaba.or.jp Subject: Re: some lablgtk/lablGL questions ... In-Reply-To: <20001213133913.A1582 at lambda.u-strasbg.fr> References: <20001211163431.A15168 at lambda.u-strasbg.fr> <20001212104754R.garrigue@kurims.kyoto-u.ac.jp> <20001213133913.A1582@lambda.u-strasbg.fr> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20001213231654N.garrigue at kurims.kyoto-u.ac.jp> Date: Wed, 13 Dec 2000 23:16:54 +0900 From: Jacques Garrigue Lines: 51 From: Sven LUTHER > Another set of questions/remarks : > > * How do i use polymorphic variants that are inside of modules without > opening them ? both Module_A.`Var_A and `Module_A.Var_A don't work. That's what's nice about polymorphic variants: no need to open a module, or use a dot notation. `Var_A is just `Var_A, independently of the type in which it is used. > * Why are the coordinates of the button_press event floats and not ints ? Because this is the way it is defined in gdk (see include/gdk/gdktypes.h). I suppose some pointing device might return non-integer values ? > * The clist#get_row_column has problem, the column coordinate is always 0, > and the row coordinate seems to be divided by 2 (well i hadn't time to > check it, but seems like an additional Int_Val/Val_Int was used. Maybe the > float->int conversion i was forced to use caused this problem also.) Right, division by 2 is the classical consequence of forgetting a Val_int. This also explains the problem if there are only two columns. Here is a checked patch. Index: ml_gtklist.c =================================================================== RCS file: /staff2/garrigue/repos/lablgtk/ml_gtklist.c,v retrieving revision 1.1 diff -u -r1.1 ml_gtklist.c --- ml_gtklist.c 2000/11/16 08:15:18 1.1 +++ ml_gtklist.c 2000/12/13 14:14:17 @@ -152,10 +152,10 @@ value ret; if (!gtk_clist_get_selection_info (GtkCList_val(clist), Int_val(x), Int_val(y), &row, &column)) - invalid_argument ("Gtk.Clist.get_selection_info"); + invalid_argument ("Gtk.Clist.get_row_column"); ret = alloc_small (2,0); - Field(ret,0) = row; - Field(ret,1) = column; + Field(ret,0) = Val_int(row); + Field(ret,1) = Val_int(column); return ret; } ML_1 (gtk_clist_select_all, GtkCList_val, Unit) Cheers, Jacques