Ejemplo n.º 1
0
    def __init__(self, x):
        LabelFrame.__init__(self, x)
#        self.default_font = tkFont.nametofont("TkDefaultFont")
#        self.default_font.configure(family="Helvetica",size=10)

        self.config(relief=GROOVE)
        self.config(borderwidth=2)
        self.config(text = "Up Time")
        self.config(labelanchor = "n")
        
        self.Hsv = StringVar()
        self.Hsv.set("")
        self.Hlabel = Label(self, textvariable = self.Hsv)
        self.Hlabel.grid(row=0, column=0, sticky="wens")
        self.Hlabel.config(font=("Courier", 14))
        
        self.Msv = StringVar()
        self.Msv.set("")
        self.Mlabel = Label(self, textvariable = self.Msv)
        self.Mlabel.grid(row=1, column=0, sticky="wens")
        self.Mlabel.config(font=("Courier", 14))
        
        self.Ssv = StringVar()
        self.Ssv.set("")
        self.Slabel = Label(self, textvariable = self.Ssv)
        self.Slabel.grid(row=2, column=0, sticky="wens")
        self.Slabel.config(font=("Courier", 14))

        self.pack()
Ejemplo n.º 2
0
    def __init__(self, master, text="Position", **options):
        LabelFrame.__init__(self, master, text=text, **options)
        self.tracker = master.tracker

        self.listbox = Listbox(self)
        self.listbox.widget.configure(selectmode=SINGLE)
        self.listbox.grid(row=0, column=0, rowspan=6)

        self.name_frame = LabelFrame(self, text="Name")
        self.name_field = Entry(self.name_frame)
        self.name_field.grid()
        self.name_frame.grid(row=0, column=1)

        self.save_button = Button(self, text="Save current",
                                  command=bg_caller(self.save_position))
        self.save_button.grid(row=1, column=1)
        self.go_to_button = Button(self, text="Go to",
                                   command=bg_caller(self.go_to_position))
        self.go_to_button.grid(row=2, column=1)
        self.delete_button = Button(self, text="Delete",
                                    command=self.delete_position)
        self.delete_button.grid(row=3, column=1)
        self.write_button = Button(self, text="Write to file",
                                   command=self.write_to_file)
        self.write_button.grid(row=4, column=1)
        self.load_button = Button(self, text="Load from file",
                                   command=self.load_from_file)
        self.load_button.grid(row=5, column=1)
    def __init__(self, master, tracker, text="Joystick", **options):
        LabelFrame.__init__(self, master, text=text, **options)
        self.tracker = tracker

        self.width = 400
        self.height = 400
        self.canvas = Canvas(self, height=self.height, width=self.width)
        self.canvas.grid()
        self.canvas.create_oval((self.width/2 - 3, self.height/2 - 3,
                                 self.width/2 + 3, self.height/2 + 3))
        self.canvas.bind("<Button-1>",
                         bg_caller(lambda event: self.move_tracker(event)))
        self.canvas.bind("<Motion>", self.update_label)

        self.motion_label = Label(self, text="",
                                  font=tkFont.Font(family="Courier"))
        self.motion_label.grid()

        f = LabelFrame(self, text="Sensitivity")
        self.sensitivity_scale = Scale(f, from_=0, to=10,
                                       resolution=0.01,
                                       orient=HORIZONTAL,
                                       length=self.width)
        self.sensitivity_scale.set(5)
        self.sensitivity_scale.grid()
        f.grid()
Ejemplo n.º 4
0
    def __init__(self, x):
        LabelFrame.__init__(self, x)       
