示例#1
0
def testEntFraList(debu=0):
    #myEntFraList
    # ridefinisco la callback
    def on_activate(widg, ind, *data):
        print "b", "%05s" % widg.get_text(), ind, data

    # xBox, [fram, [labe, xBox, entr, call]] * N
    obje, othe = myEntFraList(name=["One", "Two", "Three"],
                              numb=None,
                              call=on_activate,
                              data=[],
                              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])
    #myFrame
    # fram,[labe,xBox]
    obj1, oth1 = myFrame(name='myEntryFrame',
                         obje=obje,
                         colo='black',
                         bord=2,
                         shad=Gtk.SHADOW_ETCHED_OUT,
                         tBox='v')
    #debug
    myViewObject(obje, othe)
    # <-
    return obj1
示例#2
0
def testChkButton():
    #myChkButton
    # ridefinisco la callback
    def on_clicked(widg, name, *data):
        ena = widg.get_active()
        print "b) %s is %s" % (name, ("OFF", "ON")[ena])

    # butt, call
    obje, othe = myChkButton(
        name='my_ChkButton',
        valu=True,
        colo='black',
        # call= on_clicked, data=['myCheck',])
        call=None,
        data=[
            'myCheck',
        ])
    #myFrame
    # fram,[labe,xBox]
    obj1, oth1 = myFrame(name='prova',
                         obje=obje,
                         colo='black',
                         bord=2,
                         shad=Gtk.SHADOW_ETCHED_OUT,
                         tBox='v')
    #debug
    myViewObject(obje, [othe])
    # <-
    return obj1
示例#3
0
def testLabList():
    #myLabList
    # xBox, [labe, None] * N
    obje, othe = myLabList(name=["Read", "Write", "Default"],
                           leng=7,
                           prea=' ',
                           post=':',
                           font='Courier 10',
                           colo='brown',
                           tBox='v',
                           aBox=[False, False, 1])
    # cambio colore alla seconda label
    othe[1][0].modify_fg(Gtk.STATE_NORMAL, Gdk.color_parse("green"))
    #myFrame
    # fram,[labe,xBox]
    obj1, oth1 = myFrame(name='myLabel',
                         obje=obje,
                         colo='black',
                         bord=2,
                         shad=Gtk.SHADOW_ETCHED_OUT,
                         tBox='v')
    #debug
    myViewObject(obje, othe)
    # <-
    return obj1
示例#4
0
def testButList():
    #myButList
    # ridefinisco la callback
    def on_clicked(widg, ind, *data):
        print "b", ind, data

    # xBox, [butt,call] * N
    obje, othe = myButList(name=["_Read", "_Write", "_Default"],
                           icon=Gtk.STOCK_NO,
                           call=on_clicked,
                           data=[],
                           tBox='v',
                           aBox=[False, False, 1])
    # abilito la vista dell'icona che di default è nascosta
    othe[0][0].set_always_show_image(True)
    othe[1][0].set_always_show_image(True)
    othe[2][0].set_always_show_image(True)
    # cambio icona ad alcuni bottoni
    othe[0][0].props.image = Gtk.Image.new_from_stock(Gtk.STOCK_YES,
                                                      Gtk.ICON_SIZE_BUTTON)
    othe[1][0].props.image = Gtk.Image.new_from_stock(Gtk.STOCK_STOP,
                                                      Gtk.ICON_SIZE_BUTTON)
    #myFrame
    # fram,[labe,xBox]
    obj1, oth1 = myFrame(name='myButton',
                         obje=obje,
                         colo='black',
                         bord=2,
                         shad=Gtk.SHADOW_ETCHED_OUT,
                         tBox='v')
    #debug
    myViewObject(obje, othe)
    # <-
    return obj1
