Click to See Complete Forum and Search --> : Python GUI Fun


RAGEAngel9
04-16-2003, 02:09 PM
I'm working on a project and it has a gui.
I have the menu bar across the top with 2 checkbuttons.
I need to be able to control if they start off or on, but I'm not sure how to do this.
They are both of the form below:

self.edit.add_checkbutton(label="Mute", underline=0, command=self.Audio,variable=self.check)
self.edit.add_checkbutton(label="Highlighting", underline=0, command=self.Highlight)

What do I need to control their starting position?

inkedmn
04-16-2003, 03:37 PM
what gui toolkit are you using? GTK? QT? wxPython?

anyway, there's probably a component.setFocus() method that would start the app with the focus on one of the buttons...

RAGEAngel9
04-16-2003, 04:48 PM
i'm using TKinter.
My real problem is that since i'm using the add_checkbutton command, I don't have a specific item to use select() with.

inkedmn
04-17-2003, 11:08 AM
sorry, you've lost me...

RAGEAngel9
04-17-2003, 11:58 AM
Don't worry I got it, although I feel stupid for not getting it earlier.
My cehckbutton was like this:
self.edit.add_checkbutton(label="Mute", underline=0, command=self.Audio,variable=self.check)

So to activate it I needed something like this:

self.check.set(1)

or similar depending on how i wanted it set.