#        self.default_font = tkFont.nametofont("TkDefaultFont")
#        self.default_font.configure(family="Helvetica",size=12)
        self.config(relief=GROOVE)
        self.config(borderwidth=2, padx=5, pady=5)
        self.config(text = "Encoder")
        self.config(labelanchor = "n")

        self.INSTRUCTION = StringVar()
        self.INSTRUCTION.set("Instruction")
        
        self.machinecode = StringVar()
        self.machinecode.set("")

        self.codeEntry = Entry(self, textvariable=self.INSTRUCTION)

        #self.codeEntry.configure(font=("Helvetica", 12), width=40)
        self.codeEntry.configure(width=40)

        self.codeButton = Button(self, text="Compile")

        self.VHPL = Label(self, text="VHPL")

        self.codeButton.grid(row=0, column=0, rowspan=4, sticky="wens")

        self.VHPL.grid(row=0, column=1, sticky="wens")
        self.VHPL.config(relief=GROOVE, borderwidth=2)
        
        self.codeEntry.grid(row=1, column=1, sticky="wens")
        self.codeEntry.config(fg="green", bg="black")
        
        self.pack()
Ejemplo n.º 5
0
	def __init__(self, root, prtr, settings, log, *arg):
		LabelFrame.__init__(self, root, *arg, text="Send gcode")
		self.app = root
		self.printer = prtr
		self.settings = settings
		self.log = log

		self.entry = Entry(self, width=50)
		self.entry.grid(row=1, column=1, columnspan=3, sticky=N+E+W)
		
		self.bSend = Button(self, text="Send", width=4, command=self.doSend, state=DISABLED)
		self.bSend.grid(row=1, column=4, padx=2)
		
		self.entry.delete(0, END)
		
		self.entry.bind('<Return>', self.hitEnter)
		self.gcv = StringVar(self)
		
		gclist = gcoderef.gcKeys()
		self.gcv.set(gclist[0])

		l = Label(self, text="G Code Reference:", justify=LEFT)
		l.grid(row=2, column=1, columnspan=2, sticky=W)

		self.gcm = Combobox(self, textvariable=self.gcv)
		self.gcm['values'] = gclist
		self.gcm.grid(row=2, column=3, padx=2)
		
		self.gcm.bind('<<ComboboxSelected>>', self.gcodeSel)
Ejemplo n.º 6
0
	def __init__(self, root, prtr, settings, log, *arg):
		LabelFrame.__init__(self, root, *arg, text="Extruder")
		self.app = root
		self.printer = prtr
		self.settings = settings
		self.log = log

		self.bExtrude = Button(self, text="Extrude", width=10, command=self.doExtrude)
		self.bExtrude.grid(row=1, column=1, padx=2)
		
		self.spDistance = Spinbox(self, from_=1, to=MAXDIST, width=6, justify=RIGHT)
		self.spDistance.grid(row=1, column=2)
		self.spDistance.delete(0, END)
		self.spDistance.insert(0, STARTDIST)
		self.spDistance.bind("<FocusOut>", self.valDistance)
		self.spDistance.bind("<Leave>", self.valDistance)

		l = Label(self, text="mm", justify=LEFT)
		l.grid(row=1, column=3, sticky=W)

		self.bReverse = Button(self, text="Reverse", width=10, command=self.doReverse)
		self.bReverse.grid(row=2, column=1, padx=2)
		
		self.spSpeed = Spinbox(self, from_=1, to=MAXFEED, width=6, justify=RIGHT)
		self.spSpeed.grid(row=2, column=2)
		self.spSpeed.delete(0, END)
		self.spSpeed.insert(0, self.settings.efeed)
		self.spSpeed.bind("<FocusOut>", self.valSpeed)
		self.spSpeed.bind("<Leave>", self.valSpeed)

		l = Label(self, text="mm/min", justify=LEFT)
		l.grid(row=2, column=3, sticky=W)
Ejemplo n.º 7
0
	def __init__(self, root, *arg):
		LabelFrame.__init__(self, root, *arg, text="Log")
		self.log = Text(self, width=60, height=24, state=DISABLED, wrap=WORD, takefocus="0")
		self.log.grid(row=1, column=1, sticky=N+E+W+S)
		
		self.sblog = Scrollbar(self, command=self.log.yview, orient="vertical")
		self.sblog.grid(column=2, row=1, sticky=N+S+E)
		self.log.config(yscrollcommand=self.sblog.set)
Ejemplo n.º 8
0
 def __init__(self, **kwargs):
     master = None if 'master' not in kwargs else kwargs['master']
     LabelFrame.__init__(self, master, text='Output Options')
     self.config(padx=20, pady=5)
     self.cadences = CadenceEntry()
     self.cadences.grid(row=0, column=0, sticky=W, in_=self)
     self.velocity = VelocitySelect()
     self.velocity.grid(row=1, column=0, sticky=W, in_=self)
