Re: FVWM: Module which saves window-states

From: Mikhael Goikhman <migo_at_homemail.com>
Date: Sat, 18 Oct 2003 02:51:43 +0300

On 17 Oct 2003 17:41:13 +0200, Tomas ?kesson wrote:
>
> Ok, I said before that I planned to develop a module for saving of
> window-position/size, so here we go. My Perl skills are not the best so if
> you are interested, feel free to improve the code or make comments on it.
>
> The module (FvwmSaveWindow) is found under the fvwm-section on my website:

I took a short look (without running) at
  http://radikal.ath.cx/software/files/FvwmSaveWindow

I can't say you don't know Perl if you wrote such module in several days.
The module as it is now may probably be named FvwmMemorizeGeometry or so.

Some small notes that are hopefully intended to simplify your module.

1) You may use General::FileSystem to load/save/append file in one go.
You may probably also keep the whole config in memory (in hash) instead
of always loading/saving it from/to file.

2) You may use a single ResizeMove command to simplyify the module logic;
with "keep" arguments it may simulate both Move and Resize.

3) You may use ModuleConfig tracker to get the module configuration.

4) If you replace "Debug => $debugging," with "Debug => \$debugging,"
then this will also automagically work if you uncomment EnableOptions.

5) I see you (and Scott too) use this form to operate on a window:

  $module->send("WindowId $winId Move ...");

It is better (and a bit faster) to immediately define a window context:

  $module->send("Move ...", $winId);

6) You may omit the explicit module mask in the constructor if you wish,
but only in cvs versions.

7) In the future I hope that WindowList tracker (the only non functional
yet) will save you dozens of lines in your module. Of course it is pretty
difficult to come up with a perfect WindowList API that makes easier the
work on such completely different modules like FvwmWindowMenu, FvwmTabs
and FvwmSaveWindow, but I am working on this.

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 Fri Oct 17 2003 - 18:54:13 BST

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