示例#5
0
def testEntList():
    #myEntList
    # ridefinisco la callback
    def on_activate(widg, ind, *data):
        pass
        print "b", "%05s" % widg.get_text(), ind, data

    # xBox, [entr, call] * N
    obje, othe = myEntList(name=["One", "Two", "Three"],
                           numb=6,
                           call=on_activate,
                           data=[],
                           tBox='h',
                           aBox=[False, False, 1])
    #myFrame
    # fram,[labe,xBox]
    obj1, oth1 = myFrame(name='myEntry',
                         obje=obje,
                         colo="black",
                         bord=2,
                         shad=Gtk.SHADOW_ETCHED_OUT,
                         tBox='v')
    #debug
    myViewObject(obje, othe)
    # <-
    return obj1
示例#6
0
def testChkButList():
    #myChkButton
    # ridefinisco la callback
    def on_clicked1(widg, ind, *data):
        ena = widg.get_active()
        print "%05s" % widg.props.label.replace('_', ''), "is", ("OFF",
                                                                 "ON")[ena]

    # xBox, [butt, call] * N
    obje, othe = myChkButList(name=["Uno", "Due", "Tre"],
                              valu=False,
                              colo=None,
                              call=on_clicked1,
                              data=['uffi'],
                              tBox='h',
                              aBox=[False, False, 1])
    #myFrame
    # fram,[labe,xBox]
    obj1, oth1 = myFrame(name='myButton',
                         obje=obje,
                         colo='black',
                         bord=2,
                         shad=Gtk.SHADOW_ETCHED_OUT,
                         tBox='v')
    #debug
    myViewObject(obje, othe)
    # <-
    return obj1
示例#7
0
def testRadButList():
    #myRadButton
    # ridefinisco la callback
    def on_clicked(widg, ind, *data):
        ena = widg.get_active()
        if ena:
            print "b", "%05s" % widg.props.label.replace('_', ''),
            print ind, data

    # xBox, [butt,call] * N
    obje, othe = myRadButList(name=["One", "Two", "Three"],
                              chil=None,
                              valu=1,
                              call=on_clicked,
                              data=[],
                              tBox='h',
                              aBox=[False, False, 1])
    #myFrame
    # fram,[labe,xBox]
    obj1, oth1 = myFrame(name='select',
                         obje=obje,
                         colo='black',
                         bord=2,
                         shad=Gtk.SHADOW_ETCHED_OUT,
                         tBox='v')
    #debug
    myViewObject(obje, othe)
    # <-
    return obj1
示例#8
0
def testRadButton():
    #radButton
    # ridefinisco la callback
    def on_clicked(widg, *data):
        # descrivo solo quello attivato
        try:
            if widg.get_active():
                print data[0]
        except:
            pass

    # butt, call
    obje, othe = myRadButton(name='primo',
                             chil=None,
                             valu=False,
                             call=on_clicked,
                             data=[
                                 'myRadio',
                             ])
    #myFrame
    # fram,[labe,xBox]
    obj1, oth1 = myFrame(name='myRadioButton',
                         obje=obje,
                         colo='black',
                         bord=2,
                         shad=Gtk.SHADOW_ETCHED_OUT,
                         tBox='v')
    #debug
    myViewObject(obje, [othe])
    # <-
    return obj1
示例#9
0
def testButList():
#myButList    
	# ridefinisco la callback
	def on_clicked(widg, ind, *data):
		print "b", ind, data
	# xBox, [butt,call] * N
	obje, othe = myButList(name=["_Read","_Write","_Default"], 
						   icon=Gtk.STOCK_NO,
						   call=on_clicked, data=[],
						   tBox='v', aBox=[False, False, 1])
	# abilito la vista dell'icona che di default è nascosta
	othe[0][0].set_always_show_image (True)    
	othe[1][0].set_always_show_image (True)    
	othe[2][0].set_always_show_image (True)    
	# cambio icona ad alcuni bottoni
	othe[0][0].props.image = Gtk.Image.new_from_stock(Gtk.STOCK_YES, Gtk.ICON_SIZE_BUTTON)
	othe[1][0].props.image = Gtk.Image.new_from_stock(Gtk.STOCK_STOP, Gtk.ICON_SIZE_BUTTON)
#myFrame    
	# fram,[labe,xBox]
	obj1, oth1 = myFrame(name='myButton', obje=obje, colo='black',
						 bord=2, shad=Gtk.SHADOW_ETCHED_OUT,
						 tBox='v' )
	#debug
	myViewObject(obje, othe)
