To: Claude.Marche at lri.fr Cc: lablgtk at kaba.or.jp Subject: Re: widget GtkList In-Reply-To: <15170.61885.105440.410208 at mailhost.lri.fr> References: <15170.58733.335853.322365 at mailhost.lri.fr> <20010704115041.A7551@clipper.ens.fr> <15170.61885.105440.410208@mailhost.lri.fr> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Wed_Jul__4_20:00:50_2001_626)--" Content-Transfer-Encoding: 7bit Message-Id: <20010704200105V.garrigue at kurims.kyoto-u.ac.jp> Date: Wed, 04 Jul 2001 20:01:05 +0900 From: Jacques Garrigue Lines: 92 ----Next_Part(Wed_Jul__4_20:00:50_2001_626)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Claude Marche > OK, I did not explain my problem right : it seems to me that the class > GList.liste is missing a method 'connect'. Is this what you mean by "not > implemented in the toplevel widget system" ? How should I proceed > without it ? You're right. The signals were forgotten for this seldom used class. GList.clist offers much more functionality, but can also be confusing. Anyway, here is a patch if you want to use them. Jacques ----Next_Part(Wed_Jul__4_20:00:50_2001_626)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Description: gList.diffs Content-Disposition: attachment; filename="gList.diffs" Index: src/gList.ml =================================================================== RCS file: /staff2/garrigue/repos/lablgtk/src/gList.ml,v retrieving revision 1.25 retrieving revision 1.26 diff -c -r1.25 -r1.26 *** src/gList.ml 2000/06/15 09:52:09 1.25 --- src/gList.ml 2001/07/04 10:57:12 1.26 *************** *** 25,33 **** --- 25,46 ---- if show then item#misc#show (); item + class liste_signals obj = object + inherit container_signals (obj : Gtk.liste obj) + method selection_changed = + GtkSignal.connect obj ~sgn:Liste.Signals.selection_changed ~after + method select_child ~callback = + GtkSignal.connect obj ~sgn:Liste.Signals.select_child ~after + ~callback:(fun w -> callback (new list_item (ListItem.cast w))) + method unselect_child ~callback = + GtkSignal.connect obj ~sgn:Liste.Signals.unselect_child ~after + ~callback:(fun w -> callback (new list_item (ListItem.cast w))) + end + class liste obj = object inherit [list_item] item_container (obj : Gtk.liste obj) method private wrap w = new list_item (ListItem.cast w) + method connect = new liste_signals obj method insert w = Liste.insert_item obj w#as_item method clear_items = Liste.clear_items obj method select_item = Liste.select_item obj Index: src/gList.mli =================================================================== RCS file: /staff2/garrigue/repos/lablgtk/src/gList.mli,v retrieving revision 1.25 retrieving revision 1.26 diff -c -r1.25 -r1.26 *** src/gList.mli 2000/06/15 09:52:09 1.25 --- src/gList.mli 2001/07/04 10:57:13 1.26 *************** *** 22,33 **** --- 22,43 ---- ?height:int -> ?packing:(list_item -> unit) -> ?show:bool -> unit -> list_item + class liste_signals : Gtk.liste obj -> + object + inherit container_signals + val obj : Gtk.liste obj + method select_child : callback:(list_item -> unit) -> GtkSignal.id + method selection_changed : callback:(unit -> unit) -> GtkSignal.id + method unselect_child : callback:(list_item -> unit) -> GtkSignal.id + end + class liste : Gtk.liste obj -> object inherit [list_item] item_container val obj : Gtk.liste obj method child_position : list_item -> int method clear_items : start:int -> stop:int -> unit + method connect : liste_signals method insert : list_item -> pos:int -> unit method select_item : pos:int -> unit method unselect_item : pos:int -> unit ----Next_Part(Wed_Jul__4_20:00:50_2001_626)----