ModeButton for Gtk#, gtk+, and pygtk

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)

  1. Jury wrote:

    Nice widget. Thanks a lot, I’m sure I’ll find some use for it very soon. :)

    Sunday, January 11, 2009 at 11:43 pm #
  2. /jk wrote:

    Hi, nice work.

    I have a newbie question, why you do a

    m_button.Show ()
    m_button.Hide ()

    in the onExposeEvent method?

    regards.

    Monday, February 23, 2009 at 6:20 pm #
  3. chergert wrote:

    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.

    Monday, February 23, 2009 at 7:11 pm #
  4. /jk wrote:

    fair enough. :)

    thanks.

    Monday, February 23, 2009 at 8:28 pm #
  5. DanRabbit wrote:

    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?

    Sunday, April 11, 2010 at 2:16 pm #
  6. chergert wrote:

    I’ll take a look.

    Sunday, April 11, 2010 at 2:41 pm #
  7. mathijshenquet wrote:

    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

    Wednesday, November 17, 2010 at 8:50 am #