On Thu, 2010-11-18 at 22:11 +, N James Bridge wrote:
It seems that g_object_unref (ptr) doesn't set ptr to NULL when it frees
the allocated memory. Have I got something wrong here? Do I have to do
it explicitly?
Thanks for all your contributions. I have now found G_IS_OBJECT(), which
is
On Fri, Nov 19, 2010 at 01:21:44PM +, N James Bridge wrote:
Thanks for all your contributions. I have now found G_IS_OBJECT(), which
is obviously the way to test whether the memory has been released or
not.
It obviously ISN'T.
If the memory was released then the argument is no longer a
El 19/11/10 14:36, David Nečas escribió:
If you want to nullify a pointer when you release your reference (which
I also find often useful as once you released your reference you may not
be longer sure the object exists at all) you should use a macro for
that, I use one defined approximately
It seems that g_object_unref (ptr) doesn't set ptr to NULL when it frees
the allocated memory. Have I got something wrong here? Do I have to do
it explicitly?
Thanks, James Bridge
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
As it only takes a pointer, and not a pointer to a pointer (ptr), there's no
way for g_object_unref to set the original pointer variable to NULL, you'd have
to nullify it yourself, either through g_pointer_nullify or just ptr = NULL. If
you want you can wrap the two in a macro, but as far as I
N James Bridge wrote:
It seems that g_object_unref (ptr) doesn't set ptr to NULL when it frees
the allocated memory. Have I got something wrong here? Do I have to do
it explicitly?
The official documentation[1] does not mention anything about setting
the pointer to NULL. Did you read
Nader Morshed,
On Thu, Nov 18, 2010 at 8:21 PM, Nader Morshed morshed.na...@gmail.com wrote:
#define G_OBJECT_UNREF_AND_NULLIFY(ptr) { \
g_object_unref(ptr); \
(ptr) = NULL; \
}
Not a good idea: the object may still hold a reference, and nullifying
the pointer would probably
On Thu, 18 Nov 2010 22:11:45 +
N James Bridge ja...@xmas.demon.co.uk wrote:
It seems that g_object_unref (ptr) doesn't set ptr to NULL when it
frees the allocated memory. Have I got something wrong here? Do I
have to do it explicitly?
You can do it explicitely by using
void my_callback_function (GtkButton *widget, gpointer user_ptr);
...
g_signal_connect( G_OBJECT( widget), clicked,
G_CALLBACK( my_callback_function), user_ptr );
void my_callback_function (GtkButton *widget, gpointer user_ptr) {
...
}
2009/3/11 frederico schardong frede@gmail.com:
void my_callback_function (GtkButton *widget, gpointer user_ptr);
...
g_signal_connect( G_OBJECT( widget), clicked,
G_CALLBACK( my_callback_function), user_ptr );
void my_callback_function (GtkButton *widget, gpointer user_ptr) {
Hi Frederico,
(Copied from my own post from Mar 23, 2006 12:31:00 pm)
Here are four additional possibilities:
1. Use global variables for your widgets.
2. Create a struct containing pointers to all your widgets and use the
userdata field to pass this struct around in all callbacks.
3. Use the
Hi,
Sorry, but I know it is a newbie question..
I have a button, and a gtk_drawing_area, and a function to save what
is happen in the gtk_drawing_area.. When this button is pressed, the
function must be run.. I'm using now this gtk_drawing_area how a
global variable, how I can connect the button
On Wednesday 11 March 2009, frederico schardong wrote:
Hi,
Sorry, but I know it is a newbie question..
I have a button, and a gtk_drawing_area, and a function to save what
is happen in the gtk_drawing_area.. When this button is pressed, the
function must be run.. I'm using now
to list available wireless networks and create a custom widget?
--- On Tue, 7/15/08, Tomas Carnecky [EMAIL PROTECTED] wrote:
From: Tomas Carnecky [EMAIL PROTECTED]
Subject: Re: newbie Question
To: [EMAIL PROTECTED]
Cc: gtk-app-devel-list@gnome.org
Date: Tuesday, July 15, 2008, 11:40 AM
Craig Petty
How would i make a gtk+ for a wireless networking?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Craig Petty wrote:
How would i make a gtk+ for a wireless networking?
First read gtk tutorials. Then compile, run and modify some gtk samples,
just so you get into how gtk works. Then you can read the sourcecode of
other gtk applications to understand how a 'big' application is
structured.
how to list available wireless networks and create a custom widget?
--- On Tue, 7/15/08, Tomas Carnecky [EMAIL PROTECTED] wrote:
From: Tomas Carnecky [EMAIL PROTECTED]
Subject: Re: newbie Question
To: [EMAIL PROTECTED]
Cc: gtk-app-devel-list@gnome.org
Date: Tuesday, July 15, 2008, 11:40
Hi Everyone.
I'm trying to write a simple program that changes a label when a button is
clicked. The program compiles and runs, but there's no label change.
Here's what I have in my callbacks.c:
#ifdef HAVE_CONFIG_H
# include config.h
#endif
#include gtk/gtk.h
#include callbacks.h
#include
On Tue, 2007-06-26 at 23:27 +0200, Kai Szymanski wrote:
Sorry, german text. It say's:
test.c:6: Error: »gstring« not declared
This is because C is case sensitive. Try GString instead of gstring.
___
gtk-app-devel-list mailing list
Hi!
As i search the web for a util-library that i can use in my c-programms,
i found glib-2.0. So i decide to install it on my system (debian 4.0 -
libglib-2.0 and libglib-2.0-dev). When i try to use it, i did'nt work.
The Source (a simple test):
-- Snip
#include stdio.h
#include
Hello Alan,
This is because C is case sensitive. Try GString instead of gstring.
Oh...that's dimp from me...thanks a lot for your help...i think it's to
late for me ;)
Best regards,
Kai.
___
gtk-app-devel-list mailing list
Kai Szymanski escribió:
Hi!
As i search the web for a util-library that i can use in my c-programms,
i found glib-2.0. So i decide to install it on my system (debian 4.0 -
libglib-2.0 and libglib-2.0-dev). When i try to use it, i did'nt work.
The Source (a simple test):
-- Snip
#include
Hi everyone,
I'd be grateful if you could help with a quick question regarding
'tooltips', is it possible to re-set the tooltips somehow?
I have successfully created and set some tooltips, but I then want to change
these tooltips while
the program is running (depending on a
i have a function defined by
void window_createMatrix(int rows, int colums, float **pointerMatrix, );
and a button WhatSoEver
is there a way to use the function by clicking the button?
i try to use the g_connect_event(G_OBJECT(WhatSoEver), clicked,
window_createMatrix, Parameters List);
but the
On Tue, Apr 05, 2005 at 02:26:48PM -0300, Tomaz Canabrava wrote:
i have a function defined by
void window_createMatrix(int rows, int colums, float **pointerMatrix, );
and a button WhatSoEver
is there a way to use the function by clicking the button?
i try to use the
25 matches
Mail list logo