# <-
	return obj1
示例#10
0
def testButFraList():
#myButFraList    
	# ridefinisco la callback
	def on_clicked(widg, ind, *data):
		print "b", ind, data
	# xBox, [fram, [labe, xBox, butt, call]] * N
	obje, othe = myButFraList(name=["Read","Write","Default"], 
							  nBut=["","",""], 
							  icon=Gtk.STOCK_NO,
							  call=on_clicked, data=[],
							  bFra=1, sFra=Gtk.SHADOW_ETCHED_OUT, 
							  tFra='v', aFra=[False, False, 1],
							  tBox='h', aBox=[False, False, 1])
	# abilito la vista dell'icona che di default è nascosta
	othe[0][1][2].set_always_show_image (True)    
	othe[1][1][2].set_always_show_image (True)    
	othe[2][1][2].set_always_show_image (True)    
	# cambio icona ad alcuni bottoni
	othe[0][1][2].props.image = Gtk.Image.new_from_stock(Gtk.STOCK_YES, Gtk.ICON_SIZE_BUTTON)
	othe[1][1][2].props.image = Gtk.Image.new_from_stock(Gtk.STOCK_YES, Gtk.ICON_SIZE_BUTTON)
	othe[2][1][2].props.image = Gtk.Image.new_from_stock(Gtk.STOCK_YES, Gtk.ICON_SIZE_BUTTON)

	#debug
	myViewObject(obje, othe)
# <-
	return obje
示例#11
0
def testButFraList():
    #myButFraList
    # ridefinisco la callback
    def on_clicked(widg, ind, *data):
        print "b", ind, data

    # xBox, [fram, [labe, xBox, butt, call]] * N
    obje, othe = myButFraList(name=["Read", "Write", "Default"],
                              nBut=["", "", ""],
                              icon=Gtk.STOCK_NO,
                              call=on_clicked,
                              data=[],
                              bFra=1,
                              sFra=Gtk.SHADOW_ETCHED_OUT,
                              tFra='v',
                              aFra=[False, False, 1],
                              tBox='h',
                              aBox=[False, False, 1])
    # abilito la vista dell'icona che di default è nascosta
    othe[0][1][2].set_always_show_image(True)
    othe[1][1][2].set_always_show_image(True)
    othe[2][1][2].set_always_show_image(True)
    # cambio icona ad alcuni bottoni
    othe[0][1][2].props.image = Gtk.Image.new_from_stock(
        Gtk.STOCK_YES, Gtk.ICON_SIZE_BUTTON)
    othe[1][1][2].props.image = Gtk.Image.new_from_stock(
        Gtk.STOCK_YES, Gtk.ICON_SIZE_BUTTON)
    othe[2][1][2].props.image = Gtk.Image.new_from_stock(
        Gtk.STOCK_YES, Gtk.ICON_SIZE_BUTTON)

    #debug
    myViewObject(obje, othe)
    # <-
    return obje
示例#12
0
def testChkButLisLabel():
    #myChkButLisLabel
    # ridefinisco la callback
    def on_clicked(widg, ind, *data):
        ena = widg.get_active()
        #print "b", widg, ind, idata
        print "%05s" % widg.props.label.replace('_', ''), "is", ("OFF",
                                                                 "ON")[ena]

    # xBox, [labe, [butt, call] * N]
    obje, othe = myChkButLisLabel(name=["One", "Two", "Three"],
                                  valu=False,
                                  colo=None,
                                  call=on_clicked,
                                  data=[],
                                  nLab='Label',
                                  cLab=None,
                                  tBox='h',
                                  aBox=[False, False, 1])
    #myFrame
    # fram,[labe,xBox]
    obj1, oth1 = myFrame(name='myButton',
                         obje=obje,
                         colo='black',
                         bord=2,
                         shad=Gtk.SHADOW_ETCHED_OUT,
                         tBox='v')
    #debug
    myViewObject(obje, othe)
    # <-
    return obj1
