当前位置: 首页>>代码示例>>Python>>正文


Python Treeview.heading方法代码示例

本文整理汇总了Python中ttk.Treeview.heading方法的典型用法代码示例。如果您正苦于以下问题:Python Treeview.heading方法的具体用法?Python Treeview.heading怎么用?Python Treeview.heading使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ttk.Treeview的用法示例。


在下文中一共展示了Treeview.heading方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from ttk import Treeview [as 别名]
# 或者: from ttk.Treeview import heading [as 别名]
    def __init__(self, parent, process, x, y):
        Toplevel.__init__(self, parent)
        self.wm_overrideredirect(True)
        self.wm_geometry("+%d+%d" % (x+25,y+20))
        label = Label(self, text="", justify='left',
                       background='white', relief='solid', borderwidth=1,
                       font=("times", "12", "normal"))
        label.pack(ipadx=20)
        tree = Treeview(label)
        tree["columns"] = ("value")
        tree.column("#0", minwidth=0, width=100)
        tree.column("#1", minwidth=0, width=100)
        tree.heading("#0", text="Name")
        tree.heading("#1", text="Value")

        for A, state in process.state.items():
            if isinstance(A, Algorithm):
                tree.insert("", 0, iid=A, text=str(A), values=("",))
                for key, val in state.items():
                    tree.insert(A, 0, text=key, values=(val,))
        for key, val in process.state.items():
            if not isinstance(key, Algorithm):
                tree.insert("", 0, text=key, values=(val,))
        tree.insert("", 0, text="UID", values=(process.UID,))
        tree.pack()
开发者ID:amin10,项目名称:datk,代码行数:27,代码来源:simulator_tk.py

示例2: show

# 需要导入模块: from ttk import Treeview [as 别名]
# 或者: from ttk.Treeview import heading [as 别名]
    def show(frame, iterator):
        """Выводит на экран выборку, заданную в iterator"""

        scrollbar = Scrollbar(frame)
        tree = Treeview(frame, selectmode='none', padding=3,
                                style='Custom.Treeview', height=REPORT_HEIGHT,
                                yscrollcommand=scrollbar.set)
        tree.pack(side=LEFT, fill=BOTH, expand=YES)
        scrollbar.config(command=tree.yview)
        scrollbar.pack(side=LEFT, fill=Y)

        tree.tag_configure('1', font=('Verdana', FONT_SIZE_REPORT))
        tree.tag_configure('2', font=('Verdana', FONT_SIZE_REPORT),
                                                           background='#f5f5ff')

        Style().configure('Custom.Treeview', rowheight=FONT_SIZE_REPORT*2)

        columns = ['#' + str(x + 1) for x in range(8)]
        tree.configure(columns=columns)

        for q in range(len(header)):
            tree.heading('#%d' % (q + 1), text=header[q], anchor='w')
            tree.column('#%d' % (q + 1), width=REPORT_SCALE * col_width[q + 1],
                                                                     anchor='w')
        tree.heading('#0', text='', anchor='w')
        tree.column('#0', width=0, anchor='w', minwidth=0)

        flag = True
        summ = 0
        for item in iterator:

            value = item.quantity * item.price * (100 - item.discount) / 100
            summ += value

            col = []
            col.append(add_s(item.check.id))
            col.append(add_s(item.goods.cathegory.name))
            col.append(add_s(item.goods.name))
            col.append(add_s(item.quantity))
            col.append(add_s(item.discount) +'%' if item.discount else ' -- ')
            col.append(add_s(u'%6.2f грн.' % value))
            col.append(add_s(item.check.date_time.strftime('%d.%m.%Y')))
            col.append(add_s(item.check.date_time.time())[:8])

            flag = not flag
            if flag:
                tree.insert('', 'end', text='', values=col, tag='2')
            else:
                tree.insert('', 'end', text='', values=col, tag='1')

        return summ
开发者ID:sychov,项目名称:conditer,代码行数:53,代码来源:report_make.py

示例3: FilamentReport

# 需要导入模块: from ttk import Treeview [as 别名]
# 或者: from ttk.Treeview import heading [as 别名]
class FilamentReport(Toplevel):
	def __init__(self, app, printer, settings, logger, *arg):
		self.app = app
		self.printer = printer
		self.settings = settings
		self.logger = logger
		
		layers = self.app.gcodeInfo.layerOrder
		usage = self.app.gcodeInfo.filLayers

		self.selection = None
		
		Toplevel.__init__(self, app, *arg)
		self.title("Layer by Layer Filament Usage")
		self.protocol("WM_DELETE_WINDOW", self.doCancel)

		f = Frame(self)
		f.grid(row=1, column=1, rowspan=1, padx=10)

		self.tree = Treeview(self, height=12, selectmode='browse')
		self.sb = Scrollbar(self)
		self.sb.config(command=self.tree.yview)
		self.tree.config(yscrollcommand=self.sb.set)

		ln = []
		for l in layerinfo:
			ln.append(l[0])
		del ln[0]
		self.tree.config(columns=ln)
		
		for l in layerinfo:
			self.tree.column(l[0], width=l[1], anchor=l[2])
			self.tree.heading(l[0], text=l[3])

		self.sb.pack(side=RIGHT, fill=Y)
		self.tree.pack(side=LEFT, fill=BOTH, expand=1)

		prev = 0.0	
		tl = layers[-1]
		total = usage[tl]		
		for l in layers:
			n = usage[l]
			self.tree.insert('', 'end', text=l, values=("%7.3f" % (n-prev), "%9.3f" % n, "%9.3f" % (total-n)))
			prev = n

	def doCancel(self):
		self.app.closeFilamentReport()