Ejemplo n.º 9
0
    def __init__(self, x):
        LabelFrame.__init__(self, x)
#        self.default_font = tkFont.nametofont("TkDefaultFont")
#        self.default_font.configure(family="Helvetica",size=10)        
        self.config(relief=GROOVE)
        self.config(borderwidth=2)
        self.config(text="Decoder")
        self.mkButtons()
Ejemplo n.º 10
0
 def __init__(self, **kwargs):
     master = None if 'master' not in kwargs else kwargs['master']
     LabelFrame.__init__(self, master, text='Wheel')
     self.unitopts = ['%s (%s)' % (x.name, x.symbol)
                      for x in WheelEntry.DIA_UNITS]
     self.__val = WheelEntry.DIA_UNITS[0]
     self.createSpin()
     self.create_unit_opts()
Ejemplo n.º 11
0
 def __init__(self, **kwargs):
     master = None if 'master' not in kwargs else kwargs['master']
     LabelFrame.__init__(self, master, text='Output Options')
     self.config(padx=20, pady=5)
     self.cadences = CadenceEntry()
     self.cadences.grid(row=0, column=0, sticky=W, in_=self)
     self.velocity = VelocitySelect()
     self.velocity.grid(row=1, column=0, sticky=W, in_=self)
Ejemplo n.º 12
0
 def __init__(self, **kwargs):
     master = None if 'master' not in kwargs else kwargs['master']
     LabelFrame.__init__(self, master, text='Wheel')
     self.unitopts = [
         '%s (%s)' % (x.name, x.symbol) for x in WheelEntry.DIA_UNITS
     ]
     self.__val = WheelEntry.DIA_UNITS[0]
     self.createSpin()
     self.create_unit_opts()
Ejemplo n.º 13
0
 def __init__(self, parent, **kwargs):
     """!
     The constructor for the class
     @param self The pointer for the object
     @param parent The parent object for the frame
     @param **kwargs Other arguments as accepted by Tkinter.Frame
     """
     LabelFrame.__init__(self, parent, **kwargs)
     self.configure(background=DEFAULT_BACKGROUND)
Ejemplo n.º 14
0
 def __init__(self, win, title):
     LabelFrame.__init__(self, win)
     self["text"] = title
     self.content_view = Label(
         self,
         justify=Tkinter.LEFT,
         anchor="nw",
     )
     self.content_view.pack(side="top", padx=15, pady=15)
Ejemplo n.º 15
0
 def __init__(self, win, title, content):
     LabelFrame.__init__(self, win)
     self["text"] = title
     self.content_view = Label(self,
                               justify=Tkinter.LEFT,
                               anchor="w",
                               text=content)
     self.content_view.pack(side="top", fill=Tkinter.X, padx=15, pady=2)
     self.pack(side="top", fill=Tkinter.X, padx=10, pady=12)
Ejemplo n.º 16
0
    def __init__(self, master, text="Modes", **options):
        LabelFrame.__init__(self, master, text=text, **options)
        self.tracker = master.tracker

        self.mode_menu = OptionMenu(self, (tracker.IFM_SET_BY_ADM,
                                           tracker.IFM, tracker.ADM))
        self.mode_menu.grid(row=0, column=0)
        self.set_mode_button = Button(self, text="Set mode",
                                      command=bg_caller(self.set_mode))
        self.set_mode_button.grid(row=0, column=1)
    def __init__(self, master, names, parsers={}, **kwargs):
        LabelFrame.__init__(self, master, **kwargs)

        entries = {}
        for name in names:
            f = LabelFrame(self, text=name)
            entries[name] = Entry(f)
            entries[name].grid()
            f.grid()

        NamedEntryContainer.__init__(self, entries=entries, parsers=parsers)
