GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Oct 30, 2014 11:38 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: window update
PostPosted: Fri Jun 15, 2007 10:17 am 
Offline

Joined: Fri Jun 15, 2007 10:13 am
Posts: 3
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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 15, 2007 8:52 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
If you mean you want to run a function every time the window is shown, use GtkWidget's "show" signal.

_________________
Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 16, 2007 5:41 am 
Offline

Joined: Fri Jun 15, 2007 10:13 am
Posts: 3
i am new to gtk. i dont know how to use this. pls explain me


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 17, 2007 12:54 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
You can use this to connect your window to the show signal:

Code:
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:
void window_is_visible (GtkWindow *window, gpointer data)
{
  /* Do something now that the window is shown. */
}


Hope this helps!

_________________
Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group