开发者ID:jbernardis,项目名称:repraphost,代码行数:49,代码来源:reports.py

示例4: CreateUI

# 需要导入模块: from ttk import Treeview [as 别名]
# 或者: from ttk.Treeview import heading [as 别名]
    def CreateUI(self):
        tv = Treeview(self)
        tv['columns'] = ('m_s_id', 's_id','s_para','no_of_coin')
        tv.heading("#0", text='Date', anchor='c')
        tv.column("#0", anchor="c")
        tv.heading('m_s_id', text='Miner ID')
        tv.column('m_s_id', anchor='center', width=100)
        tv.heading('s_id', text='Service ID')
        tv.column('s_id', anchor='center', width=100)
        tv.heading('s_para', text='Data')
        tv.column('s_para', anchor='center', width=100)
        tv.heading('no_of_coin', text='No Of Coin')
        tv.column('no_of_coin', anchor='center', width=100)
        tv.grid(sticky=(N, S, W, E))
        self.treeview = tv
        self.grid_rowconfigure(0, weight=1)
        self.grid_columnconfigure(0, weight=1)

        btn = Button(self, text=('Back'), command=self.back, width=10, background='red')
        btn.grid(sticky=(S + E))
开发者ID:umayanga123,项目名称:scpp_python_node,代码行数:22,代码来源:data_view.py

示例5: new_point

# 需要导入模块: from ttk import Treeview [as 别名]
# 或者: from ttk.Treeview import heading [as 别名]
    def new_point(self):
        window = Toplevel(self)
        tree = Treeview(window)
        tree["columns"]=("1","2","3","4","5")
        tree.column("1", width=50)
        tree.column("2", width=50)
        tree.column("3", width=50)
        tree.column("4", width=50)
        tree.column("5", width=50)
        tree.heading("1", text="Played")
        tree.heading("2", text="Won")
        tree.heading("3", text="Lost")
        tree.heading("4", text="Points")
        
        rows = cur.execute('''SELECT * FROM point_table ORDER BY points DESC''')
        c = 0
        for row in rows:        
            tree.insert("" , c,text=str(row[1]), values=(row[2],row[3],row[4],row[5]))
            c+=1

        tree.pack()
开发者ID:meetsha,项目名称:Twitter-IPL,代码行数:23,代码来源:guinewest.py

示例6: make_tree

# 需要导入模块: from ttk import Treeview [as 别名]
# 或者: from ttk.Treeview import heading [as 别名]
def make_tree( mainframe, directory ):
    logging.debug( "Creating a new tree" )
    tree = Treeview( mainframe, columns=( 'ins', 'outs' ) )

    logging.debug( "Packing the tree into the GUI. Adding columns and headings" )

    tree.grid( column=2, row=4 )
    tree.heading( "#0", text="Block" )
    tree.heading( 'ins', text='Inputs' )
    tree.heading( 'outs', text="Outputs" )

    # Set the width and alignment of the two columns
    tree.column( 'ins', width=60, anchor='center' )
    tree.column( 'outs', width=60, anchor='center' )

    logging.debug( "Filling the tree with directory: %s" % directory )
    codefiles = fill_tree( tree, directory )
    logging.debug( "Done filling tree" )

    return tree, codefiles
开发者ID:hardbyte,项目名称:scipy-sim,代码行数:22,代码来源:codegroup.py

示例7: WaitingRoom

