comp.lang.ada
 help / color / mirror / Atom feed
* Highlighting words in a GtkAda Text_View
@ 2020-03-10 11:55 Stephen Davies
  2020-03-12 17:06 ` Stephen Davies
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Davies @ 2020-03-10 11:55 UTC (permalink / raw)


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)?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Highlighting words in a GtkAda Text_View
  2020-03-10 11:55 Highlighting words in a GtkAda Text_View Stephen Davies
@ 2020-03-12 17:06 ` Stephen Davies
  2020-03-12 17:33   ` Dmitry A. Kazakov
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Davies @ 2020-03-12 17:06 UTC (permalink / raw)


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).

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Highlighting words in a GtkAda Text_View
  2020-03-12 17:06 ` Stephen Davies
@ 2020-03-12 17:33   ` Dmitry A. Kazakov
  2020-03-12 18:27     ` joviangm
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry A. Kazakov @ 2020-03-12 17:33 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Highlighting words in a GtkAda Text_View
  2020-03-12 17:33   ` Dmitry A. Kazakov
@ 2020-03-12 18:27     ` joviangm
  2020-03-13 15:35       ` Stephen Davies
  0 siblings, 1 reply; 5+ messages in thread
From: joviangm @ 2020-03-12 18:27 UTC (permalink / raw)


Hmm, that looks promising, especially the GtkTextExtendSelectionWord enum, I’ll give it a try.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Highlighting words in a GtkAda Text_View
  2020-03-12 18:27     ` joviangm
@ 2020-03-13 15:35       ` Stephen Davies
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Davies @ 2020-03-13 15:35 UTC (permalink / raw)


On Thursday, 12 March 2020 18:27:56 UTC, jovi...@gmail.com  wrote:
> Hmm, that looks promising, especially the GtkTextExtendSelectionWord enum, I’ll give it a try.

Looks like that feature is newer than the version we're using.
Oh well, thanks anyway.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-03-13 15:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-10 11:55 Highlighting words in a GtkAda Text_View Stephen Davies
2020-03-12 17:06 ` Stephen Davies
2020-03-12 17:33   ` Dmitry A. Kazakov
2020-03-12 18:27     ` joviangm
2020-03-13 15:35       ` Stephen Davies

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox