Re: FVWM: Greyed out menu items

From: Mikhael Goikhman <migo_at_homemail.com>
Date: Wed, 21 Aug 2002 18:11:51 +0000

On 21 Aug 2002 19:58:10 +0200, Marcus Lundblad wrote:
>
> Another thought.
>
> I have a function like this:
>
> AddToFunc Restore "I" Current [Iconic] Iconify false
> + "I" Cond (Match) Break
> + "I" Current [!Iconic] Maximize false
>
> and an entry in a window menu for this.
> Would it be very hard to extend the "greying out" functionality to handle
> cases like this, marking this as unavailable for non-maximised windows
> (since "Maximize false" only makes sense for maximised windows).
> A similar thing is a menu I have with entries for switching desks,
> switching to the current desk is also not "doing anything"
>
> This is ofcourse only a cosmetic issue and is not the most important, so
> I'm not saying this is something you should put a lot of energy into.
>
> I guess it could be quite complex.

Yes, it is pretty impossible to implement, a compiler comparable task.
Especially when your function Restore works _always_, so I see no any
special reason to disable a menu item it is bound to.

On the other hand if you would rewrite this function to be:

  DestroyFunc Restore
  AddToFunc Restore
  + I ThisWindow (!Iconic, !Shaded, Maximized) Maximize false
  + I ThisWindow (!Iconic, Shaded, ) WindowShade false
  + I ThisWindow ( Iconic ) Iconify false

it's easier to see that there is the case (!Iconic, !Shaded, !Maximized)
when nothing is executed. But it is still pretty impossible for the
generic case when you call other functions or PipeRead in your function.

I think, if there is any solution to this, it is to specify a condition
(!Iconic, !Shaded, !Maximized) at the menu item definition time that is
executed on every menu popup to find whether it should be disabled.

Regards,
Mikhael.
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Wed Aug 21 2002 - 13:20:42 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:53 BST