Re: 'color-activated' signal not emitting



Hi;

On 25 July 2016 at 13:47, Craig Cabrey <craigcabrey gmail com> wrote:

Not really. The documentation says:

"""
Emitted when a color is activated from the color chooser. This usually
happens
when the user clicks a color swatch, or a color is selected and the user
presses
one of the keys Space, Shift+Space, Return or Enter.
"""

i.e. you need to activate the color, just like you'd activate a widget
or a menu item.


That seems confusing to me. The way its written (or rather, the way I'm
reading it) implies the signal will be emitted on any color change
("activated").

Nope. The term "activated" has a fairly specific meaning, in GTK+, and
it usually refers to the behaviour of widgets with regards to keyboard
interaction. See, for instance:

  https://lazka.github.io/pgi-docs/#Gtk-3.0/classes/Widget.html#Gtk.Widget.activate

In your case, you're using the color editor, which does not have
"activatable" parts.

However, using the "notify" signal seems to work as well,
although the signal is emitted a few times on startup that I'll have to
ignore.

The `notify` signal is emitted every time a property changes; if you
use `notify::rgba` signal you'll, thus, be notified every time the
`rgba` property changes to a different value.

In general, GTK+ uses ::changed signals on classes where multiple
properties can change at the same time, or if what changes is not
mapped to a property at all; if there are readable properties, it's
much easier to get notification of changes straight from them.

Ciao,
 Emmanuele.

-- 
https://www.bassi.io
[@] ebassi [@gmail.com]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]