From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED.3d73Ybk3C5U4I2t8lv+lAQ.user.gioia.aioe.org!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Highlighting words in a GtkAda Text_View Date: Thu, 12 Mar 2020 18:33:35 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <8f54225f-0700-446a-88bd-5b7e10d931ed@googlegroups.com> NNTP-Posting-Host: 3d73Ybk3C5U4I2t8lv+lAQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:58198 Date: 2020-03-12T18:33:35+01:00 List-Id: On 2020-03-12 18:06, Stephen Davies wrote: > On Tuesday, 10 March 2020 11:55:33 UTC, Stephen Davies wrote: >> I have created a simple GtkAda GUI which contains a read-only Text_View >> widget. The Text_View consists of a few lines which end with strings of >> the format "= ABC123x\*.ext". When a user double-clicks over the >> numeric part, only the "123" section is highlighted. I would prefer >> either the "ABC123x" section or the "ABC123x\*.ext" section to be >> highlighted. Is this possible (and simple for a Gtk newb like myself)? > > Bump (I'll take the hint and give in if this also gets no replies). Is it about text selection? If so there is a signal "extend-selection" emitted upon. I never used it, but I guess that you can connect to it and adjust selection's starting and ending iterators. See: https://developer.gnome.org/gtk3/stable/GtkTextView.html#GtkTextView-extend-selection There is probably no typed form of this signal callback in GtkAda, so you should use a general form with GValues. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de