# 需要导入模块: from ttk import Treeview [as 别名]
# 或者: from ttk.Treeview import heading [as 别名]
class WaitingRoom(cll.ClientListener, object): #Note: extending cll.ClientListener if Gui does not extend WaitingRoom
    def __init__(self):
        self.Names = []
        self.tree_headers = ['Player','Status','Address','Game','Color']
        self.quit = False   #quit program after wroom has been closed. it will be passed to Gui.quit

    def startWaitingRoomUI(self, pumpit):
        self.pumpit = True
        if 'pumpit' in locals():
            self.pumpit = pumpit
        cfg.wroom = Tk()
        cfg.wroom.protocol("WM_DELETE_WINDOW", self.quitWaitingRoom)

        """State variables - By using textvariable=var in definition widget is tied to this variable"""
        statusmsg_sv = StringVar() #needed
        entry_sv = StringVar(value = cfg.name)
        #entry_sv.trace("w", lambda name, index, mode, sv=entry_sv: self.changeName(sv))
        chatentry_sv = StringVar(value = "Press enter to chat")

        """Create and grid the outer content frame"""
        content = ttk.Frame(cfg.wroom) #, padding=(5, 5, 12, 0)) 		#Frame in cfg.wroom
        content.grid(column = 0, row = 0, sticky = (N,W,E,S))
        cfg.wroom.grid_columnconfigure(0, weight = 1)
        cfg.wroom.grid_rowconfigure(0, weight = 1)

        """Create the different widgets; note the variables that some widgets are bound to"""
        self.tree = Treeview(content, show="headings", columns=cfg.wroominstance.tree_headers, name = "treeview")
        self.tree.column("#1", minwidth = 100, width = 120, stretch = NO)
        self.tree.column("#2", minwidth = 30, width = 60, stretch = NO)
        self.tree.column("#3", minwidth = 30, width = 50, stretch = YES)
        self.tree.column("#4", minwidth = 30, width = 50, stretch = YES)
        self.tree.column("#5", minwidth = 30, width = 50, stretch = YES)
        namelbl = ttk.Label(content, text="Player name")
        self.nameentry = ttk.Entry(content, bg = 'white', textvariable = entry_sv, name = "nameentry")#, validatecommand=validateIt)
        colorlbl = ttk.Label(content, text="Player color")
        self.colorframe = ttk.Frame(content, name = "colorframe", borderwidth = 1, relief='sunken')
        lbl = ttk.Label(content, text="Send to player:")	#Label on the right
        self.log = Listbox(content, height = 5, bg = 'white', name = "logbox")#, listvariable=cmessagelog		#Listbox with messages
        self.chatAll = ttk.Button(content, text = 'Chat to All', command = self.chatToAll, default = 'active', width = '6',name = "chat")
        self.chatentry = ttk.Entry(content, bg = 'white', foreground = 'gray', textvariable = chatentry_sv, name = "chatentry", selectforeground = 'blue')
        testbtn = ttk.Button(content, text = 'Connections', command = self.test, default = 'active', width = '6', name = "testbtn")
        ready = ttk.Button(content, text = 'Ready', command = self.toggleReadyForGame, default = 'active', width = '6', name = "readybtn")
        solitaire = ttk.Button(content, text = 'Solitaire', command = self.solitaire, default = 'active', width = '6', name = "solitairebtn")
        quit = ttk.Button(content, text = 'Quit', command = self.quitWaitingRoom, default = 'active', width = '6', name = "quitbtn")
        status = ttk.Label(content, textvariable = statusmsg_sv, anchor = W, name = "statuslbl") #Label on the bottom

        def get_tree():
            """Get from the self.tree an item when clicked"""
            idxs = self.tree.item(self.tree.focus())
            vals = idxs['values']
            if len(idxs['values'])==0: return None
            return vals
        """def sortby(tree, col, descending):
            Sort tree contents when a column header is clicked on
            # grab values to sort
            data = [(tree.set(child, col), child) \
                for child in tree.get_children('')]
            # now sort the data in place
            data.sort(reverse=descending)
            for ix, item in enumerate(data):
                tree.move(item[1], '', ix)
            # switch the heading so it will sort in the opposite direction
            tree.heading(col, command=lambda col=col: sortby(tree, col, int(not descending)))
        """
        def showstatus(*args):
            """Called when the selection in the listbox changes;
            Update the status message on the bottom with the new information"""
            list = get_tree()
            if list is None:
                return
            statusmsg_sv.set("Player %s has this status: %s" % (list[0], list[1]))

        # Grid all the widgets
        self.tree.grid(row = 0, column = 0, rowspan = 9, sticky = (N,S,E,W))
        namelbl.grid(row = 0, column = 1, columnspan = 2, sticky = (N,W), padx = 5)
        self.nameentry.grid(row = 1, column = 1, columnspan = 2, sticky = (N,E,W), pady = 5, padx = 5)
        colorlbl.grid(row = 0, column = 3, columnspan = 1, sticky = (N,W), padx = 5)
        self.colorframe.grid(row = 1, column = 3, columnspan = 1, sticky = (N,E,W), pady = 5, padx = 5)
        #testbtn.grid(row = 3, column = 3, columnspan = 1, sticky = E, padx = 5)		#Test Button
        self.log.grid(row = 5, column = 1, columnspan = 3, sticky = (N,S,E,W), padx = 5, pady = 5)   #Listbox with all messages
        self.chatentry.grid(row = 6, column = 1, columnspan = 2, sticky = (N,E), padx = 5, pady = 5)
        self.chatAll.grid(row = 6, column = 3, columnspan = 1, sticky = (N,E), padx = 5, pady = 5)
        ready.grid(row = 7, column = 1, sticky = (W,S), padx = 5, pady = 5)			#
        solitaire.grid(row = 7, column = 2, sticky = (W,S), padx = 5, pady = 5)
        quit.grid(row = 7, column = 3, sticky = (W,S), padx = 5, pady = 5)
        status.grid(row = 9, column = 0, columnspan = 2, sticky = (W,E))

        """Configure content Frame and color Frame"""
        content.grid_columnconfigure(0, weight = 1)
        content.grid_rowconfigure(5, weight = 1)
        h = self.nameentry.winfo_reqheight()
        self.colorframe.configure(height = h, bg = 'red')

        """Set event bindings"""
        self.tree.bind('<<TreeviewSelect>>', showstatus)
        self.nameentry.bind('<Return>', (lambda _: self.askChangeName(self.nameentry)))
        self.nameentry.bind('<FocusOut>', (lambda _: self.askChangeName(self.nameentry)))
        cfg.wroom.bind('<Control-Key-w>', self.quitWaitingRoom)
        cfg.wroom.bind('<Control-Key-q>', self.quitWaitingRoom)
        cfg.wroom.bind('<Control-Key-r>', self.toggleReadyForGame)
#.........这里部分代码省略.........
开发者ID:aless80,项目名称:tantrix,代码行数:103,代码来源:waitingRoom.py

示例8: XML_Viwer

