That looks good. But that's another topic. Thanks!
2013/7/20 richard boaz <ivor.b...@gmail.com> > hi gang, > > so you are aware of every state change then... > > back when (2010), i provided a solution for this problem that gets around > having to write tons of code for each state change. you can find my > comment and code posting in the thread here: > > https://mail.gnome.org/archives/gtk-list/2010-September/msg00047.html > > and i packaged this up into a full-fledged library that you can also find > here: > > http://www.binpress.com/app/gtk-widget-state-manager/1008 > > while i agree that many states + many changes can make for too much > annoying code writing (hence the solution i found for myself and previously > posted), i'm also of the opinion that doing it your way is too passive and > will lead to other unforeseen problems, both at the design and > implementation levels. > > richard > > > On Fri, Jul 19, 2013 at 2:45 PM, Gang Chen <gang.chen...@gmail.com> wrote: > >> Richard, >> >> The UI elements are GTK actions whose sensitivity states are related to >> the states of the application. There are many possibilities that may change >> the sensitivity. If I update UI elements whenever necessary, I need to >> write too much code doing update. I prefer writing one function that >> updates all UI elements according to the current states. And I need to call >> that function when idle. This approach is simpler and cleaner. >> >> Thanks, >> Gang >> >> >> >> 2013/7/20 richard boaz <ivor.b...@gmail.com> >> >>> let's step back one second. >>> >>> your description implies that it is not possible for your UI to be >>> directly aware of the events that require follow-on updates to the UI's >>> widgets. >>> >>> but i don't understand this. can you explain a little more how/why this >>> makes sense on a design level? what exactly happens that means the UI >>> widget states are out-of-date and need to be updated? >>> >>> ideally, your UI should be aware of any state changes requiring a widget >>> update, these being either internal or external in origin. and then once a >>> state change occurs, invoke your widget updates accordingly. >>> >>> richard >>> >>> >>> On Thu, Jul 18, 2013 at 12:11 AM, Gang Chen <gang.chen...@gmail.com>wrote: >>> >>>> Hi everyone, >>>> >>>> The background is that I need to update the sensitivity of UI elements >>>> when proper. I tried to do it in a low priority idle callback that is >>>> running forever. But that will cause 100% CPU usage. So I'd like to do it >>>> in a callback that is called only once each time when the event queue >>>> becomes empty. Do you have any idea? Or is there any better approach to >>>> updating UI elements? >>>> >>>> Thanks, >>>> Gang >>>> >>>> >>>> _______________________________________________ >>>> gtk-list mailing list >>>> gtk-list@gnome.org >>>> https://mail.gnome.org/mailman/listinfo/gtk-list >>>> >>>> >>> >> >
_______________________________________________ gtk-list mailing list gtk-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-list