Showing posts with label wxPython. Show all posts
Showing posts with label wxPython. Show all posts

Thursday, 2 February 2012

WYSIWYG: A new start with wxFormBuilder

Warning, this is just a short update...

I have been absent for a while and I apologise, real life is keeping me rather busy, I must admit. Regarding things relevant to this blog, I have been busy transferring my GUI design to a new WYSIWG editor in order to have results that are more like what I was hoping to achieve. I used XRCed or wxGlade before, but I have not been content with them. The project XRCed has been inactive since a long time, so it was time to move on and something about wxGlade I just don't like. It is, in my opinion, a bit unwieldy and I find myself trying to incorporate widgets that aren't available in it.

As a consequence, I have been looking for an alternative, which came in the form of wxFormBuilder. It looks like a nice project and the design borrows heavily from Microsoft's Visual Express, which is not always a bad thing. As such, I have been busy, unlearning some of the things, I got used to and gotten to grips with peculiarities of the other. So far, very pleased with it. Unfortunately, there isn't a particularly good tutorial out there, which means, I will ned a little longer. At the off-chance, I may be able to write one once I have become more proficient with it.

Anyhow, so long, folks and thanks for all the fish.

Thursday, 10 November 2011

wxPython - Little Things - Pt. 1 of many - Grey out radio buttons

When I use GUIs in Python, I always use wxPython. Simply because when I first wanted to create GUIs, wxPython was the one that I understood quickest. There is not much else to it.

I will not write another tutorial about it, because there are enough out there already. For basic ones, just have a look at these:

http://zetcode.com/wxpython/
http://wiki.wxpython.org/AnotherTutorial
http://wiki.wxpython.org/How%20to%20Learn%20wxPython
http://wiki.wxpython.org/Getting%20Started

and then there are also loads of videos on youtube and on showmedo. And last but definitely not least you may wanna check out the book on wxPython. These are all written (or made) by people who have the tendency to know more about the topic than I do.

So here is what I am going to do. Since I am still a learner myself, I will always try to note down a little bit of wisdom of wxPython to you.

The first one is the EnableItem(n, flag) method for a specific Radiobutton. Until this day, I truly thought that you could only enable or disable the entire radio box widget. Just call radiobox.Disable() or .Enable() and bob's your uncle (this works for all widgets I believe). Today, I wanted to disable separate buttons of the radio.
After some googling, I finally came across the wxWidgets documentation and stumbled across EnableItem(n, flag). So calling this with the index of your selection to be disabled and the flag "False", you actually can grey out a single button :)

Voila.