# 需要导入模块: from ttk import Treeview [as 别名]
# 或者: from ttk.Treeview import heading [as 别名]
class XML_Viwer(Frame):

    def __init__(self, master, xml=None, heading_text=None, heading_anchor=None, padding=None, cursor=None, takefocus=None, style=None):
        Frame.__init__(self, master, class_="XML_Viwer")

        self._vsb = Scrollbar(self, orient=VERTICAL)
        self._hsb = Scrollbar(self, orient=HORIZONTAL)

        kwargs = {}
        kwargs["yscrollcommand"] = lambda f, l: autoscroll(self._vsb, f, l)
        kwargs["xscrollcommand"] = lambda f, l: autoscroll(self._hsb, f, l)
       
        if style is not None:
            kwargs["style"] = style
            
        if padding is not None:
            kwargs["padding"] = padding
            
        if cursor is not None:
            kwargs["cursor"] = cursor
            
        if takefocus is not None:
            kwargs["takefocus"] = takefocus

        self._treeview = Treeview(self, **kwargs)
        
        if heading_text is not None:
            if heading_anchor is not None:
                self._treeview.heading("#0", text=heading_text, anchor=heading_anchor)
            else:
                self._treeview.heading("#0", text=heading_text)

        self._treeview.bind("<<TreeviewOpen>>", self._on_open)
        self._treeview.bind("<<TreeviewClose>>", self._on_close)
        
        # Without this line, horizontal scrolling doesn't work properly.
        self._treeview.column("#0", stretch= False)

        self._vsb['command'] = self._treeview.yview
        self._hsb['command'] = self._treeview.xview

        self._treeview.grid(column=0, row=0, sticky=N+S+W+E)
        self._vsb.grid(column=1, row=0, sticky=N+S)
        self._hsb.grid(column=0, row=1, sticky=E+W)
        
        self.grid_columnconfigure(0, weight=1)
        self.grid_rowconfigure(0, weight=1)

        self._element_tree = None
        self._item_ID_to_element = {}

        if xml is not None:
            self.parse_xml(xml)

    def _on_open(self, event):
        item_ID = self._treeview.focus()
        if item_ID not in self._item_ID_to_element: return

        node = self._item_ID_to_element[item_ID]

        self._treeview.item(item_ID, text = self._repr_of_openning_tag(node))
        
    def _on_close(self, event):
        item_ID = self._treeview.focus()
        if item_ID not in self._item_ID_to_element: return

        node = self._item_ID_to_element[item_ID]
        
        text = self._repr_of_openning_tag(node) + self._repr_of_closing_tag(node)
        self._treeview.item(item_ID, text = text)

    def parse_xml(self, xml):
        self._element_tree = ET.ElementTree(ET.fromstring(xml))
        
        self.clear()
        self._walk_xml(self._element_tree.getroot())
        
    @property
    def element_tree(self):
        return self._element_tree
    
    @element_tree.setter
    def element_tree(self, element_tree):
        self._element_tree = element_tree
        
        self.clear()
        self._walk_xml(element_tree.getroot())   
        
    def clear(self):
        self._item_ID_to_element = {}
        self._treeview.delete(*self._treeview.get_children())
        
    def _repr_of_openning_tag(self, node):
        text = "<" + node.tag

        attrs = node.attrib
        
        # list function is here necessary to provide support to Python 3
        a_names = list(attrs.keys())
        a_names.sort()
#.........这里部分代码省略.........
开发者ID:jacob-carrier,项目名称:code,代码行数:103,代码来源:recipe-580752.py

示例9: GUIMainMenu

# 需要导入模块: from ttk import Treeview [as 别名]
# 或者: from ttk.Treeview import heading [as 别名]
class GUIMainMenu(Frame):
    """Main menu for test of Genesi i.MX53 systems"""

    def __init__(self,master=None):
        """Initialize the base class"""
        Frame.__init__(self,master)

        """Set window title"""
        self.master.title("Select System Test")

        """System Tests"""
        self.createTestEntries()

        """Constants"""
        self.TEST_COL=0
        self.STATUS_COL=1
        self.TEXT_ROW=0
        self.TREEVIEW_ROW=1
        self.BUTTON_ROW=2

        """Display main window with padding"""
        self.grid()
        self.createWidgets()

    def createTestEntries(self):
        #TODO must be a better way. Pickle?
        self.tests = [TestInfo("Audio", AudioGUI), TestInfo("Clock", Dummy1),
                      TestInfo("Display", Dummy1), TestInfo("Keyboard", Dummy1),
                      TestInfo("Network", Dummy1), TestInfo("SSD", Dummy2),
                      TestInfo("Video", VideoGUI)]
        self.testsLookup = {}
        for te in self.tests:
            self.testsLookup.update({te.name : te})

    def createWidgets(self):
        """Create all the initial widgets for this menu"""
        """Labels"""
        lbl = Label(self, text="Select test below", justify=LEFT)
        lbl.grid(row=self.TEXT_ROW, column=self.TEST_COL)
        
        """Tests"""
        self.trv = Treeview(self, columns=("Status"), displaycolumns='#all')

        for test in self.tests:
            treeviewInsertTest(self.trv, test)

        self.trv.column('#0', width=100)
        self.trv.heading('#0', text="Test")
        self.trv.heading('Status', text='Status')

        self.trv.grid(column=self.TEST_COL, row=self.TREEVIEW_ROW,
                      columnspan=2)

        """Buttons"""
        self.btnOK = Button(self, text="OK", command=self.launchTest)
        self.btnOK.grid(row=self.BUTTON_ROW, column=0)
        self.btnQuit = Button(self, text="Quit", command=self.quit)
        self.btnQuit.grid(row=self.BUTTON_ROW, column=1)

    def launchTest(self):
        # get the item in focus
        testItem = self.trv.item(self.trv.focus())

        if not testItem['text'] == '':
            testInfo = self.testsLookup[testItem['text']]
            testInfo.launchTest(self)

    def processResults(self, testInfo):
        self.trv.item(testInfo.name, values=(testInfo.status),
                      tags=(testInfo.status))
        # update color notifications
        self.trv.tag_configure('Success', foreground='green')
        self.trv.tag_configure('Failure', foreground='red')

        self.deiconify()

    def withdraw(self):
        """Helpful function to hide window"""
        self.master.withdraw()

    def deiconify(self):
        """Helpful function to restore window"""
        self.master.deiconify()
开发者ID:cjenkin2,项目名称:iMX53-GUI-Hardware-Test,代码行数:85,代码来源:mainMenu.py

