Re: tkinter radiobutton

2005-06-29 Thread William Gill
I did some more digging based on your code, and discovered list comprehensions. They didn't register the first time I skimmed the language reference and tutorial. It's obvious the more I learn, the more I need to relearn what I think I know. I need to study comprehensions, but they open up l

Re: tkinter radiobutton

2005-06-28 Thread Peter Otten
William Gill wrote: > Also, does 'row == var.get() for var in self.variables' perform the > comparison row == var.get() for each item in self.variables?  I would > have had to write: > > for var in self.variables: > return row == var.get() Or rather result = [] for var in self.variables:

Re: tkinter radiobutton

2005-06-28 Thread William Gill
p.s. I tweaked rbn = tk.Radiobutton(self, text=text, variable=var, value=y) to rbn = tk.Radiobutton(self, text=text, variable=var, value=y+1) and return tuple(row == var.get() for var in self.variables) to return tuple(row+1 == var.get() for var in self.variables) so that the Radiogri

Re: tkinter radiobutton

2005-06-28 Thread William Gill
> What follows looks more like a spec than a question. It is, but I wanted to show why I was getting confused trying to use control variables to maintain the overall relationship. Thank you. This is exactly what I'm trying to do, and oddly enough similar in concept to what I was doing, but fa

Re: tkinter radiobutton

2005-06-28 Thread Peter Otten
William Gill wrote: > I thought the problem was practical, not philosophical, but what do I > know I'm the one asking for help. What follows looks more like a spec than a question. >columns can have 0 or 1 selection >rows can have 0,1,2,3, or 4 selections. > Loop through the 4 i

Re: tkinter radiobutton

2005-06-28 Thread William Gill
I thought the problem was practical, not philosophical, but what do I know I'm the one asking for help. I have radiobuttons arranged in 4 rows of 4 buttons each ( 4 rows and 4 columns ) The user can select no more than 1 choice in any column, but any number in any row. Restated: col

Re: tkinter radiobutton

2005-06-28 Thread Peter Otten
William Gill wrote: > The radiobutton widget knows if it is selected or unselected, or it > wouldn't be able to display correctly, but based on what I'm seeing, > that information is inaccessable to the app.  Instead the app must > evaluate an associated control variable.  That doesn't make sence 

Re: tkinter radiobutton

2005-06-28 Thread William Gill
> or use a custom subclass ... I had considered extending radiobutton to add whatever properties needed, but the net/net is the same, that property must be set using methods that trigger on the rb command procedure, or an external (to the rb) control variable value. The radiobutton widget kno

Re: tkinter radiobutton

2005-06-27 Thread Peter Otten
William Gill wrote: > I am placing radiobuttons in a 4 X 4 matrix (using loops) and keep > references to them in a 2 dimensional list ( rBtns[r][c] ). It works > fine, and I can even make it so only one button per column can be > selected, by assigning each column to an intVar. In many languages

Re: tkinter radiobutton

2005-06-27 Thread William Gill
>> to determine if it is selected?, or can this only be achieved via >> control variables? > The value and variable options for a radiobutton seem to be what > you're looking for. Thanks, I knew that, but I was looking for a way to read the selected/unselected status directly. Using control

Re: tkinter radiobutton

2005-06-26 Thread Eric Brunel
On Sat, 25 Jun 2005 19:34:50 GMT, William Gill <[EMAIL PROTECTED]> wrote: > I am placing radiobuttons in a 4 X 4 matrix (using loops) and keep > references to them in a 2 dimensional list ( rBtns[r][c] ). It works > fine, and I can even make it so only one button per column can be > selected, by