Ejemplo n.º 18
0
 def __init__(self, **kwargs):
     master = None if 'master' not in kwargs else kwargs['master']
     title = None if 'title' not in kwargs else kwargs['title']
     rings = [] if 'rings' not in kwargs else kwargs['rings']
     LabelFrame.__init__(self, master, text=title)
     self.config(padx=20, pady=5)
     self.rings = []
     self.addbut = Button(text='+', command=self.userAddRing)
     for ring in rings:
         self.addRing(ring)
     self.renderRings()
Ejemplo n.º 19
0
 def __init__(self, **kwargs):
     master = None if 'master' not in kwargs else kwargs['master']
     title = None if 'title' not in kwargs else kwargs['title']
     rings = [] if 'rings' not in kwargs else kwargs['rings']
     LabelFrame.__init__(self, master, text=title)
     self.config(padx=20, pady=5)
     self.rings = []
     self.addbut = Button(text='+', command=self.userAddRing)
     for ring in rings:
         self.addRing(ring)
     self.renderRings()
Ejemplo n.º 20
0
    def __init__(self,parent,container,show,active=False,*args,**kwargs):
        LabelFrame.__init__(self,parent,*args,**kwargs)
        # self.items = container.__dict__[show]
        self.active = active
        self.parent = parent
        self.frames = []
        self.show = show
        self.container = container

        self.analyzeData()
        self.initUIElements()
        self.gridUIElements()
Ejemplo n.º 21
0
    def __init__(self, x):
        LabelFrame.__init__(self, x)       
#        self.default_font = tkFont.nametofont("TkDefaultFont")
#        self.default_font.configure(family="Helvetica",size=12)
        self.config(relief=GROOVE)
        self.config(borderwidth=2, padx=5, pady=5)
        self.config(text = "Information")
        self.config(labelanchor = "n")

        self.readmeButton = Button(self, text="README", fg="red")
        self.readmeButton.grid(row=0, column=0, sticky="wens")

        self.pack()
Ejemplo n.º 22
0
    def __init__(self, master=None):
        LabelFrame.__init__(self, master, text="")
        self.master.title("Memory Game")
        self.master.geometry("400x300")
        #self.master.resizable(0,0)
        self.pack(fill="both", expand="yes")

        # Easy level selector
        easylevel = Button(master, text="Easy Level", command=self.levelEasy)
        easylevel.pack()

        # Hard level selector
        hardlevel = Button(master, text="Hard Level", command=self.levelHard)
        hardlevel.pack()
Ejemplo n.º 23
0
	def __init__(self, root, prtr, settings, log, *arg):
		fn = os.path.join(settings.cmdFolder, "images", "control_xyz.png")
		self.image = Image.open(fn)
		self.photo = ImageTk.PhotoImage(self.image)
		LabelFrame.__init__(self, root, *arg, text="Movement")

		self.app = root
		self.hilite = None
		self.hilitemask = None
		self.settings = settings
		self.printer = prtr
		self.log = log
		
		l = Label(self, text="mm/min")
		l.grid(row=1, column=2)
		
		l = Label(self, text="X/Y Feed Rate:")
		l.grid(row=2, column=1, sticky=E)
		
		self.xyfeed = Spinbox(self, width=10, justify=RIGHT, from_=0, to=MAXFEED)
		self.xyfeed.grid(row=2, column=2)
		self.xyfeed.delete(0, END)
		self.xyfeed.insert(0, settings.xyfeed)
		self.xyfeed.bind("<FocusOut>", self.valxyFeed)
		self.xyfeed.bind("<Leave>", self.valxyFeed)
		
		l = Label(self, text="Z Feed Rate:")
		l.grid(row=3, column=1, sticky=E)
				
		self.zfeed = Spinbox(self, width=10, justify=RIGHT, from_=0, to=MAXFEED)
		self.zfeed.grid(row=3, column=2)
		self.zfeed.delete(0, END)
		self.zfeed.insert(0, settings.zfeed)
		self.zfeed.bind("<FocusOut>", self.valzFeed)
		self.zfeed.bind("<Leave>", self.valzFeed)
		
		self.canvas = Canvas(self, width=self.image.size[0], height=self.image.size[1], *arg)
		self.canvas.create_image((0, 0), image=self.photo, anchor=N+W)
		self.canvas.grid(row=4, column=1, columnspan=2)
		for m in imageMasks:
			self.canvas.create_oval((m[0][0]-mask_rad, m[0][1]-mask_rad, m[0][0]+mask_rad, m[0][1]+mask_rad),
							outline="#FF0000", width=4, tags=m[1], state=HIDDEN)
		self.canvas.bind("<Button-1>", self.OnLeftDown)
		self.canvas.bind("<Motion>", self.OnMotion)
		self.canvas.bind("<Enter>", self.OnEnter)
		self.canvas.bind("<Leave>", self.OnLeave)
		
		self.bAllOff = Button(self, text="Release Motors", command=self.allMotorsOff)	
		self.bAllOff.grid(row=5, column=1, columnspan=2)