示例10: pylasticGUI

# 需要导入模块: from ttk import Treeview [as 别名]
# 或者: from ttk.Treeview import heading [as 别名]

#.........这里部分代码省略.........
        nb.add(frame, text='Analyze', underline=0, padding=2)
        return
    
    def _populate_tree(self, root, lock=None):
        
        if lock: lock.acquire()
        if len(self.tree.get_children(self.tree.get_children())) > 1: 
            for i in self.tree.get_children(self.tree.get_children()): self.tree.delete(i)
        #self.tree.delete(self.tree.get_children())
        status, paths = self.check_calc()
        
        for key in status.keys():
            #print paths[key].lstrip(self.__workdir).split('/')
            self.tree.insert(root, END, text = status[key], values=['text3','text4', paths[key]])
        if lock: lock.release()
        
    
    def _create_treeview(self, parent):
        f = Frame(parent)
        #f.pack(side=TOP, fill=BOTH, expand=Y)
        f.grid(row=0, column=0, sticky=NSEW, columnspan=3)
        
        # create the tree and scrollbars
        self.dataCols = ('fullpath', 'type', 'status')       
        self.tree = Treeview(columns=self.dataCols,
                                 displaycolumns='status')
        
        ysb = Scrollbar(orient=VERTICAL, command= self.tree.yview)
        xsb = Scrollbar(orient=HORIZONTAL, command= self.tree.xview)
        self.tree['yscroll'] = ysb.set
        self.tree['xscroll'] = xsb.set
        
        # setup column headings
        self.tree.heading('#0', text='Directory Structure', anchor=W)
        self.tree.heading('status', text='Status', anchor=W)
        self.tree.column('status', stretch=0, width=100)
        
        # add tree and scrollbars to frame
        self.tree.grid(in_=f, row=0, column=0, sticky=NSEW)
        ysb.grid(in_=f, row=0, column=1, sticky=NS)
        xsb.grid(in_=f, row=1, column=0, sticky=EW)
        
        # set frame resizing priorities
        f.rowconfigure(0, weight=1)
        f.columnconfigure(0, weight=1)
        
        # action to perform when a node is expanded
        self.tree.bind('<<TreeviewOpen>>', self._update_tree)
        
        self.tree.bind("<Double-1>", self.OnDoubleClick)
        
    def OnDoubleClick(self, event):
        item = self.tree.identify('item',event.x,event.y)
        if self.tree.item(item,"text") == 'calc':
            self.create_window()
        
        
    def _update_tree(self, event):
        # user expanded a node - build the related directory
        nodeId = self.tree.focus()      # the id of the expanded node
        
        if self.tree.parent(nodeId):    # not at root
            topChild = self.tree.get_children(nodeId)[0]
            
            # if the node only has a 'dummy' child, remove it and
            # build new directory; skip if the node is already
开发者ID:tdengg,项目名称:pylastic,代码行数:70,代码来源:main.py

示例11: ReciboCaja

# 需要导入模块: from ttk import Treeview [as 别名]
# 或者: from ttk.Treeview import heading [as 别名]
class ReciboCaja(Frame):
        def __init__(self, parent, controller):
                Frame.__init__(self, parent)

		lupa = PhotoImage(file='img/lupa.png')
		
		#VARIABLES
		tcontrato = ['Vivienda', 'Comercial']
		aplica = StringVar()
		
		#WIDGETS
		
		#========================= HEADER ===========================
		
		self.header = Label(self, text="RECIBO DE CAJA", font="bold")
		self.header.pack(pady=20, side=TOP)
		
		#========================== WRAPPER ==========================
		
		self.wrapper = Frame (self)
		self.wrapper.pack(side=TOP, fill=Y)
		#self.wrapper.pack(side=LEFT, fill=Y)#Este ubica el forma a la IZA
		
		#================ NOTEBOOK =============>
		
		self.nb = Notebook(self.wrapper)
		
		#-----------------------> TAB 1
		
		self.tab1 = Frame (self.nb)
		self.tab1.pack()
		
		self.f0 = Frame(self.tab1)#-------------------------------------
		self.f0.pack(pady=5,fill=X)

		self.R1 = Radiobutton(self.f0, text="Arrendatario", variable=aplica, value='Arrendatario')
		self.R1.pack(padx=20,side=LEFT)
		self.R2 = Radiobutton (self.f0, text="Propietario", variable=aplica, value='Propietario')
		self.R2.pack(padx=20,side=LEFT)
		self.R3 = Radiobutton (self.f0, text="Tercero", variable=aplica, value='Tercero')
		self.R3.pack(padx=20,side=LEFT)
		
		self.f1 = Frame(self.tab1)#-------------------------------------
		self.f1.pack(pady=5,fill=X)
		
		self.cc = Label(self.f1, text='CC/Nit: ')
		self.cc.pack(side=LEFT)
		self.ccE = Entry(self.f1)
		self.ccE.pack(side=LEFT)
		
		self.b1 = Button(self.f1, text='Buscar', image=lupa)
		self.b1.image=lupa
		self.b1.pack(side=LEFT)

		self.f2 = Frame(self.tab1)
		self.f2.pack(pady=5,fill=X)#------------------------------------
		
		self.nombre = Label(self.f2, text='Nombre:')
		self.nombre.pack(side=LEFT)
		self.nombrE = Entry(self.f2, width=5, state=DISABLED)
		self.nombrE.pack(side=LEFT, fill=X, expand=1)
		
		self.f3 = Frame(self.tab1)
		self.f3.pack(pady=5,fill=X)#------------------------------------
		
		self.inmueble = Label(self.f3, text='Inmueble:')
		self.inmueble.pack(side=LEFT)
		
		self.inmuebleCbx = Combobox(self.f3, values=NONE, width=10)
		self.inmuebleCbx.set('')
		self.inmuebleCbx.pack(side=LEFT, fill=X, expand=1)
		
		self.b2 = Button(self.f3, text='Agregar', image=lupa)
		self.b2.image=lupa
		self.b2.pack(side=LEFT)
		
		self.f4 = Frame(self.tab1)
		self.f4.pack(pady=5,fill=X)#------------------------------------
		
		self.fpago = Label(self.f4, text='Forma de Pago:')
		self.fpago.pack(side=LEFT)
		
		self.fpagoCbx = Combobox(self.f4, values=NONE, width=10)
		self.fpagoCbx.set('')
		self.fpagoCbx.pack(side=LEFT)
		
		self.b3 = Button(self.f4, text='Crear novedad', state=DISABLED)
		self.b3.pack(side=LEFT)

		#========================== TREEVIEW ===========================
		
		self.f5 = Frame(self.tab1)
		self.f5.pack(pady=5,fill=X)#------------------------------------
		
		self.tree = Treeview(self.f5, height=4, show="headings", columns=('col1','col2','col3'))
		self.tree.pack(side=LEFT, fill=X, expand=1)
		self.tree.column('col1', width=20, anchor='center')
		self.tree.column('col2', width=200, anchor='center')
		self.tree.column('col3', width=10, anchor='center')
		
