JohnRickardJR opened this issue on Feb 04, 2005 ยท 35 posts
tromnek posted Fri, 18 February 2005 at 10:01 AM
We could easily make the number of lists and the number of elements in each list totally arbitrary. This would make it easy to let the user define and add a new preset based on what they have currently selected in the 'Destination' frame. I'll look into it when I get a chance. Here is a rough idea using a dictionary whose values are lists.
presets = { 'All On' : () ,<br></br> { 'All Off' : () ,<br></br> { 'All Toggle' : () ,<br></br> 'v3 body skin' : ('SkinTorso','SkinNeck','SkinHip','SkinFeet','SkinLeg','SkinArm','SkinHand') ,<br></br> 'v3 skin head' : ('SkinHead','SkinScalp'),<br></br> 'posette bits' : ('nipple','lips')<br></br> }
then to populate the list box widget,
for ps in presets.keys():<br></br> self.psetMAT.insert(Tkinter.END, ps)
then to process it, something like this
def handleset(self):
for thisPS in self.psetMAT.curselection():
if self.psetMAT.get(thisPS) == 'All On':
self.DstMAT.select_set(0, Tkinter.END)
elif self.psetMAT.get(thisPS) == 'All Off':
self.DstMAT.select_clear()
elif self.psetMAT.get(thisPS) == 'All Toggle':
for thisMATndx in range( self.DstMAT.size() ):
# Some toggle code for each thing
else:
for thisMATndx in range( self.DstMAT.size() ):
if self.DstMAT.get(thisMATndx) in presets[self.psetMAT.get(thisPS)]:
self.DstMAT.select_set(thisMATndx)
I'll check this idea when I get a chance later.
What do you think?