Message-ID: <41EE51AB.40203 at tin.it> Date: Wed, 19 Jan 2005 13:25:15 +0100 From: Stalkern 2 MIME-Version: 1.0 To: lablgtk at kaba.or.jp Cc: amedeo Subject: Re: Editable cells: does anybody know this? References: <200401191612.17243.stalkern2 at tin.it> <16398.40714.242523.541303 at akasha.ijm.jussieu.fr> In-Reply-To: <16398.40714.242523.541303 at akasha.ijm.jussieu.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Olivier Andrieu wrote: > Stalkern 2 [Monday 19 January 2004] : > > > > Hello to everybody > > > > I've a columned tree with editable cells and it works greats, > > except that if I am not careful in selecting the cell text, and I > > "drag" the selected text away, ASA I "drop" the text, everything > > crashes with the message > > > > uncaught exception Glib.Critical("Gtk", "file gtkwidget.c: line > > 3065 (gtk_widget_event): assertion `WIDGET_REALIZED_FOR_EVENT > > (widget, event)' failed") > > OK, it doesn't really crash, it's just that LablGTK converts a message > of level CRITICAL into an exception, which stops everything. LablGTK > is a bit over-reacting here, the program runs fine when this is > disabled: it just prints messages but nothing else happens. > > > Does anybody know how comes that I inherited a DnD without any > > little effort of me? How can I discard it? > > Don't know. > I was contacted lately by Amedeo Bonfiglio (amedeo.bonfiglio AT rcm.inet.it) asking me how did I finally solve this issue. I had dropped the matter, but after his message I looked back at it and I noticed that actually, the GUI crashed when a text cell of a tree was edited, and the text was dragged away, then dropped. HOWEVER, the GUI seemed to crash ONLY when the callback bound to the edited signal was instructed to perform an update of the tree store with a call to treeStore#set. As far as I can see, dragging the text away leads actually to the emission of the signal "edited", and if the signal "edited" is bound to updating the cell renderers, then when the dragged item is dropped, it can not find its source any more and then raise the error (others will have a better insight, I'm just guessing). I told so so Amedeo, and he found a workaround consisting in avoiding updating the tree store, when the content of the cell is unchanged (e.g. when the text is dragged away). So: I write this here for documentation purposes, I'm very happy about the workaround and I thank Amedeo for his contribution. Ciao! Ernesto