Fwd: Get signals and callbacks.



---------- Forwarded message ----------
From: Germán Diago <germandiago gmail com>
Date: 26-feb-2008 17:45
Subject: Re: Get signals and callbacks.
To: gtk-app-devel gnome org



2008/2/26, Germán Diago <germandiago gmail com>:



2008/2/26, Murray Cumming <murrayc murrayc com>:


On Tue, 2008-02-26 at 14:19 +0100, Germán Diago wrote:
Hello. I'm implementing an application in gtkmm. I want to add support
for
dynamic signal
connection from a glade file in C++ (which is not supported by the C++
bindings).

I'd like to know if there is a way, once a glade file has been
instantiated,
to obtain information about
the signals and handlers attached to every widget from the Gobject
objects
and how I should do it.

I tried to  do like this:


guint nids = 0;
guint * ids = g_signal_list_ids(g_type_from_name("GtkButton"), &nids);

 std::cout << nids << std::endl;
 std::cout << g_signal_name(ids[23]) << std::endl;


but if I use GtkButton, nids == 0. However, when I use "GtkWidget" I
get
a 67 and signals can be get with the function g_signal_names(ids[i]);

This code is to get available signals, but not the real connections
between
objects. Can help, please?


The get_signals() code here might provide some hints:

http://svn.gnome.org/viewvc/glibmm/trunk/tools/extra_defs_gen/generate_extra_defs.cc?view=markup

I am not at all optimistic that we can do autoconnection, but I am happy
that you are trying.


--
murrayc murrayc com
www.murrayc.com
www.openismus.com



Maybe a better way would be to parse the glade file itself and extract the
info from there. But this way I cannot get
introspection info about the type of the parameters and so on to be able
to check if the connected slots are compatibles
with the signal.







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