From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.0 required=3.0 tests=BAYES_20,FREEMAIL_FROM, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:ac8:5744:0:b0:2f3:d85a:a518 with SMTP id 4-20020ac85744000000b002f3d85aa518mr41857281qtx.465.1653888521863; Sun, 29 May 2022 22:28:41 -0700 (PDT) X-Received: by 2002:a81:7c45:0:b0:300:2f8c:7cf2 with SMTP id x66-20020a817c45000000b003002f8c7cf2mr29278012ywc.255.1653888521705; Sun, 29 May 2022 22:28:41 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.uzoreto.com!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 29 May 2022 22:28:41 -0700 (PDT) Injection-Info: google-groups.googlegroups.com; posting-host=2601:3c3:400:b30:5bbb:11d1:c956:9424; posting-account=JSxOkAoAAADa00TJoz2WZ_46XrZCdXeS NNTP-Posting-Host: 2601:3c3:400:b30:5bbb:11d1:c956:9424 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: GtkAda's "On_Edited" From: John Perry Injection-Date: Mon, 30 May 2022 05:28:41 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2893 Xref: reader02.eternal-september.org comp.lang.ada:63885 List-Id: I'm trying to edit a cell in a Tree_View with a List_Store, and saw in GtkA= da's User Guide that it offers the On_Edited procedure. I set up a callback= this way with the following procedure: procedure Editing_Done ( Self : access Gtk_Cell_Renderer_Text_Record'Class; Path : Glib.UTF8_String; -- this is the row New_Text : Glib.UTF8_String ) is begin Tio.Put_Line( Get_Property(Self, Gtk.Cell_Renderer_Text.Text_Property= )'Image ); -- line 1 Tio.Put_Line(Path'Image); -- line 2 Tio.Put_Line(New_Text'Image); -- line 3 Set_Property(Self, Gtk.Cell_Renderer_Text.Text_Property, New_Text); Self.Stop_Editing( False ); Tio.Put_Line( Get_Property(Self, Gtk.Cell_Renderer_Text.Text_Property= )'Image ); -- line 4 end Editing_Done; I didn't really expect this to work, and it doesn't, but here's what I have= verified it does do, in order: * prints the data that was in the cell before editing (line 1) * prints the row that was edited (line 2) * prints the new text (line 3) * prints the data that is in the cell as the procedure ends (line 4) Lines 3 and 4 agree, which is great! But what I see in the TreeView is that= the cell reverts after editing to the value in Line 1. My questions: 1) The documentation of On_Edited states that I am supposed to "update the = model and store New_Text at the position indicated by Path." How do I get t= he model? I understand that "Path" indicates the row in the List_Store / Tr= eeView, but Get_Model's Signature requires a TreeView, which I do not have. 2) What else might I be missing from a correct implementation of the On_Edi= ted callback? thanks in advance john perry