示例#13
0
def testEntLabList():
    #myEntLabList
    # ridefinisco la callback
    def on_activate(widg, ind, *data):
        print "b", "%05s" % widg.get_text(), ind, data

    # xBox, [xBox, [entr, call, labe]] * N
    obje, othe = myEntLabList(
        name=["One", "Two", "Three"],
        numb=6,
        call=on_activate,
        data=[],
        nLab=['Label01', 'Label02', 'Label03'],
        cLab="#333",
        tLab='h',
        aLab=[False, False, 1],
        tBox='v',
        aBox=[False, False, 1],
    )
    #myFrame
    # fram,[labe,xBox]
    obj1, oth1 = myFrame(name='myEntLabList',
                         obje=obje,
                         colo='black',
                         bord=2,
                         shad=Gtk.SHADOW_ETCHED_OUT,
                         tBox='v')
    #debug
    myViewObject(obje, othe)
    # <-
    return obj1
示例#14
0
def testLabList():
#myLabList    
    # xBox, [labe, None] * N
    obje, othe = myLabList(name=["Read","Write","Default"], 
                           leng=7, prea=' ', post=':', 
                           font='Courier 10', 
                           colo='brown',
                           tBox='v', aBox=[False, False, 1])
    # cambio colore alla seconda label
    othe[1][0].modify_fg(Gtk.STATE_NORMAL, Gdk.color_parse("green"))
#myFrame    
    # fram,[labe,xBox]
    obj1, oth1 = myFrame(name='myLabel', obje=obje, colo='black',
                         bord=2, shad=Gtk.SHADOW_ETCHED_OUT,
                         tBox='v' )
    #debug
    myViewObject(obje, othe)
# <-
    return obj1
示例#15
0
def testEntList():
#myEntList    
	# ridefinisco la callback
	def on_activate(widg, ind, *data):
		pass
		print "b", "%05s" %widg.get_text(), ind, data
	# xBox, [entr, call] * N
	obje, othe = myEntList(name=["One","Two","Three"], 
						   numb=6, 
						   call=on_activate, data=[],
						   tBox='h', aBox=[False, False, 1] )
#myFrame    
	# fram,[labe,xBox]
	obj1, oth1 = myFrame(name='myEntry', obje=obje, colo="black",
						 bord=2, shad=Gtk.SHADOW_ETCHED_OUT,
						 tBox='v' )
	#debug
	myViewObject(obje, othe)
# <-
	return obj1
示例#16
0
def testChkButton():
#myChkButton
	# ridefinisco la callback        
	def on_clicked(widg, name, *data):
		ena = widg.get_active()
		print "b) %s is %s" % (name, ("OFF", "ON")[ena])
	# butt, call
	obje, othe = myChkButton(name='my_ChkButton', 
							 valu=True, colo='black', 
							# call= on_clicked, data=['myCheck',])
							 call= None, data=['myCheck',])
#myFrame    
	# fram,[labe,xBox]
	obj1, oth1 = myFrame(name='prova', obje=obje, colo='black',
						 bord=2, shad=Gtk.SHADOW_ETCHED_OUT,
						 tBox='v' )
	#debug
	myViewObject(obje, [othe])
# <-
	return obj1
示例#17
0
def testChkButList():
#myChkButton    
	# ridefinisco la callback
	def on_clicked1(widg, ind, *data):
		ena = widg.get_active()
		print "%05s" %widg.props.label.replace('_',''), "is", ("OFF", "ON")[ena]
	# xBox, [butt, call] * N
	obje, othe = myChkButList(name=["Uno","Due","Tre"], 
							  valu=False, colo=None, 
							  call=on_clicked1, data=['uffi'],
							  tBox='h', aBox=[False, False, 1])
#myFrame    
	# fram,[labe,xBox]
	obj1, oth1 = myFrame(name='myButton', obje=obje, colo='black',
						 bord=2, shad=Gtk.SHADOW_ETCHED_OUT,
						 tBox='v' )
	#debug
	myViewObject(obje, othe)
# <-
	return obj1
