The first argument of `g_signal_connect()` is a gpointer (i.e. a
`void*`), so you don't need a cast at all — C will implicitly cast any
pointer to `void*`, and from `void*` to any other pointer.
Additionally, as you discovered, signals are GTypeInstance features —
you can emit signals on anything
Hi,
it seems that it was common practice to cast the first argument of
g_signal_connect() to G_OBJECT when I started developing applications with
GTK+ quite a while ago. At least I've learned it that way and am doing it
ever since.
I repeatedly see usage of g_signal_connect() without that cast
Hi. I've installed the api documentation from the source code for both
gtk+ and glib, but I can't seem to find an api description of
g_signal_connect(). The examples I usually see are along the lines of
code
--
g_signal_connect (G_OBJECT (button[0]), draw,
G_CALLBACK
On Tue, Mar 06, 2012 at 10:07:16AM -0900, Christopher Howard wrote:
Hi. I've installed the api documentation from the source code for both
gtk+ and glib, but I can't seem to find an api description of
g_signal_connect().
http://developer.gnome.org/gobject/stable/gobject-Signals.html#g-signal
);
base.sWidgets.window = glade_xml_get_widget (base.sWidgets.gxml,
window);
base.sWidgets.button = glade_xml_get_widget (base.sWidgets.gxml,
button1);
base.sWidgets.hscale = glade_xml_get_widget (base.sWidgets.gxml,
hscale1);
g_signal_connect (base.sWidgets.button
);
}
[...]
g_signal_connect (base.sWidgets.hscale, change-value, G_CALLBACK
(funcScale), base);
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
*widget, struct allStructs *base)
{
gdouble value;
value = gtk_range_get_value (GTK_RANGE (widget));
printf(Qs: %i\n, value);
printf(Qs: %i\n, base-sTestOne.a);
}
[...]
g_signal_connect (base.sWidgets.hscale, change-value, G_CALLBACK
(funcScale), base
I need to pass a struct using g_signal_connect, but the issue I'm having is
that I can't alter the elements of the struct within the called function
e.g.
void on_button2_clicked (struct allStructs *by_ptr)
{
gtk_label_set_text ((GtkLabel*)by_ptr-widgets.label, whatever);
}
main
{
blah
be very nasty bugs since they cause people to write to memory they
are not supposed to write to. A classic door for hackers ...
Till
Am Sonntag 19 Oktober 2008 schrieb beginner.c:
I need to pass a struct using g_signal_connect, but the issue I'm having is
that I can't alter the elements
they cause people to write to memory they
are not supposed to write to. A classic door for hackers ...
Till
Am Sonntag 19 Oktober 2008 schrieb beginner.c:
I need to pass a struct using g_signal_connect, but the issue I'm having
is
that I can't alter the elements of the struct within the called
On Tue, Jul 15, 2008 at 6:36 AM, Gabriele Greco [EMAIL PROTECTED]
wrote:
static void handle_click_cbk(GtkWidget *mywidget_, MyClass *data) {
data-handle_click(); }
You can't make a callback function intended to be used by C code be inside
of the C++ class. It will not be able to find it.
Hello, this is my first post on this mailing list, now i do my request:
can i use g_signal_connect in a method of my class, using as c_handler
a private function of class? ...and if i can, how i can do ?
___
gtk-app-devel-list mailing list
gtk-app
On Tue, Jul 15, 2008 at 12:09 PM, Marco Rocco [EMAIL PROTECTED] wrote:
Hello, this is my first post on this mailing list, now i do my request:
can i use g_signal_connect in a method of my class, using as c_handler a
private function of class? ...and if i can, how i can do ?
If you use C
Hello, this is my first post on this mailing list, now i do my request:
can i use g_signal_connect in a method of my class, using as c_handler
a private function of class? ...and if i can, how i can do ?
___
gtk-app-devel-list mailing list
gtk-app
,
GUINT_TO_POINTER(1));
g_object_set(renderer, editable, TRUE, NULL); //setta il testo
editabile
g_signal_connect(renderer, edited, (GCallback) cell_edited_cbk,
liststore);
}
void GtkClist::set(GladeXML *xml_file_glade, const char *nome_treeview,
int ncolonne, ...){
treeview
For the sake of elegance, which version people like more?
1) g_signal_connect (widget, signal,
G_CALLBACK (callback), data);
2) g_signal_connect (G_OBJECT (widget), signal,
G_CALLBACK (callback), data);
3) g_signal_connect (GTK_OBJECT (widget), signal,
G_CALLBACK (callback), data);
Carlos
Brian J. Tarricone wrote:
On Sun, 15 Jun 2008 19:40:22 +0100 Carlos Pereira wrote:
For the sake of elegance, which version people like more?
1) g_signal_connect (widget, signal,
G_CALLBACK (callback), data);
I think this was the intended use -- the first param is of type
gpointer so
Hi all;
I wanted to Know what could be the reason for not being able to connect the
select / activate /deselect signal with a widget using
g_signal_connect( ) function?
I connected a menu widget with the signal select but it fails to respond
to it; the menu widget gets rendered
have to use the g_signal_connect function again in the event handler
called by the button pressure. The problem is that I do not seem able to pass
correctly arguments in this second call.
int main(int argc, char *argv[]) {
...
gpointer data[5];
...
data[0
) {
...
g_signal_connect (G_OBJECT (event_box), button-press-event,
G_CALLBACK
(x_click_callback), data[1]);
}
gboolean x_click_callback(GtkWidget *event_box, gpointer data) {
//Here I get segfault if I try to remove the tab.
}
Because the prototype of the signal handler is different
data.
Not to mention the fact that 'data' is allocated on the stack and ceases
to exist after this function exits, so the pointer you pass to
g_signal_connect() will be garbage later. Not only should you use a
struct for convenience as David suggests, but you need to allocate the
struct on the heap
' is allocated on the stack and ceases
to exist after this function exits, so the pointer you pass to
g_signal_connect() will be garbage later. Not only should you use a
struct for convenience as David suggests, but you need to allocate the
struct on the heap (via g_malloc() or g_new(), etc
]=GTK_EVENT_BOX(gtk_event_box_new());// create the event
box
.
.
.
.
.
data1 = g_strdup_printf( %d ,iter) ;
g_print(\n at signal connect string -- %s ,data1);
g_signal_connect ((gpointer)eventt[iter],leave_notify_event,
G_CALLBACK (mouse_leave1),data1
On 4/21/06, rachit goel [EMAIL PROTECTED] wrote:
g_signal_connect ((gpointer)eventt[iter],button_press_event,
G_CALLBACK (tab_click1), data1);
void tab_click1(GtkWidget *widget,gchar* data1)
You have the type of your callback wrong:
http://developer.gnome.org/doc/API/2.0/gtk
On Fri, Apr 21, 2006 at 12:45:35PM +0100, rachit goel wrote:
g_signal_connect ((gpointer)eventt[iter],leave_notify_event,
G_CALLBACK (mouse_leave1),data1);
g_signal_connect ((gpointer)eventt[iter],button_press_event,
G_CALLBACK (tab_click1), data1
thanks guys i was mistaken in my assumption about omitting the arguments
well thanks anyways that solved the probs
Send instant messages to your online friends http://uk.messenger.yahoo.com
___
gtk-app-devel-list mailing list
hi,
i am having a problem
i just can't recieve the data passed to signal handler using g_signal_connect()
.
it always gets messed up.
plz its rather critical for me at this stage
any help will be appreciated
also i am using gtk-2.6.7 on fc4-i386
On Thu, Apr 20, 2006 at 08:25:57PM +0100, rachit goel wrote:
i am having a problem
You have the problem...
i just can't recieve the data passed to signal handler using
g_signal_connect() .
it always gets messed up.
...you did not post enough information. What's your code?
Yeti
In reference,
g_signal_connect : The handler will be called before the default handler
of the signal.
g_signal_connect_after : The handler will be called after the default
handler of the signal.
But, I don't know why is different g_signal_connect and
g_signal_connect_after.
Where is example
Cool Guy wrote:
In reference,
g_signal_connect : The handler will be called before the default handler
of the signal.
g_signal_connect_after : The handler will be called after the default
handler of the signal.
But, I don't know why is different g_signal_connect and
g_signal_connect_after
Hi,
In my app I have the following:
g_signal_connect ((gpointer) AddFile_button, clicked,
G_CALLBACK (on_add_files_activate),
dummy);
I have noticed that if the function on_add_files_activate is
declared with only one parameter, gpointer data , I never
On Mon, Jul 25, 2005 at 09:18:57AM -0700, Colossus wrote:
g_signal_connect ((gpointer) AddFile_button, clicked,
G_CALLBACK (on_add_files_activate),
dummy);
I have noticed that if the function on_add_files_activate is
declared with only one parameter
Colossus [EMAIL PROTECTED] writes:
In my app I have the following:
g_signal_connect ((gpointer) AddFile_button, clicked,
G_CALLBACK (on_add_files_activate),
dummy);
I normally write the above call like this:
g_signal_connect( G_OBJECT
Annamalai Gurusami wrote:
g_signal_connect( G_OBJECT(AddFile_button), clicked,
G_CALLBACK(on_add_files_activate), dummy);
The actual parameters of the callback function is determined by the
event and the widget handling the event. Here you are handling the
clicked event
Colossus [EMAIL PROTECTED] writes:
Annamalai Gurusami wrote:
g_signal_connect( G_OBJECT(AddFile_button), clicked,
G_CALLBACK(on_add_files_activate), dummy);
The actual parameters of the callback function is determined by the
event and the widget handling the event. Here
connection as:
g_signal_connect ((gpointer) Horizontal_Zoom_In, clicked,
G_CALLBACK (Horizontal_Zoom_In_clicked),
graph_type);
where graph_type is an int. as a result I get a
warning: passing argument 4
(GtkWidget *widget, int gt)
and the signal connection as:
g_signal_connect ((gpointer) Horizontal_Zoom_In, clicked,
G_CALLBACK (Horizontal_Zoom_In_clicked),
graph_type);
where graph_type is an int. as a result I get a
warning
use GINT_TO_POINTER:
Horizontal_Zoom_In_clicked(GtkWidget *widget, gpointer gt)
g_signal_connect ((gpointer) Horizontal_Zoom_In, clicked,
G_CALLBACK
(Horizontal_Zoom_In_clicked), GINT_TO_POINTER(graph_type));
and GPOINTER_TO_INT(gt) in the callback to get
for g_signal_connect for the GtkWidget
types.
/* from GtkContainer.h */
struct _GtkContainerClass
{
GtkWidgetClass parent_class;
void(*add)(GtkContainer*container,
GtkWidget *widget);
void(*remove) (GtkContainer
Hi,
I need to know what are is the signal strings to give to
g_signal_connect() but I didn't find any specs of them in doc.
Possible ?
--
Colossus
Cpsed, a Linux OpenGL 3D scene editor
http://cpsed.sourceforge.net/
___
gtk-app-devel-list mailing list
gtk
(){
..
GtkWidget *isRoot;
GtkWidget *entry1;
GtkWidget *entry2;
isRoot = gtk_check_button_new_with_label (root qdisc);
entry1 = gtk_entry_new();
entry2 = gtk_entry_new();
..
g_signal_connect(G_OBJECT (button), clicked, G_CALLBACK (callback_create),
???);
The problem is that I don't know how
Little trouble here =)
the g_signal_connect works like what?
g_signal_connect(GTK_WIDGET(widget), signal(clicked),
G_CALLBACK(Function), (gpointer) Data);
but the callbacks functions have the GtkWidget *Widget as a 1st
parameter, and...
well, i simply don't get it. =)
Does anyone cares
(GTK_WINDOW_TOPLEVEL);
g_signal_connect (G_OBJECT (window), delete_event,G_CALLBACK
(delete_event), NULL);
button = gtk_button_new_with_label(Hi!);
table = gtk_table_new (2, 1, FALSE);
gtk_container_add(GTK_CONTAINER(window),table);
gtk_table_attach_defaults(GTK_TABLE(table),button,0,1,0,1
Pier-Luc Charbonneau wrote:
static gboolean recalculate_psi_consumption(GtkWidget *widget, gpointer data)
This is your callback declaration. It takes 2 parameters.
g_signal_connect(G_OBJECT(start),key_press_event,G_CALLBACK(recalculate_psi_consumption),(gpointer)psi);
key-press-event signal
44 matches
Mail list logo