Date: Wed, 12 Jun 2002 13:41:48 +0200 From: Johann Spies To: lablgtk at kaba.or.jp Subject: Re: Catching a signal from combo field Message-ID: <20020612114148.GG30062 at adept.co.za> Mail-Followup-To: Johann Spies , lablgtk at kaba.or.jp References: <20020611151951.GA23882 at adept.co.za> <20020612092458A.garrigue at kurims.kyoto-u.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020612092458A.garrigue at kurims.kyoto-u.ac.jp> Sender: Johann Spies Hello Jaques, Thanks for your answer. It helped me to understand a little bit better, but I am still stuck. > I am not sure of what you are trying to do, in particular your mail > does not include the code you are compiling. I am using glade in combination with mlglade which produces three files: gtknw_glade_callbacks.ml gtknw_glade_interface.ml gtknw_glade_main.ml In *main.ml I have the opportunity to define reaction on callbacks which will override the callbacks in gtknw_glade_callbacks.ml: inherit Gtknw_glade_callbacks.default_callbacks Glade shows two widgets for the combo-field: combo1 and server (the entry-field). And in Glade I can select a signal which will be used in the callback process. After your mail I select the "changed" callback in glade from the "server" widget. It seems that either there is a bug in mlglade (because I don't see the callback mentioned somewhere in the three files although it is defined in the gtknw.glade file) or I am not understanding the process properly. It seems that my callback method (the snippet I posted previously) is not used at all. > However here is some way to track changes on a combo box: I am not sure where in this in the code. > > # let w = GWindow.window ~show:true ();; > val w : GWindow.window = > # let c = GEdit.combo ~popdown_strings:["A";"B";"C"] ~packing:w#add ();; > val c : GEdit.combo = > # c#entry#connect#changed (fun () -> prerr_endline c#entry#text);; > - : GtkSignal.id = > > By the way, this is precisely because using box signals on a combobox > is meaningless that the lablgtk combobox is not a box. At the moment my "callback" looks like this but the print_string-line never gets executed so the signal is either not registered with the correct widget or I don't understand at all what is going on. I might try to work without glade, but I could so far not find a proper tutorial on Lablgtk. The Glade - mlglade combination at least provide me with a platform to work from and do something useful while I try and figure out what is going on in the code. Regards. Johann -- Johann Spies Telefoon: 021-808 4036 Informasietegnologie, Universiteit van Stellenbosch "And he said unto Jesus, Lord, remember me when thou comest into thy kingdom. And Jesus said unto him, Verily I say unto thee, To day shalt thou be with me in paradise." Luke 23:42,43