Re: newbie question about g_object unref()

2010-11-19 Thread Luis Lopez
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

Re: newbie question about g_object unref()

2010-11-19 Thread David Nečas
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

Re: newbie question about g_object unref()

2010-11-19 Thread N James Bridge
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

Re: newbie question about g_object unref()

2010-11-18 Thread Jannis Pohlmann
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

Re: newbie question about g_object unref()

2010-11-18 Thread Leandro Pereira
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

Re: newbie question about g_object unref()

2010-11-18 Thread Michael Cronenworth
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

Re: newbie question about g_object unref()

2010-11-18 Thread Nader Morshed
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

newbie question about g_object unref()

2010-11-18 Thread N James Bridge
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

Re: newbie question

2009-03-11 Thread Dov Grobgeld
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

Re: newbie question

2009-03-11 Thread Tadej Borovšak
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) { >> >>

Re: newbie question

2009-03-11 Thread 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) { > > ... >} > > >http://library.gnome.org/

Re: newbie question

2009-03-10 Thread Alexander
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

newbie question

2009-03-10 Thread frederico schardong
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

Re: newbie Question

2008-07-16 Thread Tomas Carnecky
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

Re: newbie Question

2008-07-15 Thread Craig Petty
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

Re: newbie Question

2008-07-15 Thread Tomas Carnecky
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

newbie Question

2008-07-15 Thread 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

Re: Newbie Question: Changing a Label

2007-09-11 Thread Jim George
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 >

Newbie Question: Changing a Label

2007-09-11 Thread Brian Hartman
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

Re: Newbie Question: How i can use glib-2.0 in my c-programm ?

2007-06-27 Thread Alan M. Evans
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

Re: Newbie Question: How i can use glib-2.0 in my c-programm ?

2007-06-26 Thread Matí­as Alejandro Torres
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

Re: Newbie Question: How i can use glib-2.0 in my c-programm ?

2007-06-26 Thread Kai Szymanski
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

Re: Newbie Question: How i can use glib-2.0 in my c-programm ?

2007-06-26 Thread Brian J. Tarricone
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

Newbie Question: How i can use glib-2.0 in my c-programm ?

2007-06-26 Thread Kai Szymanski
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,

Reset Tooltips ? easy (?) newbie question

2006-12-28 Thread kakuta
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

Re: Newbie Question

2005-04-05 Thread Freddie Unpenstein
> > 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

Re: Newbie Question

2005-04-05 Thread Tomaz Canabrava
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

Re: Newbie Question

2005-04-05 Thread André Pedralho
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

Re: Newbie Question

2005-04-05 Thread David Necas (Yeti)
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

Newbie Question

2005-04-05 Thread Tomaz Canabrava
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