GtkStyle



Currently I am creating an application where I need to change to color of a 
row on a CLIST depending upon the status of that particular task or 'row'. 
 The following is what I have been doing to change a color in a row and I 
have five possible colors that a row can be.

Actually this does seem to work, but how does one copy a GtkWidget into a 
structure if needed.  For example, if I have a CLIST declared as

GtkWidget *display_tasks = NULL;

and use this 'display_tasks' in various callback functions as a CLIST 
widget

VOID update_display(GtkWidget *update_button, gpointer display_tasks)

/* non callback function */
VOID display_processes(GtkWidget **display_tasks_p, GtkWidget 
**task_items_p,
                                     UT_SHARED_WINDOW *tasks);

and suddenly realize that there is a non GTK callback in which I have to 
pass a non GTK structure called
UT_SHARED_WINDOW and this callback can only have one data item passed to 
it.  What would your solution be?

I am trying to figure out a way I can copy this GtkWidget into my 
UT_SHARED_WINDOW structure so that the one in the structure is a pointer to 
the actual one declared in main().  However, I am not great at pointers or 
if this can even work in GTK+.

For example, can I do the following:

struct UT_SHARED_WINDOW
{
..........
  GtkWidget **display_tasks;
}

and somewhere in one of my routines, preferably 'display_processes' where I 
initialize the CLIST, I can do

UT_SHARED_WINDOW *tasks;


     *tasks->display_tasks = *display_tasks;

Will this work or not.

Also, in some of my callback functions, I only have the *display_tasks 
GtkWidget available, so I had to use 'gtk_object_get_data' to tie my 
UT_SHARED_WINDOW to the display_tasks widget but now I want to be able to 
go the other way also by just having the UT_SHARED_WINDOW available to me. 
 If I can do some type of assignment as in the one above, will this cause a 
problem for the gtk_object_get_data when it retrieves the UT_SHARED_WINDOW 
structure since the 'tasks' structure contains a pointer to the other 
CLIST, almost like a circular reference.  Thanks ahead of time for your 
help?

matt














[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]