[pygtk] Enabling/Disabling menus and friends

Steve McClure smcclure at racemi.com
Tue Sep 28 21:22:22 WST 2004


On Tue, 2004-09-28 at 02:56, Luca Manini wrote:
>     Erik> I'm not sure if I understand what your problem is. 
> 
>     I know I'm having a hard time to explain my needs!
> 
>     Erik> One way you would do this is something like this (simplified
>     Erik> example, you would need some code to set up the app etc, but
>     Erik> you should get the idea):
>     Erik> class App:.....................
> 
>     OK. This is a possible "do it by youself" solution, but imagine
>     your Edit menu has been teared off, so that is open and visible,
>     and that the user moves from a modifiable object to a "read-only"
>     one. How will you know that the "Cut" item/action should be
>     disabled? [1]
> 
>     You need a "current object" concept and a "on idle" callback from
>     the framework.  The whole concept of "event driven GUI" is to NOT
>     write your event loop yourself again.

I've never seen a framework that provides what you want.  I don't really
consider that part of an event loop.  That is just application logic. In
my application, the user could have several windows open
viewing/managing several different objects at the same time.  I, as a
person, would have a hard time deciding what the "current object" is,
much less figuring out rules to tell a framework what to do.

> 
> [1] Another "do it by youself" solution is to set a timer.
-- 
Steve McClure						Racemi
email: smcclure at racemi.com				75 5th St NE
voice: 404-892-5850					Suite 214
fax: 404-892-7215					Atlanta, GA 30308
							http://www.racemi.com



More information about the pygtk mailing list