示例#18
0
def testEntLabList():
#myEntLabList    
	# ridefinisco la callback
	def on_activate(widg, ind, *data):
		print "b", "%05s" %widg.get_text(), ind, data
	# xBox, [xBox, [entr, call, labe]] * N
	obje, othe = myEntLabList(name=["One","Two","Three"], 
							  numb=6, 
							  call=on_activate, data=[],
							  nLab=['Label01','Label02','Label03'], cLab="#333",
							  tLab='h', aLab=[False, False, 1],
							  tBox='v', aBox=[False, False, 1],)
#myFrame    
	# fram,[labe,xBox]
	obj1, oth1 = myFrame(name='myEntLabList', obje=obje, colo='black',
						 bord=2, shad=Gtk.SHADOW_ETCHED_OUT,
						 tBox='v' )
	#debug
	myViewObject(obje, othe)
# <-
	return obj1
示例#19
0
def testChkButLisLabel():
#myChkButLisLabel    
	# ridefinisco la callback
	def on_clicked(widg, ind, *data):
		ena = widg.get_active()
		#print "b", widg, ind, idata
		print "%05s" %widg.props.label.replace('_',''), "is", ("OFF", "ON")[ena]
	# xBox, [labe, [butt, call] * N]
	obje, othe = myChkButLisLabel(name=["One","Two","Three"], 
								  valu=False, colo=None, 
								  call=on_clicked, data=[],
								  nLab='Label', cLab=None,
								  tBox='h', aBox=[False, False, 1])
#myFrame    
	# fram,[labe,xBox]
	obj1, oth1 = myFrame(name='myButton', obje=obje, colo='black',
						 bord=2, shad=Gtk.SHADOW_ETCHED_OUT,
						 tBox='v' )
	#debug
	myViewObject(obje, othe)
# <-
	return obj1
示例#20
0
def testRadButList():
#myRadButton    
	# ridefinisco la callback
	def on_clicked(widg, ind, *data):
		ena = widg.get_active()
		if ena:
			print "b", "%05s" %widg.props.label.replace('_',''), 
			print ind, data 
	# xBox, [butt,call] * N
	obje, othe = myRadButList(name=["One","Two","Three"], 
							  chil=None, valu=1, 
							  call=on_clicked, data=[],
							  tBox='h', aBox=[False, False, 1])
#myFrame    
	# fram,[labe,xBox]
	obj1, oth1 = myFrame(name='select', obje=obje, colo='black',
						 bord=2, shad=Gtk.SHADOW_ETCHED_OUT,
						 tBox='v' )
	#debug
	myViewObject(obje, othe)
# <-
	return obj1
示例#21
0
def testEntFraList(debu=0):
#myEntFraList    
	# ridefinisco la callback
	def on_activate(widg, ind, *data):
		print "b", "%05s" %widg.get_text(), ind, data
	# xBox, [fram, [labe, xBox, entr, call]] * N        
	obje, othe = myEntFraList(name=["One","Two","Three"], 
							  numb=None, 
							  call=on_activate, data=[],
							  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])
#myFrame    
	# fram,[labe,xBox]
	obj1, oth1 = myFrame(name='myEntryFrame', obje=obje, colo='black',
						 bord=2, shad=Gtk.SHADOW_ETCHED_OUT,
						 tBox='v' )
	#debug
	myViewObject(obje, othe)
# <-
	return obj1
示例#22
0
def testRadButton():
#radButton
	# ridefinisco la callback        
	def on_clicked(widg, *data):
		# descrivo solo quello attivato
		try:
			if widg.get_active():
				print data[0]
		except:
			pass
	# butt, call
	obje, othe = myRadButton(name='primo', 
							chil=None, valu=False, 
							call= on_clicked, data=['myRadio',])
#myFrame    
	# fram,[labe,xBox]
	obj1, oth1 = myFrame(name='myRadioButton', obje=obje, colo='black',
						 bord=2, shad=Gtk.SHADOW_ETCHED_OUT,
						 tBox='v' )
	#debug
	myViewObject(obje, [othe])
# <-
	return obj1