#.........这里部分代码省略.........
开发者ID:einnerlink,项目名称:sbienes,代码行数:103,代码来源:recibo_caja.py

示例12: Multicolumn_Listbox

# 需要导入模块: from ttk import Treeview [as 别名]
# 或者: from ttk.Treeview import heading [as 别名]
class Multicolumn_Listbox(object):
    _style_index = 0

    class List_Of_Rows(object):
        def __init__(self, multicolumn_listbox):
            self._multicolumn_listbox = multicolumn_listbox

        def data(self, index):
            return self._multicolumn_listbox.row_data(index)
            
        def get(self, index):
            return Row(self._multicolumn_listbox, index)

        def insert(self, data, index=None):
            self._multicolumn_listbox.insert_row(data, index)

        def delete(self, index):
            self._multicolumn_listbox.delete_row(index)

        def update(self, index, data):
            self._multicolumn_listbox.update_row(index, data)

        def select(self, index):
            self._multicolumn_listbox.select_row(index)

        def deselect(self, index):
            self._multicolumn_listbox.deselect_row(index)

        def set_selection(self, indices):
            self._multicolumn_listbox.set_selection(indices)

        def __getitem__(self, index): 
            return self.get(index)

        def __setitem__(self, index, value): 
            return self._multicolumn_listbox.update_row(index, value)

        def __delitem__(self, index): 
            self._multicolumn_listbox.delete_row(index)

        def __len__(self): 
            return self._multicolumn_listbox.number_of_rows

    class List_Of_Columns(object):
        def __init__(self, multicolumn_listbox):
            self._multicolumn_listbox = multicolumn_listbox
        
        def data(self, index):
            return self._multicolumn_listbox.get_column(index)

        def get(self, index):
            return Column(self._multicolumn_listbox, index)

        def delete(self, index):
            self._multicolumn_listbox.delete_column(index)

        def update(self, index, data):
            self._multicolumn_listbox.update_column(index, data)

        def __getitem__(self, index): 
            return self.get(index)

        def __setitem__(self, index, value): 
            return self._multicolumn_listbox.update_column(index, value)

        def __delitem__(self, index): 
            self._multicolumn_listbox.delete_column(index)

        def __len__(self): 
            return self._multicolumn_listbox.number_of_columns

    def __init__(self, master, columns, data=None, command=None, sort=True, select_mode=None, heading_anchor = CENTER, cell_anchor=W, style=None, height=None, padding=None, adjust_heading_to_content=False, stripped_rows=None, selection_background=None, selection_foreground=None, field_background=None, heading_font= None, heading_background=None, heading_foreground=None, cell_pady=2, cell_background=None, cell_foreground=None, cell_font=None, headers=True):

        self._stripped_rows = stripped_rows

        self._columns = columns
        
        self._number_of_rows = 0
        self._number_of_columns = len(columns)
        
        self.row = self.List_Of_Rows(self)
        self.column = self.List_Of_Columns(self)
        
        s = Style()

        if style is None:
            style_name = "Multicolumn_Listbox%s.Treeview"%self._style_index
            self._style_index += 1
        else:
            style_name = style
        
        style_map = {}
        if selection_background is not None:
            style_map["background"] = [('selected', selection_background)]
            
        if selection_foreground is not None:
            style_map["foeground"] = [('selected', selection_foreground)]

        if style_map:
            s.map(style_name, **style_map)
#.........这里部分代码省略.........
开发者ID:jacob-carrier,项目名称:code,代码行数:103,代码来源:recipe-580746.py

示例13: __init__

# 需要导入模块: from ttk import Treeview [as 别名]
# 或者: from ttk.Treeview import heading [as 别名]

