GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Query regarding expander in glade

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
richirich
Familiar Face


Joined: 23 Dec 2008
Posts: 42

PostPosted: Wed Mar 10, 2010 8:41 am    Post subject: Query regarding expander in glade Reply with quote

I have designed my application using Glade and python , I have used many expander in vertical boxes with various buttons in each expander , I want to expand only one expander when I click on that and close(contract) automatically the previous open expander Is it possible to implement if yes then how .
Please suggest me how can I implement that .
Back to top
tadeboro
Never Seen the Sunlight


Joined: 23 Jul 2008
Posts: 2135
Location: Slovenia

PostPosted: Wed Mar 10, 2010 4:50 pm    Post subject: Reply with quote

Hello.

This is possible to achieve by monitoring GtkExpander:expanded property. Relevant part of the code would look something like this:
Code: (C)
1
2
3
4
5
6
7
8
9
10
11
12
13
g_object_connect( G_OBJECT( expander ), "notify::expanded",
                  G_CALLBACK( cb_notify_expanded ), data );

static void
cb_notify_expanded( GObject    *expander,
                    GParamSpec *pspec,
                    gpointer    data )
{
    if( gtk_expander_get_expanded( GTK_EXPANDER( expander ) ) )
    {
        /* Close previously opened expander */
   
}
}

Tadej
Back to top
richirich
Familiar Face


Joined: 23 Dec 2008
Posts: 42

PostPosted: Thu Mar 11, 2010 6:16 am    Post subject: Reply with quote

Thank you very much
but on which signal of expander I should add this code.
Is there any similar code in python ?? that I could add on the handler [b]on_expander_activate[/b]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP