Re: Blockingsignals for all widgets(except one or two)
- From: Jason Tan <jason rebel rebel net au>
- To: gtk-app-devel-list gnome org
- Cc: gtk-list gnome org, gtk-devel-list gnome org
- Subject: Re: Blockingsignals for all widgets(except one or two)
- Date: Thu, 2 Nov 2000 17:47:25 +1030 (CST)
Um...
You can safely ignoe my last post.
I have worked out a way to do it.
If anyone is ineterested this is what I came up with.
GtkWidget *MainW=gtk_window_new(GTK_WINDOW_TOPLEVEL);
...
//add many widgets to MainW
...
void do_sens(GtkWidget *w,gpointer data)
{
gtk_widget_set_sensitive(GTK_WIDGET(w),(gboolean)data);
}
void sens_all(gboolean sens)
{
gtk_container_foreach (GTK_CONTAINER(MainW),
do_sens,
(gpointer *)sens);
}
It seems to do what I wanted.
Jason
On Thu, 2 Nov 2000, Jason Tan wrote:
>
>
> Hi All,
>
> I have an applciaiton with many many user contorls(widgets) and under
> certain cirecumstances I want to be able to block all the signals from all
> widgets excpet one or two.
>
> Is there an easy-ish way to do this?
>
> The gui stores info about bales of wool in several places and under
> certain circumstances we don't want any processing to be able to
> continue until the user has verified the details being displayed are
> correct.
>
> I could put in a variable that can be set when I am in the mode where I
> want the user to verify before continuing, then test that variable in
> every callback, but I have a lot of callbacks and this would be a lot of
> work.
>
> Does anyone have a better suggestion or know a way to do this.
>
> I guess what I really want to do is soemthign like
>
> gtk_signal_handler_block(<allobjects>,<all_handlers>)
> ...
> gtk_singnal_handler_unblock(<onebutton>,<one_handler>).
>
> The bit I can't work out is how to do the block all.
>
> Any suggestions very gratefully received.
>
> I am using glade, so there might be some celever way to gt all the child
> widgets fromt eh top level window using sem of the support functions, but
> I haven't worked out how to do that yet either.
>
> Regards
> jason tan
>
>
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
--
------------------------------------------------------------------------------
Jason Tan jason rebel net au
Some people have a way about them that seems to say: "If I have
only one life to live, let me live it as a jerk."
-/usr/games/fortune
------------------------------------------------------------------------------
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]