Re: Data to Callback Functions
- From: Stefan Kost <kost imn htwk-leipzig de>
- To: Ruben Safir Secretary NYLXS <ruben mrbrklyn com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Data to Callback Functions
- Date: Tue, 24 Aug 2004 13:01:42 +0200
Hi ruben,
Ruben Safir Secretary NYLXS wrote:
Hello
I'm trying to write a program for the clinical pharmacy department at
the hospital. I hoped to create a top_level window with a vbox. The top
of the vbox has some buttons and the bottom has a frame. Depending on
which button is clicked, a different 'form' would desplay below.
use the notebook widget for this.
In order to do this I created several files, clinical.c clinical.h
forms.c forms.h calculations.c calculations.h, so I could use the
calculations for a future project.
In order to retain access to everything, in fomrs.h I has a struct definition
struc s1, which has membership of GtkWidgets which I hoped to assign to
structure instances to pass to callback functions attacts as gpoint data,
with is the last argument in g_signal_connect, such as follows
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (lbw_screen), &handle);
where handle is my structure with the GtkWidgets stored.
However, this is not working, and when I call the signal by clicking on
the button, the structure is converted to a null pointer by the
gpointer cast and the screen almost looks like it goes out of scope in the
debugger.
How can I do this other than make the entire structure global?
The structure needs to be at least static, otherwise it will be gone, when you
leave the method.
How can I get a callback fuction to gain access to it's parent
windows and widgets?
Stean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]