def myButList(name=["_Read", "_Write", "_Defau"], icon=Gtk.STOCK_NO, call=None, data=['dati'], tBox='v', aBox=[False, False, 1]): #callback debug def on_clicked(widg, ind, *data): print "a", ind, data # in assenza di callback uso quella di debug if call == None: call = on_clicked # funzione che istanzia oggetti tipo def myList(ind): #myButton # butt,call return myButton(name[ind], icon, call, [ind, data]) #myBoxList # xBox, [butt,call] * N obje, othe = myBoxList(name=name, tBox=tBox, aBox=aBox, func=myList) # <- return obje, othe
def myButFraList(name=["Read", "Write", "Default"], nBut=["", "", ""], icon=Gtk.STOCK_YES, call=None, data=['dati'], bFra=1, sFra=Gtk.SHADOW_ETCHED_OUT, tFra='v', aFra=[False, False, 1], tBox='h', aBox=[False, False, 1]): #callback debug def on_clicked(widg, ind, *data): print "a", ind, data # in assenza di callback uso quella di debug if call == None: call = on_clicked # funzione che istanzia oggetti tipo def myList(ind): #myButFrame # fram, [labe, xBox, butt, call] return myButFrame(name[ind], nBut[ind], icon, call, [ind, data], bFra, sFra, tFra, aFra) #myBoxList # xBox, [fram, [labe, xBox, butt, call]] * N obje, othe = myBoxList(name=name, tBox=tBox, aBox=aBox, func=myList) # <- return obje, othe
def myButFraList(name=["Read","Write","Default"], nBut=["","",""], icon=Gtk.STOCK_YES, call=None, data=['dati'], bFra=1, sFra=Gtk.SHADOW_ETCHED_OUT, tFra='v', aFra=[False, False, 1], tBox='h', aBox=[False, False, 1]): #callback debug def on_clicked(widg, ind, *data): print "a", ind, data # in assenza di callback uso quella di debug if call == None: call = on_clicked # funzione che istanzia oggetti tipo def myList(ind): #myButFrame # fram, [labe, xBox, butt, call] return myButFrame(name[ind], nBut[ind], icon, call, [ind, data], bFra, sFra, tFra, aFra) #myBoxList # xBox, [fram, [labe, xBox, butt, call]] * N obje, othe = myBoxList(name=name, tBox=tBox, aBox=aBox, func=myList) # <- return obje, othe
def myEntList(name=["One","Two","Three"], numb=None, call=None, data=['dati'], tBox='v', aBox=[False, False, 1]): #callback debug def on_activate(widg, ind, *data): print "a", widg print ind, data # in assenza di callback uso quella di debug if call == None: call = on_activate # funzione che istanzia oggetti tipo def myList(ind): #myEntry # entr, call return myEntry(name[ind], numb, call, [ind, data]) #myBoxList # xBox, [entr, call] * N obje, othe = myBoxList(name=name, tBox=tBox, aBox=aBox, func=myList) # <- return obje, othe
def myEntFraList(name=["One", "Two", "Three"], numb=None, call=None, data=['dati'], nFra=['Label01', 'Label02', 'Label03'], cFra='black', bFra=1, sFra=Gtk.SHADOW_ETCHED_OUT, tFra='v', aFra=[False, False, 1], tBox='h', aBox=[False, False, 1]): #callback debug def on_activate(widg, ind, *data): print "a", print ind, data # in assenza di callback uso quella di debug if call == None: call = on_activate # funzione che istanzia oggetti tipo def myList(ind): #myEntFram #fram, [labe, xBox, entr, call] return myEntFrame(name[ind], numb, call, [ind, data], nFra[ind], cFra, bFra, sFra, tFra, aFra) #myBoxList # xBox, [fram, [labe, xBox, entr, call]] * N obje, othe = myBoxList(name=name, tBox=tBox, aBox=aBox, func=myList) # <- return obje, othe
def myEntLabList(name=["One","Two","Three"], numb=None, call=None, data=['dati'], nLab=['Label01','Label02','Label03'], cLab="#333", tLab='h', aLab=[False, False, 1], tBox='h', aBox=[False, False, 1],): #callback debug def on_activate(widg, ind, *data): print "a", widg print ind, data # in assenza di callback uso quella di debug if call == None: call = on_activate # funzione che istanzia oggetti tipo def myList(ind): #myEntLabel # xBox, [entr, call, labe] return myEntLabel(name[ind], numb, call, [ind, data], nLab[ind], cLab, tLab, aLab) #myBoxList # xBox, [xBox, [entr, call, labe]] * N obje, othe = myBoxList(name=name, tBox=tBox, aBox=aBox, func=myList) # <- return obje, othe
def myChkButList(name=["One","Two","Three"], valu=False, colo=None, call=None, data=['dati'], tBox='h', aBox=[False, False, 1]): #callback debug def on_clicked(widg, ind, *data): ena = widg.get_active() print "a", print ind, data, ("OFF", "ON")[ena] # in assenza di callback uso quella di debug if call == None: call = on_clicked # funzione che istanzia oggetti tipo def myList(ind): #myChkButton # butt, [call,] return myChkButton(name=name[ind], valu=False, colo=None, call=call, data=[ind, data]) #myBoxList # xBox, [butt, call] * N obje, othe = myBoxList(name=name, tBox=tBox, aBox=aBox, func=myList) # <- return obje, othe
def myChkButList(name=["One", "Two", "Three"], valu=False, colo=None, call=None, data=['dati'], tBox='h', aBox=[False, False, 1]): #callback debug def on_clicked(widg, ind, *data): ena = widg.get_active() print "a", print ind, data, ("OFF", "ON")[ena] # in assenza di callback uso quella di debug if call == None: call = on_clicked # funzione che istanzia oggetti tipo def myList(ind): #myChkButton # butt, [call,] return myChkButton(name=name[ind], valu=False, colo=None, call=call, data=[ind, data]) #myBoxList # xBox, [butt, call] * N obje, othe = myBoxList(name=name, tBox=tBox, aBox=aBox, func=myList) # <- return obje, othe
def myEntList(name=["One", "Two", "Three"], numb=None, call=None, data=['dati'], tBox='v', aBox=[False, False, 1]): #callback debug def on_activate(widg, ind, *data): print "a", widg print ind, data # in assenza di callback uso quella di debug if call == None: call = on_activate # funzione che istanzia oggetti tipo def myList(ind): #myEntry # entr, call return myEntry(name[ind], numb, call, [ind, data]) #myBoxList # xBox, [entr, call] * N obje, othe = myBoxList(name=name, tBox=tBox, aBox=aBox, func=myList) # <- return obje, othe
def myEntFraList(name=["One","Two","Three"], numb=None, call=None, data=['dati'], nFra=['Label01','Label02','Label03'], cFra='black', bFra=1, sFra=Gtk.SHADOW_ETCHED_OUT, tFra='v', aFra=[False, False, 1], tBox='h', aBox=[False, False, 1]): #callback debug def on_activate(widg, ind, *data): print "a", print ind, data # in assenza di callback uso quella di debug if call == None: call = on_activate # funzione che istanzia oggetti tipo def myList(ind): #myEntFram #fram, [labe, xBox, entr, call] return myEntFrame(name[ind], numb, call, [ind, data], nFra[ind], cFra, bFra, sFra, tFra, aFra) #myBoxList # xBox, [fram, [labe, xBox, entr, call]] * N obje, othe = myBoxList(name=name, tBox=tBox, aBox=aBox, func=myList) # <- return obje, othe
def myEntLabList( name=["One", "Two", "Three"], numb=None, call=None, data=['dati'], nLab=['Label01', 'Label02', 'Label03'], cLab="#333", tLab='h', aLab=[False, False, 1], tBox='h', aBox=[False, False, 1], ): #callback debug def on_activate(widg, ind, *data): print "a", widg print ind, data # in assenza di callback uso quella di debug if call == None: call = on_activate # funzione che istanzia oggetti tipo def myList(ind): #myEntLabel # xBox, [entr, call, labe] return myEntLabel(name[ind], numb, call, [ind, data], nLab[ind], cLab, tLab, aLab) #myBoxList # xBox, [xBox, [entr, call, labe]] * N obje, othe = myBoxList(name=name, tBox=tBox, aBox=aBox, func=myList) # <- return obje, othe
def myRadButLisLabel(name=["One","Two","Three"], chil=None, valu=False, call=None, data=['dati'], nLab='Label', cLab=None, tBox='h', aBox=[False, False, 1]): """ nLab name cLab color """ #callback debug def on_clicked(widg, ind, *data): ena = widg.get_active() if ena: print "a", "%05s" %widg.props.label.replace('_',''), print ind, data # in assenza di callback uso quella di debug if call == None: call = on_clicked # funzione che istanzia oggetti tipo def myList(ind): #myRadButton # butt, call return myRadButton(name=name[ind], chil=chil, valu=False, call=call, data=[ind, data]) #myBoxList # xBox, [butt, call] * N obje, othe = myBoxList(name=name, tBox=tBox, aBox=aBox, func=myList) # prendo come capogruppo la prima istanza gro = othe[0][0].get_group() for ele in othe[1:]: # imposto il capogruppo alle altre istanze ele[0].join_group(gro[0]) # rendo attivo il button if type(valu) == type(1): othe[valu][0].set_active(True) #myLabel if cLab == None: cLab='blue' #name='myLabel', leng=0, prea=' ', post='', font='Arial 10', colo=Gdk.color_parse('black') labe = myLabel(name=nLab, leng=len(nLab)+1, prea=' ', post=' ', font='Courier 10', colo=cLab) # inserisco la label nella list degli oggetti othe.insert(0,[labe]) # inserisco la label in testa alla box #child, expand=True, fill=True, padding=0 obje.pack_start(labe, False, False, 0) obje.reorder_child(labe, 0) # <- return obje, othe
def myChkButLisLabel(name=["One", "Two", "Three"], valu=False, colo=None, call=None, data=['dati'], nLab='Label', cLab=None, tBox='h', aBox=[False, False, 1]): """ nLab name cLab color """ #callback debug def on_clicked(widg, ind, *data): ena = widg.get_active() print "a", print ind, data, ("OFF", "ON")[ena] # in assenza di callback uso quella di debug if call == None: call = on_clicked # funzione che istanzia oggetti tipo def myList(ind): #myChkButton # butt, call return myChkButton(name=name[ind], valu=False, colo=None, call=None, data=[ind, data]) #myBoxList # xBox, [butt, call] * N obje, othe = myBoxList(name=name, tBox=tBox, aBox=aBox, func=myList) #myLabel if cLab == None: cLab = 'blue' #name='myLabel', leng=0, prea=' ', post='', font='Arial 10', colo=Gdk.color_parse('black') labe = myLabel(name=nLab, leng=len(nLab) + 1, prea=' ', post=' ', font='Courier 10', colo=cLab) # inserisco la label nella list degli oggetti othe.insert(0, [labe]) # inserisco la label in testa alla box #child, expand=True, fill=True, padding=0 obje.pack_start(labe, False, False, 0) obje.reorder_child(labe, 0) # <- return obje, othe
def myChkButLisLabel(name=["One","Two","Three"], valu=False, colo=None, call=None, data=['dati'], nLab='Label', cLab=None, tBox='h', aBox=[False, False, 1]): """ nLab name cLab color """ #callback debug def on_clicked(widg, ind, *data): ena = widg.get_active() print "a", print ind, data, ("OFF", "ON")[ena] # in assenza di callback uso quella di debug if call == None: call = on_clicked # funzione che istanzia oggetti tipo def myList(ind): #myChkButton # butt, call return myChkButton(name=name[ind], valu=False, colo=None, call=None, data=[ind, data]) #myBoxList # xBox, [butt, call] * N obje, othe = myBoxList(name=name, tBox=tBox, aBox=aBox, func=myList) #myLabel if cLab == None: cLab= 'blue' #name='myLabel', leng=0, prea=' ', post='', font='Arial 10', colo=Gdk.color_parse('black') labe = myLabel(name=nLab, leng=len(nLab)+1, prea=' ', post=' ', font='Courier 10', colo=cLab) # inserisco la label nella list degli oggetti othe.insert(0,[labe]) # inserisco la label in testa alla box #child, expand=True, fill=True, padding=0 obje.pack_start(labe, False, False, 0) obje.reorder_child(labe, 0) # <- return obje, othe
def myLabList(name=["_Read","_Write","_Defau"], leng=0, prea=' ', post='', font='Courier 10', colo='black', tBox='v', aBox=[False, False, 1]): # funzione che istanzia oggetti tipo def myList(ind): #myLabel # labe obje = myLabel(name[ind], leng, prea, post, font, colo) return obje, None #myBoxList # xBox, [labe, None] * N obje, othe = myBoxList(name=name, tBox=tBox, aBox=aBox, func=myList) # <- return obje, othe
def myLabList(name=["_Read", "_Write", "_Defau"], leng=0, prea=' ', post='', font='Courier 10', colo='black', tBox='v', aBox=[False, False, 1]): # funzione che istanzia oggetti tipo def myList(ind): #myLabel # labe obje = myLabel(name[ind], leng, prea, post, font, colo) return obje, None #myBoxList # xBox, [labe, None] * N obje, othe = myBoxList(name=name, tBox=tBox, aBox=aBox, func=myList) # <- return obje, othe
def myRadButList(name=["One", "Two", "Three"], chil=None, valu=0, call=None, data=['dati'], tBox='h', aBox=[False, False, 1]): #callback debug def on_clicked(widg, ind, *data): ena = widg.get_active() if ena: print "a", "%05s" % widg.props.label.replace('_', ''), print ind, data # in assenza di callback uso quella di debug if call == None: call = on_clicked # funzione che istanzia oggetti tipo def myList(ind): #myRadButton # butt,[call,] return myRadButton(name=name[ind], chil=chil, valu=False, call=call, data=[ind, data]) #myBoxList # xBox, [butt,call] * N obje, othe = myBoxList(name=name, tBox=tBox, aBox=aBox, func=myList) # prendo come capogruppo la prima istanza gro = othe[0][0].get_group() for ele in othe[1:]: # imposto il capogruppo alle altre istanze ele[0].join_group(gro[0]) # rendo attivo il button if type(valu) == type(1): othe[valu][0].set_active(True) # <- return obje, othe
def myButList(name=["_Read","_Write","_Defau"], icon=Gtk.STOCK_NO, call=None, data=['dati'], tBox='v', aBox=[False, False, 1]): #callback debug def on_clicked(widg, ind, *data): print "a", ind, data # in assenza di callback uso quella di debug if call == None: call = on_clicked # funzione che istanzia oggetti tipo def myList(ind): #myButton # butt,call return myButton(name[ind], icon, call, [ind, data]) #myBoxList # xBox, [butt,call] * N obje, othe = myBoxList(name=name, tBox=tBox, aBox=aBox, func=myList) # <- return obje, othe
def myRadButList(name=["One","Two","Three"], chil=None, valu=0, call=None, data=['dati'], tBox='h', aBox=[False, False, 1]): #callback debug def on_clicked(widg, ind, *data): ena = widg.get_active() if ena: print "a", "%05s" %widg.props.label.replace('_',''), print ind, data # in assenza di callback uso quella di debug if call == None: call = on_clicked # funzione che istanzia oggetti tipo def myList(ind): #myRadButton # butt,[call,] return myRadButton(name=name[ind], chil=chil, valu=False, call=call, data=[ind, data]) #myBoxList # xBox, [butt,call] * N obje, othe = myBoxList(name=name, tBox=tBox, aBox=aBox, func=myList) # prendo come capogruppo la prima istanza gro = othe[0][0].get_group() for ele in othe[1:]: # imposto il capogruppo alle altre istanze ele[0].join_group(gro[0]) # rendo attivo il button if type(valu) == type(1): othe[valu][0].set_active(True) # <- return obje, othe
def myRadButLisLabel(name=["One", "Two", "Three"], chil=None, valu=False, call=None, data=['dati'], nLab='Label', cLab=None, tBox='h', aBox=[False, False, 1]): """ nLab name cLab color """ #callback debug def on_clicked(widg, ind, *data): ena = widg.get_active() if ena: print "a", "%05s" % widg.props.label.replace('_', ''), print ind, data # in assenza di callback uso quella di debug if call == None: call = on_clicked # funzione che istanzia oggetti tipo def myList(ind): #myRadButton # butt, call return myRadButton(name=name[ind], chil=chil, valu=False, call=call, data=[ind, data]) #myBoxList # xBox, [butt, call] * N obje, othe = myBoxList(name=name, tBox=tBox, aBox=aBox, func=myList) # prendo come capogruppo la prima istanza gro = othe[0][0].get_group() for ele in othe[1:]: # imposto il capogruppo alle altre istanze ele[0].join_group(gro[0]) # rendo attivo il button if type(valu) == type(1): othe[valu][0].set_active(True) #myLabel if cLab == None: cLab = 'blue' #name='myLabel', leng=0, prea=' ', post='', font='Arial 10', colo=Gdk.color_parse('black') labe = myLabel(name=nLab, leng=len(nLab) + 1, prea=' ', post=' ', font='Courier 10', colo=cLab) # inserisco la label nella list degli oggetti othe.insert(0, [labe]) # inserisco la label in testa alla box #child, expand=True, fill=True, padding=0 obje.pack_start(labe, False, False, 0) obje.reorder_child(labe, 0) # <- return obje, othe