Ejemplo n.º 24
0
    def __init__(self, x):
        LabelFrame.__init__(self, x)
#        self.default_font = tkFont.nametofont("TkDefaultFont")
#        self.default_font.configure(family="Helvetica",size=10)
        self.config(relief=GROOVE)
        self.config(borderwidth=2)
        self.config(text = "ALU")
        self.config(labelanchor = "n")
        self.RANGE = range(8)
        self.mkLOAD()
        self.mkTagLabels()
        self.mkRegisters()
        self.mkRegisterLabels()
        self.addColor()
        self.pack()
Ejemplo n.º 25
0
    def __init__(self, master, text="Movement", **options):
        LabelFrame.__init__(self, master, text=text, **options)
        self.listbox = master.listbox
        self.board = master.board

        self.micron_frame = NamedEntryFrame(self, ("Microns",),
                                            parsers={"Microns": float})
        self.micron_frame.grid(row=0, column=0, columnspan=2)

        self.move_button = Button(self, text="Move",
                                  command=bg_caller(self.move_actuators))
        self.move_button.grid(row=1, column=0)
        self.move_absolute_button = Button(self, text="Move absolute",
                                           command=bg_caller(self.move_absolute))
        self.move_absolute_button.grid(row=1, column=1)
Ejemplo n.º 26
0
 def __init__(self, root=None,
              label='MyTank',
              clb=None):
     LabelFrame.__init__(self,
                         master=root,
                         text = label,
                         border=3,
                         relief='raised',
                         font='Consolas 12 bold')
     self.pack(side='top', fill='x')
     
     self.kvAtak = clsFrmKeyValue(root=self, key='Атака', value=0, clb=clb)
     self.kvBron = clsFrmKeyValue(root=self, key='Броня', value=0, clb=clb)
     self.kvToch = clsFrmKeyValue(root=self, key='Точность', value=0, clb=clb)
     self.kvProch = clsFrmKeyValue(root=self, key='Прочность', value=0, clb=clb)
     self.kvMosh = clsFrmKeyValue(root=self, key='[Мощность]', value=0, clb=clb)
Ejemplo n.º 27
0
    def __init__(self, master, text="Basic commands", **options):
        LabelFrame.__init__(self, master, text=text, **options)
        self.tracker = master.tracker

        self.initialize_button = Button(self, text="Initialize",
                                        command=bg_caller(self.initialize))
        self.initialize_button.grid(row=0, column=0)
        self.measure_button = Button(self, text="Measure once",
                                     command=bg_caller(self.measure))
        self.measure_button.grid(row=0, column=1)
        self.abort_button = Button(self, text="Abort",
                                   command=self.abort)
        self.abort_button.grid(row=1, column=0)
        self.home_button = Button(self, text="Home",
                                  command=bg_caller(self.home))
        self.home_button.grid(row=1, column=1)
Ejemplo n.º 28
0
 def __init__(self, root=None,
              label='MyTank',
              tank=None):
     LabelFrame.__init__(self,
                         master=root,
                         text = label,
                         border=3,
                         relief='raised',
                         font='Consolas 12 bold')
     self.pack(side='top', fill='y')
     
     self.kvAtak = ClsKeyValue(root=self, key='Атака', value=tank[0])
     self.kvBron = ClsKeyValue(root=self, key='Броня', value=tank[1])
     self.kvBron = ClsKeyValue(root=self, key='Точность', value=tank[2])
     self.kvBron = ClsKeyValue(root=self, key='Прочность', value=tank[3])
     self.kvMosh = ClsKeyValue(root=self, key='Мощность*', value='?')
