Re: FVWM: A little help with button styles

From: Dominik Vogt <dominik.vogt_at_gmx.de>
Date: Wed, 17 Nov 1999 21:42:18 +0100

On Mon, Nov 15, 1999 at 04:42:33PM -0500, Dan Espen wrote:
>
> I've worked on this a while, I guess I need someone else to look at it.
>
> I'd like to build a web page that illustrates what can be done with
> vector buttons. I'd like to do that by creating a window with 10
> vector buttons on it and them grabbing its image. I have driver like
> this:
>
> # Test bed for vector buttons:
> DestroyFunc button_demo
> AddToFunc button_demo
> + I 10_buttons
> + I Style "button_demo_style" UseDecor $0
> + I Exec xv -name button_demo_style -geometry 155x100
>
> # -- Start of 10 button layout --
> DestroyFunc 10_buttons
> AddToFunc 10_buttons
> + I Style "button_demo_style" NoButton 1, NoButton 2, NoButton 3
> + I Style "button_demo_style" NoButton 4, NoButton 5, NoButton 6
> + I Style "button_demo_style" NoButton 7, NoButton 8, NoButton 9, NoButton 10
> + I Style "button_demo_style" Button 1, Button 2, Button 3
> + I Style "button_demo_style" Button 4, Button 5, Button 6
> + I Style "button_demo_style" Button 7, Button 8, Button 9, Button 10
> + I Mouse 0 1 A "Iconify"
> + I Mouse 0 3 A Nop
> + I Mouse 0 5 A Nop
> + I Mouse 0 7 A Nop
> + I Mouse 0 9 A Nop
> + I Mouse 0 2 A Nop
> + I Mouse 0 4 A Nop
> + I Mouse 0 6 A Nop
> + I Mouse 0 8 A Nop
> + I Mouse 0 10 A Nop
>
> DestroyDecor DecorDemo1
> AddToDecor DecorDemo1
> + TitleStyle Centered
> + TitleStyle Height 40
> + TitleStyle (Solid blue -- Flat)
> + ButtonStyle Reset
> + ButtonStyle 1 5 25x25_at_1 25x75_at_1 75x75_at_0 75x25_at_0 25x25_at_1
> + ButtonStyle 2 5 45x45_at_1 55x45_at_1 55x55_at_0 45x55_at_0 45x45_at_1
> + ButtonStyle 3 5 25x25_at_1 25x75_at_1 75x75_at_0 75x25_at_0 25x25_at_1
> + ButtonStyle 4 5 45x45_at_1 55x45_at_1 55x55_at_0 45x55_at_0 45x45_at_1
> + ButtonStyle 5 5 25x25_at_1 25x75_at_1 75x75_at_0 75x25_at_0 25x25_at_1
> + ButtonStyle 6 5 45x45_at_1 55x45_at_1 55x55_at_0 45x55_at_0 45x45_at_1
> + ButtonStyle 7 5 25x25_at_1 25x75_at_1 75x75_at_0 75x25_at_0 25x25_at_1
> + ButtonStyle 8 5 45x45_at_1 55x45_at_1 55x55_at_0 45x55_at_0 45x45_at_1
> + ButtonStyle 9 5 25x25_at_1 25x75_at_1 75x75_at_0 75x25_at_0 25x25_at_1
> + ButtonStyle 10 5 45x45_at_1 55x45_at_1 55x55_at_0 45x55_at_0 45x45_at_1
>
> I then invoke this by entering the command:
>
> button_demo DecorDemo1
>
> So far, I have 2 problems:
>
> I normally have pixmaps on some of my buttons. The above logic
> doesn't remove them. I end of with some of the buttons on the new
> window still showing pixmaps.
>
> The above affects all newly created windows, not just the ones
> that match the style "DecorDemo1".

I see several problems:

 1) The style name 'button_demo_style' doesn't apply to my xv window
    because it's called 'button_demo_style <unregistered>'.
    'button_demo_style*' should do the trick.

 2) As soon as you issue the 'Mouse ...' bindings, all ten buttons
    are enabled for *all* windows, but you won't notice this until
    you do a 'recapture'. Hence you get the default vectors on new
    windows that don't match the style name (including the xv window
    for me).

 3) This also explains why you still see the pixmap: because the
    style doesn't match, the style ==> the decor ==> the new
    ButtonStyle is never applied to these windows ==> the pixmap
    is never removed.

 4) The line

      + I Mouse 0 10 A Nop

    doesn't do what you think. It will override the binding of button
    1 and button 0 since the context bit is one character each. Thus
    the 'iconify' binding doesn't work.

To prevent these new buttons from showing up on all new windows you
will need something like

  Style * NoButton 5, NoButton 7, NoButton 9, NoButton 8, NoButton10

Heck, this decor/buttonstyle/borderstyle/titlestyle stuff is really
screwed up. We have to clean it up one day.

Bye

Dominik ^_^

--
Dominik Vogt, dominik.vogt_at_gmx.de
Reply-To: dominik.vogt_at_gmx.de
--
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 Nov 17 1999 - 18:05:31 GMT

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:38:02 BST