Re: Question on emission hooks



Nickolay,

Nickolay V. Shmyrev wrote:

Sorry for style of my first answer, it seems that you have quite old
glib, because now (in 2.4.0 )it is impossible to g_signal_lookup on
G_TYPE_OBJECT, since it is not G_TYPE_IS_INSTANTIABLE, that's why I
thought that you are trying to to add emission hook to "notify" signale
of your type GWP_TYPE_SHIP, not G_TYPE_OBJECT.
I'm using glib 2.4.0, and what I wanted to do (I don't know if it's possible) is to use a emission hook callback every time one of my own types's properties changes. I have 500 GWP_TYPE_SHIPs on my application, so I don't want to connect to the "notify" signal in every ship.

What I don't know is if I have a GwpShip object that is a subclass of GObject...the "notify" signal if inherited? I tried both...I defined it on GwpShip and got the same signal_id = 1, I changed its name to something else and got a higher number and the error message disappeared when I connected an emission hook to it...so my code not so bad written :-)

Even if you can get signal_id, it is not clear, that you can add
emission hook to that signal, because signal can have flag
G_SIGNAL_NO_HOOKS. The "notify" signal of g_object is exactly such
signal, that is why you get warning message.
So I cannot override it? Nevertheless the code you copied from glib's sources don't have the G_SIGNAL_NO_HOOKS flag.

Regards,
--
Lucas Di Pentima - Santa Fe, Argentina - Jabber ID: lucas lunix com ar
LUNIX: Soluciones en GNU/Linux - http://www.lunix.com.ar
GnuPG Public Key:
http://random.sks.keyserver.penguin.de:11371/pks/lookup?op=get&search=0x6AA54FC9
Key fingerprint = BD3B 08C4 661A 8C3B 1855  740C 8F98 3FCF 6AA5 4FC9

Attachment: signature.asc
Description: OpenPGP digital signature



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