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 

window update

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
pradee



Joined: 15 Jun 2007
Posts: 3

PostPosted: Fri Jun 15, 2007 10:17 am    Post subject: window update Reply with quote

hi i have to read a file and update the window based on the file? is there any fucntion that will be called when window is in open
Back to top
openldev
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 376
Location: State College, Pennsylvania

PostPosted: Fri Jun 15, 2007 8:52 pm    Post subject: Reply with quote

If you mean you want to run a function every time the window is shown, use GtkWidget's "show" signal.
Back to top
pradee



Joined: 15 Jun 2007
Posts: 3

PostPosted: Sat Jun 16, 2007 5:41 am    Post subject: Reply with quote

i am new to gtk. i dont know how to use this. pls explain me
Back to top
openldev
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 376
Location: State College, Pennsylvania

PostPosted: Sun Jun 17, 2007 12:54 pm    Post subject: Reply with quote

You can use this to connect your window to the show signal:

Code: (Plaintext)
1
g_signal_connect (G_OBJECT (window), "show", G_CALLBACK (window_is_visible), (gpointer) data);


The first parameter is the widget that you want to monitor for the "show" signal. When the window is shown to the user, window_is_visible() will be called. The fourth parameter allows you to send one pointer to the callback function, or NULL to ignore it. The callback function should look like this:

Code: (Plaintext)
1
2
3
4
void window_is_visible (GtkWindow *window, gpointer data)
{
  /* Do something now that the window is shown. */
}


Hope this helps!
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