|
|

楼主 |
发表于 2005-12-12 17:35:03
|
显示全部楼层
conwood的代码没错,我的那个方法多一个参数,用来指定窗口显示的延迟时间。仔细看看这里就知道了
- 7.17 Autohiding FvwmButtons or other windows.
- Some applications have a feature usually called "autohiding"
- which allows to withdraw a window to a location where it does
- not use precious desktop space. It is possible to write some
- small functions in fvwm that can hide any window you like:
- fvwm-2.5.11 or later:
- # The autohiding functions
- AddToFunc autohide
- + I ThisWindow ($0) Deschedule $[w.id]
- + I ThisWindow ($0) KeepRc ThisWindow (shaded) WindowShade off
- + I TestRc (!Match) All ($0, !shaded) autohide_hide $1 $2
- AddToFunc autohide_hide
- + I Schedule $0 $[w.id] WindowShade $1
- + I Schedule $0 $[w.id] Deschedule $[w.id]
- # Start FvwmAuto
- AddToFunc StartFunction
- + I Module FvwmAuto FvwmAutohide -menter enter_handler
- # Add the windows you want to autohide
- AddToFunc enter_handler
- + I autohide FvwmButtons 500 S
- # ^ ^ ^
- # | | |___ Shade direction (optional)
- # | |_______ Hide delay (milliseconds)
- # |___________________ Unique window name/resource
- Simply add any windows you like to the enter_handler function
- as in the example above. The autohide function is called with
- two or three parameters. The first one is the window's name or
- class, which must be unique. The second is the delay in
- milliseconds before the window is hidden after the pointer
- leaves it, and the last - optional - one indicates the
- direction in which it is hidden (N, S, E, W, NW, NE, SW or SE).
- You can find a slightly more complicated version below. The
- difference is that showing the window does not happen
- immediately, but can be delayed too.
- fvwm-2.5.11 or later:
- AddToFunc autohide
- + I ThisWindow ($0) Deschedule $[w.id]
- + I TestRc (!Match) Deschedule -$[w.id]
- + I ThisWindow ($0) KeepRc ThisWindow (shaded) \
- autohide_show $1 $3
- + I TestRc (!Match) All ($0, !shaded) autohide_hide $2 $3
- AddToFunc autohide_show
- + I Schedule $0 -$[w.id] WindowShade $1 off
- + I Schedule $0 -$[w.id] Deschedule $[w.id]
- + I Schedule $0 -$[w.id] Deschedule -$[w.id]
- AddToFunc autohide_hide
- + I Schedule $0 $[w.id] WindowShade $1 on
- + I Schedule $0 $[w.id] Deschedule $[w.id]
- + I Schedule $0 $[w.id] Deschedule -$[w.id]
- AddToFunc StartFunction
- + I Module FvwmAuto FvwmAutohide -menter enter_handler
- AddToFunc enter_handler
- + I autohide FvwmButtons 250 500 S
- # ^ ^ ^ ^
- # | | | |__ Shade direction (optional)
- # | | |______ Hide delay
- # | |__________ Show delay
- # |______________________ Unique window name/resource
- These functions work too in 2.5.8 to 2.5.10, but you may have
- to remove the KeepRc command from the autohide function in both
- versions.
复制代码 |
|