Re: [gtk-list] Signal question



On Wed, 3 Jun 1998, David Lutterkort wrote:

> 
> For this little du replacement w/ GUI I'm writing I would like to run an
> action once as soon as the main window of the application is set up after
> gtk_main has taken over control, but before gtk starts processing any input
> events. What would be the best signal to connect to to do this ? 
> 
> David

hm, if you want to have a one-shot signal handler that will be executed when
your window is shown the first time, you would do:

gtk_signal_connect (GTK_OBJECT (window), "show",
                    GTK_SIGNAL_FUNC(my_handler), NULL);
static void
my_handler (GtkWindow *window, gpointer user_data)
{
  gtk_signal_disconnect_by_func (GTK_OBJECT (window),
                                 GTK_SIGNAL_FUNC (my_handler),
                                 user_data);
  /* place your code here */                                 
}
                   

> 
> ---
> You can lead a horse to water but you can't make him walk on it. - Gary Larson
> You can lead a horticulture, but you can't make her think.    - Dorothy Parker
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
> 
> 

---
ciaoTJ



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