[Tutor] Dynamic TKinter widgets?
Nathan
sdragon1984 at gmail.com
Sun Nov 25 04:16:55 CET 2012
I'm working on a simple Tarot reading program in Python 2.7, and I'm having
a bit of trouble with some GUI abstract. (Sorry, no code in here.)
As of right now, all of the logic is working, and I can generate Tarot
spreads that tell me, in text, the role of each card "position", and what
card is in that position. For example, if I were to use a simple three-card
past/present/future spread, the output would be something like:
Past: Prince of Swords
Present: The Hermit
Future: Ten of Disks
What I'm trying to do now is add support for the card images. the problem
is, the program supports multiple types of spreads (two, so far, are
selectable), and they use different numbers of cards. It looks like I need
a variable number of widgets to display something like this. I'm not
entirely sure how I would handle something like that.
Right now, though, I do have two ideas that I would like to run by you
guys.
The first is to use one text widget-- as opposed to the one label widget
I'm currently using-- and embed the images where the card names would be. I
would have to try out some demos first, though, to see if I can otherwise
use text widgets just as label widgets.
The other idea, which seems much more cumbersome, is to create a dummy
frame widget, then a frame widget designed specifically for each type of
spread. The user selects the spread they want to use (Celtic Cross), and
the associated frame gets placed on the GUI.
What do you guys think? Is there a better way to deal (ha!) with this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20121124/7a6c9cb6/attachment.html>
More information about the Tutor
mailing list