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
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
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
i
On Thu, 18 Nov 2010 22:11:45 +
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?
You can do it explicitely by using
g_object_add_weak_pointer (your_obje
Nader Morshed,
On Thu, Nov 18, 2010 at 8:21 PM, Nader Morshed 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 nullify the only w
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 something
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
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
http://ma
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
2009/3/11 frederico schardong :
>>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) {
>>
>>
>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) {
>
> ...
>}
>
>
>http://library.gnome.org/
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
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 b
wrote:
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, Ju
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
> D
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. A
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
On 9/11/07, Brian Hartman <[EMAIL PROTECTED]> wrote:
> 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
>
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
#endif
#include
#include "callbacks.h"
#include "interface.h"
#in
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
gtk-app-de
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
> #i
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
gtk-app-devel-lis
On Tue, 26 Jun 2007 23:27:25 +0200 Kai Szymanski wrote:
>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 si
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
#include
void main(int argc,
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 cert
> > 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
I think I´m a little TO-MUCH newbie to try this for now
gonna have Classes about Structures First
But, Tanks for asking
=)
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
You can use the g_signal_connect wich you may pass one or more parameters:
look at
http://developer.gnome.org/doc/API/2.0/gobject/gobject-Signals.html#g-signal-new
On Apr 5, 2005 1:26 PM, Tomaz Canabrava <[EMAIL PROTECTED]> wrote:
> i have a function defined by
>
> void window_createMatrix(int
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 g_connect_e
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
30 matches
Mail list logo