#.........这里部分代码省略.........
			self.f2 = Frame(self.lf2)
			self.f2.pack(pady=5, fill=X)#-------------------------------
			
			l5 = Label(self.f2, text='Código:')
			l5.pack(side=LEFT)
			e4 = Entry(self.f2, textvariable=cod)
			e4.pack(side=LEFT)
			e4.bind('<Return>', buscarC)
			
			b2 = Button(self.f2, text='Buscar:', image=lupa, command=topCtasContables)
			b2.pack(side=LEFT)
			
			self.f3 = Frame(self.lf2)
			self.f3.pack(pady=5, fill=X)#-------------------------------
			
			l6 = Label(self.f3, text='Descripción:')
			l6.pack(side=LEFT)
			e5 = Entry(self.f3, textvariable=desc, state=DISABLED)
			e5.pack(side=LEFT, fill=X, expand=1)
			
			l7 = Label(self.f3, text='Valor:')
			l7.pack(side=LEFT)
			e6 = Entry(self.f3, width=15, textvariable=valor)
			e6.pack(side=LEFT)
			
			b3 = Button(self.f3, text='Agregar:', command=agregar)
			b3.pack(side=LEFT)
			
			#-------------------------- TREEVIEW ---------------------------
			
			self.f4 = Frame(self.wrapper)
			self.f4.pack(pady=5,fill=X)
			
			tree = Treeview(self.f4, height=4, show="headings", columns=('col1','col2','col3'))
			tree.pack(side=LEFT, fill=X, expand=1)
			tree.column('col1', width=20, anchor='center')
			tree.column('col2', width=200, anchor='center')
			tree.column('col3', width=10, anchor='center')
			
			tree.heading('col1', text='Código')
			tree.heading('col2', text='Concepto')
			tree.heading('col3', text='Valor')
			
			scroll = Scrollbar(self.f4,orient=VERTICAL,command=tree.yview)
			tree.configure(yscrollcommand=scroll.set)
			tree.bind("<Delete>", borrar)
			
			#-------------------------- RESULTADOS ---------------------------
			
			self.f5 = Frame(self.wrapper)
			self.f5.pack(pady=5,fill=X)#-------------------
			
			l8 = Label(self.f5, textvariable=resultado, fg="red", bg="white", anchor='e', font="bold, 22", relief= SUNKEN)
			l8.pack(fill=X, side=RIGHT, expand=1)
			
			#-------------------------- FOOTER ---------------------------
			
			self.fBtn = Frame(self.wrapper)
			self.fBtn.pack()#-------------------------------
			
			clean = Button(self.fBtn, text='Cancelar', bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=limpiar)
			clean.pack(side=RIGHT)
			
			add = Button(self.fBtn, text='Grabar', bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=grabar)
			add.pack(side=RIGHT)
			
开发者ID:einnerlink,项目名称:sbienes,代码行数:69,代码来源:gastos.py

示例14: _add_frames

# 需要导入模块: from ttk import Treeview [as 别名]
# 或者: from ttk.Treeview import heading [as 别名]
    def _add_frames(self):
        # Adding Answer Backup Frame
        f1 = Frame(self)
        f1.grid(column=0, row=0, sticky="NWES")
        for i in range(4):
            f1.grid_rowconfigure(i, weight=0, pad=5)
        f1.grid_rowconfigure(4, weight=1, pad=5)
        for i in range(4):
            f1.grid_columnconfigure(i, weight=1, pad=5)

        Label(f1, anchor="e", text="Answers Count : ").grid(column=0, row=0, sticky="EWNS")
        self.answer_count = StringVar(value=len(self.crawler.answer_list))
        Label(f1, anchor="w", textvariable=self.answer_count).grid(column=1, row=0, sticky="EWNS")
        Label(f1, anchor="e", text="User Name : ").grid(column=2, row=0, sticky="EWNS")
        self.user = StringVar(value="Unknown")
        Label(f1, anchor="w", textvariable=self.user).grid(column=3, row=0, sticky="EWNS")

        tf_col = "#e6e6e6"
        tf = Tkinter.Frame(f1, relief=GROOVE, borderwidth="2p")
        tf.grid(row=1, columnspan=2, column=0, sticky="EWNS")
        Label(tf, text="Quora User Options", bg=tf_col, anchor="c").grid(column=0, row=0, columnspan=2, sticky="EWNS")
        Button(tf, text="Login", command=lambda: self.thread("login"), highlightbackground=tf_col).grid(
            column=0, row=1, sticky="EWNS"
        )
        Button(tf, text="Logout", command=lambda: self.thread("logout"), highlightbackground=tf_col).grid(
            column=1, row=1, sticky="EWNS"
        )
        tf.grid_rowconfigure(0, weight=1, pad=5)
        tf.grid_rowconfigure(1, weight=1, pad=5)
        tf.grid_columnconfigure(0, weight=1, pad=5)
        tf.grid_columnconfigure(1, weight=1, pad=5)

        tf = Frame(f1, relief=GROOVE, borderwidth="2p")
        tf.grid(row=1, columnspan=2, column=2, sticky="EWNS")
        Label(tf, text="Answer List Option", bg=tf_col, anchor="c").grid(column=0, columnspan=2, row=0, sticky="EWNS")
        Button(tf, text="Reset", command=lambda: self.thread("reset"), highlightbackground=tf_col).grid(
            column=0, row=1, sticky="EWNS"
        )
        Button(tf, text="Update", command=lambda: self.thread("update"), highlightbackground=tf_col).grid(
            column=1, row=1, sticky="EWNS"
        )
        tf.grid_rowconfigure(0, weight=1, pad=5)
        tf.grid_rowconfigure(1, weight=1, pad=5)
        tf.grid_columnconfigure(0, weight=1, pad=5)
        tf.grid_columnconfigure(1, weight=1, pad=5)

        # Add Progress Bar
        self.backup_progress = Progressbar(f1, orient="horizontal", length=100, mode="determinate")
        self.backup_progress.grid(row=2, columnspan=4, column=0, sticky="EWNS")

        # Adding Status Pane
        self.backup_status = StringVar(value="Ready")
        Label(f1, textvariable=self.backup_status, anchor="w").grid(row=3, column=0, columnspan=4, sticky="EWNS")

        # Adding The list of all answers
        tree = Treeview(f1, columns=("sno", "date", "question"))
        tree.heading("sno", text="S. No")
        tree.heading("date", text="Date")
        tree.heading("question", text="Question")

        tree.column("#0", width=0, stretch=False)
        tree.column("sno", width=40, stretch=False, anchor="center")
        tree.column("date", width=120, stretch=False, anchor="center")
        tree.column("question", stretch=True, anchor="w")
        tree.grid(column=0, columnspan=4, row=4, sticky="EWNS")
        tree.bind("<Double-1>", self.tree_item_click)
        self.answer_tree = tree
        self.populate_tree()

        f2 = Frame(self)
        self.add(f1, text="Answer Backup", underline=7)
        self.add(f2, text="Analytics")
