views:

48

answers:

1

I was working on a program,that I need to support new additions. Hmmm. Let me give you some background on the program.

It is an educational software program that has quizzes for the user to take, just to gain odd knowledge. Now, It currently supports 6 subjects, all organized with directores on the HDD ( i.e. the Science directory is called science. ) and the way you launch the subject to see what quizzes you have to take is by pushing a button on the home screen.

This sort of thing prevents easy subject additions. I want to be able to add a subject later on without having to recode the home screen and re organize all the buttons. I would use a Listbox and os.listdir(...), but I was kind of wanting something prettier than a Listbox. I am using Tkinter on Windows. The Python version I am using is 2.6

Is there a "fancy" listbox sort of thing that can be styled to work with the background?

A: 

You can add buttons dynamically just fine, nothing is forcing you into the listbox. That said, I don't know why you care so much about "prettiness" since you're using Tkinter, which is very ugly by default.

nosklo
Yes, it is pretty uglyby default, that is why I don't use defaults! I styled the program with .GIF and .JPG images. Now, a little more about dynamic buttons. What exactly are you talking about, how is it done?
Zachary Brown
Oh, I got it! a = os.listdir(...) for word in a: [create buttons!] Thanks! One more question though, how do I randomly place the buttons on the window? That way, no matter how many there are, they all still look good. Thanks again!
Zachary Brown
@nosklo: tkinter apps are only as ugly as the designer designs them. It's quite easy to create good looking Tk apps, especially with modern versions of Tk that include themed widgets.
Bryan Oakley