Subject: Re: dynamism in FvwmButtons

From: Dominik Vogt <[email-masked]>
Date: Mon, 3 Jun 2002 18:43:55 +0200

On Wed, May 29, 2002 at 09:22:16PM +0000, Mikhael Goikhman wrote:
> On 29 May 2002 20:59:58 +0000, Mikhael Goikhman wrote:
> > 
> >   SendToModule FvwmButtons ChangeButton <button-id> Title/Icon <value>
> > 
> > <button-id> may be as it is now, number starting from 0 or "+x+y".
> > I will also add a syntax similar to "2/3" meaning the button number 3
> > in the container number 2. Should the syntax start counting from 0 or 1?
> 
> One addition. Id will be optionally specified in any button, i.e.:
> 
>   *FvwmButtons: (Id current_time, Title 14:00)
> 
>   SendToModule FvwmButtons ChangeButton current_time Title 14:01

I wonder if there is a better method than the "SendToModule" stuff
with a different syntax for all modules.  It shouldn't be too
difficult to ose the usual "*<ModuleName>: ..." syntax, e.g.

  *FvwmButtons: (<button id>, Icon foo.xpm, Title "bar")

or at least

  SendToModule FvwmButtons '*FvwmButtons: ...'

It might simplify parsing and save users the effort to learn a
completely new syntax.

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dan Espen <[email-masked]>
Date: Mon, 03 Jun 2002 15:22:04 -0400

>   *FvwmButtons: (<button id>, Icon foo.xpm, Title "bar")

A module can use this if it sets M_SENDCONFIG in its message mask.

-- 
Dan Espen                           E-mail: [email-masked]
444 Hoes Lane  Room RRC 1C-214      Phone: (732) 699-5570
Piscataway, NJ 08854
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Mikhael Goikhman <[email-masked]>
Date: Mon, 3 Jun 2002 20:08:18 +0000

> It might simplify parsing and save users the effort to learn a

1) Speaking globally.

If dynamical actions may be expressed using a static syntax, nice.
For example "*FvwmPager: DeskTopScale 20" may be respected dynamically.

But generally our database (or simply listing) of configurations for
modules is very inadequate for dynamical things. The proper answer to
all such problems is a scripting language. This is especially true for
gui modules. Widgets that are changed dynamically can't be expressed using
the current one-line-based configuration syntax. Although it is sometimes
possible to work around a missing scriptability, see FvwmForm and FvwmGtk.

FvwmScript does not use a module configuration database at all (except for
really static things, like default font/colorset) for a good reason.

2) Speaking about FvwmButtons.

A new functionality requires a new syntax. If one doesn't need a dynamical
functionality, he should not learn its syntax.

I don't want to invent a new syntax, but I don't see how it is possible to
use the existing static syntax for dynamical actions, like modify existing
button properties, add/delete property, add/delete button at the middle.

The only alternative to the new dynamical actions would be to remove the
static syntax and to move to a scripting that is used in real toolkits.
Then dynamical changing will not be different from creating an initial
layout. But then the syntax will be more complex, although more powerful.

I just want to add some missing (for me) functionality in FvwmButtons.
Any concrete suggestions are still welcome.

Regards,
Mikhael.

---

From: Mikhael Goikhman <[email-masked]>
Date: Mon, 3 Jun 2002 20:56:22 +0000

One more idea, storing a final configuration after some script or module
sent dynamical changes to FvwmButtons. Something like:

  SendToModule FvwmButtons-Alias SaveConfig

The config file name may default to $FVWM_USERDIR/FvwmButtons-Alias .
I.e. to invoke the initial configuration:

  Read FvwmButtons-Alias
  FvwmButtons FvwmButtons-Alias

The first line may be even redudant, i.e. the second one may do it
automatically just like FvwmForm does.

Regards,
Mikhael.

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 4 Jun 2002 11:46:06 +0200

> automatically just like FvwmForm does.

As much as I'd like the idea of saving a configuration, I'm
against this way to implement it.  As you said in your other mail,
there is a need for a scripting language.  The configuration
commands could be dumped into a file then.  With the current
implementation of FvwmButtons, it would have to know it's own
syntax and print some configuration lines that would reproduce the
current layout.  That output will most likely look totally
different from the original configuration.  And even worse, we'd
have to remember updating that "save yourself" feature with each
new option.  There is at least one module that had this
functionality (I can't even remember which), but it hasn't been
updated for years.  No, we need an approach that keeps the
additional maintenance cost low.

Bye

Dominik ^_^  ^_^

---

From: Dan Espen <[email-masked]>
Date: Thu, 06 Jun 2002 09:23:52 -0400

> automatically just like FvwmForm does.

Having a module do an automatic read for its config
seems like a reasonable thing.  That would let a user
read in pre-packaged module configurations.

For FvwmButtons, FvwmForm, etc. the saving of the config
should probably be done by a future GUI that lets you design the
buttonbar or form.