[SOLVED] Re: C/GTK+ Is it possible? access child widgets having only the its container?



Em Dom, 2005-11-20 Ãs 00:13 +0100, Luca Cavalli escreveu:
On Sat, 2005-11-19 at 21:03 -0200, Marcus Reis wrote:
Hello, suppose the scenario that we have a GtkTable declared as global
variable. Inside that table we have 9 event boxes with 1 GtkImage packed
in each one. Now we have a function that must change properties from
some images that are inside event boxes or even destroy the boxes. I
have tried to achieve this with the following (unsuccessful) code:


#######################################################################
static void some_function()
{
    int x;
    GList *list;
    GtkWidget *event_box;

    list = gtk_container_get_children(GTK_CONTAINER (global_table));
    g_print("We have %d elements",(g_list_length(list)));
    event_box = GTK_WIDGET (g_list_nth(list, 0));
    gtk_widget_destroy(GTK_WIDGET (event_box));
}
#######################################################################



Hi,
I think you should use g_list_nth_data instead of g_list_nth. The
g_list_nth return the list element, not its content.

Luca


This list is very good! Thanks Luca.


        

        
                
_______________________________________________________ 
Yahoo! Acesso Grïtis: Internet rïpida e grïtis. 
Instale o discador agora!
http://br.acesso.yahoo.com/




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