For an application I'm working on, I needed a button for selecting the visual mode. It was by accident, but apparently it looks similar to a frequently used widget in OS X.
In my normal style, I've written the widget in multiple languages. It's available in C, C#, and Python.

Grab the code here. It's headers state LGPL 2.1, but if you want something different, just ask me. I'm pretty flexible.

Comments (7)
Nice widget. Thanks a lot, I’m sure I’ll find some use for it very soon.
Hi, nice work.
I have a newbie question, why you do a
m_button.Show ()
m_button.Hide ()
in the onExposeEvent method?
regards.
That is a nasty nasty hack to work around some cases where the button we use to draw via the theme engine hasn’t been realized/mapped.
It really shouldn’t ever be done.
fair enough.
thanks.
Hey There,
I’m using your C# widget in my application Dash as a view switcher. Unfortunately, its causing 100% CPU and I can’t figure out why :/ Is this a known bug, or is there something you know that will cause this?
I’ll take a look.
Hey chergert,
I really love your widget, so I rewrote it to vala, added some functionality and modified it to gtk3.
The code can be found here: lp:~mathijshenquet/+junk/libelementary
ModeButton.vala