Under the title

I wasn’t thinking of the state that just changed - we know that from the event. I was thinking of the buttons

Suppose we call the Buttons B1 to B6 as per FVWM, and have variables V0 to V3 that indicate whether we need a line between any pair of adjacent buttons.

-------------------------------------------------------------------
|      |      |      |                       |      |      |      |
|  B1  |  B3  |  B5  |                       |  B6  |  B4  |  B2  |
|      |      |      |                       |      |      |      |
-------------------------------------------------------------------
      V3     V2                                    V1     V0

Say B1 to B6 can have values T for Toggled or N for Normal, and that V0 to V3 can have True meaning “draw a line” and false which means “no line”. We don’t draw a line if both are popped up, since there are no lines at all in that state. And we don’t want one if both are popped in, since we want them to share a single indentation. So, assuming I’ve understood the requirment, we get:

V3 = (B1 != B3)
V2 = (B3 != B5)
V1 = (B6 != B4)
V0 = (B4 != B2)

And if the decors are named with a bit pattern in the names then once we have this information all we need write is

+ I ChangeDecor Decor$[V3]$[V2]$[V1]$[V0]

But to do that we need to be able to determine the toggle status of the buttons, the value of B1 to B6. Happliy it looks like that can be done with conditional statements based on the window state.

But anyway, that was what I was getting at.

Okay, I’ve done a lot of experimenting today. Although lot of your suggestions really went over my head, I would like to thank you.

What I have now is these 2 functions:

AddToFunc WindowShadeFunc
+ I Current (Sticky) ChangeDecor Toggled
+ I Current (!Sticky) ChangeDecor default
+ I UpdateStyles
+ I WindowShade
+ I ThisWindow (Shaded) ClosestWindowFunc

AddToFunc StickyFunc
+ I Current (Shaded) ChangeDecor Toggled
+ I Current (!Shaded) ChangeDecor default
+ I UpdateStyles
+ I Stick

And it seems to be working (this is only for buttons 3 and 5).

There is only one little thing left; when you have the window shaded, and then stick it, and after you unstick it, the Vectors don’t get in their default state for shade-button (obviously, since the window matches for being sticky when you press it). Not sure how that can be fixed.

My pleasure. It’s been educational :slight_smile:

It seems to me that you need a special decor if two adjacent buttons are in different toggle states. So you need to test for both states when deciding on a decor. You can’t assume that WindowShadeFunc is shading a window, because it’s a toggle action and may be unshading it.

Perhaps something like this:

[code]AddToFunc WindowShadeFunc

  • I WindowShade
  • I FuncDetermineNewStyle
  • I ThisWindow (Shaded) ClosestWindowFunc

AddToFunc StickyFunc

  • I Stick
  • I FuncDetermineNewStyle

I bet there’s a more elegant way to do this…

AddToFunc FuncDetermineNewStyle

  • I ThisWindow (Sticky,!Shaded) ChangeDecor Toggled
  • I TestRc (Match) Break
  • I ThisWindow (!Sticky,Shaded) ChangeDecor Toggled
  • I TestRc (Match) Break
  • I ChangeDecor default
    [/code]
    And then it shouldn’t matter whether you’re shading or unshading, sticking or unsticking.