Subject: FVWM: A little help with button styles

From: Dan Espen <[email-masked]>
Date: Mon, 15 Nov 1999 16:42:33 -0500

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@1 25x75@1 75x75@0 75x25@0 25x25@1
+ ButtonStyle 2  5 45x45@1 55x45@1 55x55@0 45x55@0 45x45@1
+ ButtonStyle 3  5 25x25@1 25x75@1 75x75@0 75x25@0 25x25@1
+ ButtonStyle 4  5 45x45@1 55x45@1 55x55@0 45x55@0 45x45@1
+ ButtonStyle 5  5 25x25@1 25x75@1 75x75@0 75x25@0 25x25@1
+ ButtonStyle 6  5 45x45@1 55x45@1 55x55@0 45x55@0 45x45@1
+ ButtonStyle 7  5 25x25@1 25x75@1 75x75@0 75x25@0 25x25@1
+ ButtonStyle 8  5 45x45@1 55x45@1 55x55@0 45x55@0 45x45@1
+ ButtonStyle 9  5 25x25@1 25x75@1 75x75@0 75x25@0 25x25@1
+ ButtonStyle 10 5 45x45@1 55x45@1 55x55@0 45x55@0 45x45@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".

-- 
Dan Espen
444 Hoes Lane  Room RRC 1C-214             E-mail: [email-masked]
Piscataway, NJ 08854                       Phone: (732) 699-5570
--
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 [email-masked].
To report problems, send mail to [email-masked].

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 17 Nov 1999 21:42:18 +0100

> 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, [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" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].