开发者ID:Alafazam,项目名称:quora-analytics,代码行数:74,代码来源:main.py

示例15: SnakeLog

# 需要导入模块: from ttk import Treeview [as 别名]
# 或者: from ttk.Treeview import heading [as 别名]
class SnakeLog(Frame):

    def createMenubar(self, master):
        self.menubar = Menu(root)

        self.filemenu = Menu(self.menubar, tearoff=0)

        self.importmenu = Menu(self.filemenu)
        self.importmenu.add_command(label="from ADIF...", command=None)

        self.exportmenu = Menu(self.filemenu)
        self.exportmenu.add_command(label="to ADIF...", command=None)
        self.exportmenu.add_command(label="to Cabrillo...", command=None)

        self.filemenu.add_command(label="Open log...", command=None)
        self.filemenu.add_command(label="Save log as...", command=None)
        self.filemenu.add_separator()
        self.filemenu.add_cascade(label="Export", menu=self.exportmenu)
        self.filemenu.add_cascade(label="Import", menu=self.importmenu)
        self.filemenu.add_separator()
        self.filemenu.add_command(label="Exit", command=None)

        self.menubar.add_cascade(label="File", menu=self.filemenu)

        master.config(menu=self.menubar)

    def createQSOView(self, master):
        self.qsoviewScrollbar = Scrollbar(master)
        self.qsoview = Treeview(master, show=('headings'),
                                yscrollcommand=self.qsoviewScrollbar.set)


        self.qsoviewfields = {'day':            {'name': "D", 'width': 10},
                              'month':          {'name': "M", 'width': 10},
                              'year':           {'name': "Y", 'width': 20},
                              'timeon':         {'name': "Time", 'width': 30},
                              'timeoff':        {'name': "Timeoff", 'width': 30},
                              'band':           {'name': "Band", 'width': 20},
                              'freq':           {'name': "Frequency", 'width': 50},
                              'mode':           {'name': "Mode", 'width': 25},
                              'call':           {'name': "Call", 'width': 50},
                              'srst':           {'name': "S RST", 'width': 25},
                              'rrst':           {'name': "R RST",'width': 25},
                              'name':           {'name': "Name",'width': 40},
                              'grid':           {'name': "Gridsquare",'width': 30},
                              'iota':           {'name': "IOTA", 'width': 30},
                              'qsls':           {'name': "Q S",'width': 25},
                              'qsls_date':      {'name': "Q S D",'width': 50},
                              'qslr':           {'name': "Q R",'width': 25},
                              'qslr_date':      {'name': "Q R D",'width': 50},
                              'lotw_qsls':      {'name': "LQ S",'width': 25},
                              'lotw_qsls_date': {'name': "LQ S D",'width': 50},
                              'lotw_qslr':      {'name': "LQ R",'width': 25},
                              'lotw_qslr_date': {'name': "LQ R D",'width': 50}}


        self.qsoviewdisplayesfields = ('day', 'month', 'year', 'timeon',
                                       'band', 'freq', 'mode', 'call',
                                       'srst', 'rrst', 'name', 'grid',
                                       'iota', 'qsls', 'qsls_date', 'qslr',
                                       'qslr_date', 'lotw_qsls', 'lotw_qsls_date', 'lotw_qslr',
                                       'lotw_qslr_date')


        self.qsoview["columns"] = self.qsoviewfields.keys()
        self.qsoview["displaycolumns"] = self.qsoviewdisplayesfields


        self.qsoview.column(0, width=40)
        for columnname, data in self.qsoviewfields.items():
            # set columnwidth for QSOView
            self.qsoview.column(columnname, width=data['width'])
            # set QSOView headers
            self.qsoview.heading(columnname, text=data['name'])

        for i in range(400):
            self.qsoview.insert('', 'end', str(i), values=(str(i), 'bar'+str(i)))

        self.qsoviewScrollbar.config(command=self.qsoview.yview)

        self.qsoviewScrollbar.grid(column=1, row=0, sticky=(N,S))
        self.qsoview.grid(column=0, row=0, sticky=(N,S,E,W))

        master.columnconfigure(0, weight=1)
        master.rowconfigure(0, weight=1)

    def __init__(self, master=None):

        master.columnconfigure(0, weight=1)
        master.rowconfigure(0, weight=1)

        self.mainFrame = Frame.__init__(self, master)

        self.grid(sticky=(N,S,E,W))
        self.columnconfigure(0, weight=1)
        self.rowconfigure(0, weight=1)

        self.createMenubar(master)

        self.qsoFrame = Frame(self.mainFrame)
#.........这里部分代码省略.........
开发者ID:richtma,项目名称:snakeLog,代码行数:103,代码来源:snakeLog.py


注:本文中的ttk.Treeview.heading方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。