Ejemplo n.º 29
0
    def __init__(self, x):
        LabelFrame.__init__(self, x)
#        self.default_font = tkFont.nametofont("TkDefaultFont")
#        self.default_font.configure(family="Helvetica",size=10)
        self.config(relief=GROOVE)
        self.config(borderwidth=2)
        self.config(text = "16 bit Address Bus")
        self.config(labelanchor = "n")

        self.AB = []
        self.ABbuttons = []

        for i in range(16):
            self.AB.append(self.mkStringVar("0"))
            self.ABbuttons.append(Button(self, textvariable=self.AB[i]))
            self.ABbuttons[i].grid(row=0, column=i)
            
        self.pack()
Ejemplo n.º 30
0
    def __init__(self, master, tracker, text="Tracker",
                 *args, **kwargs):
        LabelFrame.__init__(self, master, text=text, *args, **kwargs)
        self.tracker = tracker

        self.command_frame = CommandFrame(self)
        self.command_frame.grid(row=0, column=0)

        self.mode_frame = ModeFrame(self)
        self.mode_frame.grid(row=1, column=0)

        self.movement_frame = MovementFrame(self)
        self.movement_frame.grid(row=2, column=0)

        self.position_frame = PositionFrame(self)
        self.position_frame.grid(row=0, column=1, rowspan=3)

        self.rowconfigure(0, weight=1)
        self.columnconfigure(0, weight=1)
Ejemplo n.º 31
0
    def __init__(self,parent,data,active=False,listFrame=None,*args,**kwargs):
        LabelFrame.__init__(self,parent,*args,**kwargs)
        self.data = data
        self.multiple = False
        if active:
            if type(self.data) == list:
                self.data = dict([(d.__class__.__name__,deepcopy(d)) \
                                  for d in self.data])
                for d in self.data.values():
                    if hasattr(d,"fake"):
                        d.fake = True
                self.multiple = True
            else:
                self.data = deepcopy(data)
                if hasattr(self.data,"fake"):
                    self.data.fake = True
        self.fields = OrderedDict()
        self.parent = parent
        self.listFrame = listFrame
        self.active = active
        self.mappings = {}
        self.typeDict = {}
        self.differs = False
        self.add = None
        self.apply = None
        self.delete = None

        self.classDict = dict([\
                                (str,Entry),\
                                (unicode,Entry),\
                                (MaterialColor,ColorOption),\
                                (list,Entry),\
                                (Mapping,MapFrame),
                                (FileGroup,FileFrame)\
                             ])

        """
                                {GuiClass:(args,kwargsKeys)} - mostly value=...
        """
        self.analyzeData()
        self.initUIElements()
        self.gridUIElements()
Ejemplo n.º 32
0
    def __init__(self, x):
        LabelFrame.__init__(self, x)
#        self.default_font = tkFont.nametofont("TkDefaultFont")
#        self.default_font.configure(family="Helvetica",size=10)         
        self.config(relief=GROOVE)
        self.config(borderwidth=2)
        self.config(text = "Testing")
        self.config(labelanchor = "n")

        self.loadPGMbutton = Button(self, text="Load PGM")
        self.loadPGMbutton.grid(row=0, column=0)
        
        self.filenameVar = StringVar()
        self.filenameVar.set("*****.pgm")
        
        self.fileNameLabel = Label(self, textvariable=self.filenameVar)
        self.fileNameLabel.config(relief=GROOVE, borderwidth=2, width=18)
        self.fileNameLabel.grid(row=0, column=1)

        self.pack()
