I decided to write my own
Dungeons & Dragons character generator when the ones I found either looked clunky, or didn't run on OSX, or lacked functionality I believed was required in such a tool. Since I had a bit of experience with wxPython creating my
Conway's Life toy, I decided to try it on a larger toy.
If you're not familiar with character creation for D & D one of the earliest steps is to generate your character's ability scores. There are six scores with a theoretical range of 3 to 18 (think of rolling four dice, discarding the lowest number and summing the points shown on the remaining three). Those scores are then assigned to your character's abilities of Strength, Dexterity, Constitution, Intelligence, Wisdom and Charisma.
The problem I faced is that you can pick and choose which ability goes with which score and how do you present this in a usable and attractive UI? I had seen some interfaces using Radio Buttons, but they were bulky and cumbersome, so I decided to use the wx.Choice widget. The problem was that you could not disable an item in item list for a choice, and a user can only select each ability one time so what to do.
My solution to that problem is the RadioChoice widget. It allows you to create a group of wx.Choice widgets, each one starting with the same available choices, but when you make a choice on one of the widgets, that choice is removed from all of the other widgets.
This is my first "useful" widget. Who knows, it may only be useful for matching D&D abilities to scores, but then again you might find some other use for it.
The code and demo are available here...
RadioChoice.py
Constructive criticism is always welcome.