Message-ID: <43B5A495.2090709 at rftp.com> Date: Fri, 30 Dec 2005 13:20:21 -0800 From: Robert Roessler Organization: Robert's High-performance Software MIME-Version: 1.0 To: LablGTK List Subject: Re: bug in GEdit.combo_box_text? References: <43B5817F.80906 at rftp.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Maurizio Colucci wrote: > 2005/12/30, Robert Roessler : >> Maurizio Colucci wrote: >>> I can't seem to set the default entry in a combo box: the following code >>> >>> let surfOptMenu = GEdit.combo_box_text ~strings:["Cement"; "Clay"; "Grass"] >>> ~packing:(mainGrid#attach ~left:1 ~top:0) ~active:0 () in >>> >>> >>> gives the following output: >>> >>> (freetennis:15185): Gtk-CRITICAL **: gtk_tree_row_reference_new: >>> assertion `GTK_IS_TREE_MODEL (model)' failed >>> >>> (freetennis:15185): Gtk-CRITICAL **: gtk_cell_view_set_displayed_row: >>> assertion `GTK_IS_TREE_MODEL (cell_view->priv->model)' >>> >>> >>> and the combo box appears empty. >>> >>> Any ideas for a workaround? I am using lablgtk2 as in Ubuntu Breezy >>> (version 2.4.0+2005.06.13-1build1). >> If the "2.4.0+..." above corresponds to the LablGTK release, then it >> is not current - a newer release has been out for two months. You >> could just grab the current source tree at >> >> http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgtk.html >> >> and build it locally... builds are pretty smooth, even for Windows! :) >> >> Also, do not overlook the "examples" directory tree - the file >> combobox.ml shows uses of combo_box_text. Note that the default item >> is being set explicitly just after creation, plus the tuple nature of >> the constructed value. >> >> Robert Roessler >> robertr at rftp.com >> http://www.rftp.com >> > > Thank you Robert. I installed version 2.6.0 but, unfortunately, the > problem remains: the combobox looks empty by default (even though the > items appear when you click on it), and I get those runtime errors. > The error is caused by passing ~active:0 to GEdit.combo_box_text. > Any ideas? Thanks anyway :-) This reminds me of "X hurts!"... "So don't do X!". :) Am I misunderstanding your problem or did you miss the part of my reply about "... the default item is being set explicitly just after creation" (referring to the example code in combobox.ml)? The examples seem to always use the set_active method - which may or may not have anything to do with bugs. Robert Roessler robertr@rftp.com http://www.rftp.com