Ejemplo n.º 33
0
    def __init__(self, master, text="Movement", **options):
        LabelFrame.__init__(self, master, text=text, **options)
        self.tracker = master.tracker

        self.coordinate_frame = NamedEntryFrame(self, ("Radius", "Theta",
                                                       "Phi"),
                                                parsers={"Radius": float,
                                                         "Theta": float,
                                                         "Phi": float})
        self.coordinate_frame.grid(row=0, column=0, rowspan=3)

        self.search_button = Button(self, text="Search",
                                    command=bg_caller(self.search))
        self.search_button.grid(row=0, column=1)
        self.move_button = Button(self, text="Move",
                                  command=bg_caller(self.move_tracker))
        self.move_button.grid(row=1, column=1)
        self.move_absolute_button = Button(self, text="Move (absolute)",
                                           command=bg_caller(self.move_absolute))
        self.move_absolute_button.grid(row=2, column=1)
    def __init__(self, master, tracker, text="Repositioning", **kwargs):
        LabelFrame.__init__(self, master, text=text, **kwargs)
        self.tracker = tracker

        self.source_selector = FileSelectionFrame(self, initial_dir=nodes_dir,
                                                  ask_mode="open",
                                                  text="Source")
        self.source_selector.grid(row=0, column=0)
        self.dest_selector = FileSelectionFrame(self, initial_dir=nodes_dir,
                                                ask_mode="save", text="Dest")
        self.dest_selector.grid(row=0, column=1)

        # The names and positions we gather:
        self.name_fields = []
        self.posn_labels = []
        self.training_info = []

        for i in range(3):
            # Why three? Well, we need three training points to figure
            # out where all the other points are. Proof: take your
            # fist and move it around (it's a rigid structure, like
            # the arrangement of retroreflectors), and think about how
            # many points (e.g. knuckles) you'd need to know the
            # positions of to figure out the positions of all your
            # other knuckles.  (It's three. If you disagree, please
            # think about it more until you agree, because I am
            # absolutely confident.)
            f = LabelFrame(self, text="(Name/position) ({})".format(i))
            self.name_fields.append(Entry(f))
            self.name_fields[-1].grid(row=0, column=0)
            self.posn_labels.append(Label(f, text="<None>"))
            self.posn_labels[-1].grid(row=0, column=1)
            b = Button(f, text="Set",
                       command=bg_caller(deglobalize_args(self.set_position,
                                                          i)))
            b.grid(row=0, column=2)
            f.grid(row=1+i, column=0, columnspan=2)
            self.training_info.append(None)

        Button(self, text="Compute/Save", command=self.save).grid(row=4,
                                                                  column=0)
Ejemplo n.º 35
0
    def __init__(self, x):
        LabelFrame.__init__(self, x)
#        self.default_font = tkFont.nametofont("TkDefaultFont")
#        self.default_font.configure(family="Helvetica",size=10) 
        self.config(relief=GROOVE)
        self.config(borderwidth=2)
        self.config(text = "Inside VH's Head")
        self.config(labelanchor = "n")
    
        self.text = Text(self, height=22, width=85)
        self.text.configure(font=("Courier", 11, "bold"), bg="black", fg="green")

        self.scroll = Scrollbar(self, command=self.text.yview)

        self.text.configure(yscrollcommand=self.scroll.set)

        self.text.pack(side=LEFT, padx=3, pady=2)

        self.scroll.pack(side=RIGHT, fill=Y, padx=3, pady=2)

        self.pack(padx=4, pady=4)
Ejemplo n.º 36
0
    def __init__(self, win, movie):
        LabelFrame.__init__(self, win)
        self["bd"] = 2
        self.movie = movie
        self.image_view = ImageView(
            self, self.movie.getImage(),
            config.getWindowSize("movie_poster_width"),
            config.getWindowSize("movie_poster_height"), movie.isSelected())
        self.image_view.pack(side=Tkinter.LEFT, ipadx=6, ipady=6)
        self.info_view = InfoTextView(self)\
                .setTitle(self.movie.getTitle())\
                .addContent(self.movie.getOriginalTitle())\
                .addContent(self.movie.getRating())\
                .addContent(self.movie.getDirector())\
                .addContent(self.movie.getGenres())\
                .addContent(self.movie.getYear())\
                .setWebUrl(self.movie.getWebUrl())
        self.info_view.pack(side=Tkinter.LEFT, ipadx=6)

        self.info_view.selected_label.bind("<Button-1>", self.doSelectClick)
        self.refreshSelected()