✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ server303.web-hosting.com ​🇻​♯➤ 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 199.188.205.31 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.217.42
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /usr/lib64/python2.7/Demo/tkinter/ttk//treeview_multicolumn.py
"""Demo based on the demo mclist included with tk source distribution."""
import Tkinter
import tkFont
import ttk

tree_columns = ("country", "capital", "currency")
tree_data = [
    ("Argentina",      "Buenos Aires",     "ARS"),
    ("Australia",      "Canberra",         "AUD"),
    ("Brazil",         "Brazilia",         "BRL"),
    ("Canada",         "Ottawa",           "CAD"),
    ("China",          "Beijing",          "CNY"),
    ("France",         "Paris",            "EUR"),
    ("Germany",        "Berlin",           "EUR"),
    ("India",          "New Delhi",        "INR"),
    ("Italy",          "Rome",             "EUR"),
    ("Japan",          "Tokyo",            "JPY"),
    ("Mexico",         "Mexico City",      "MXN"),
    ("Russia",         "Moscow",           "RUB"),
    ("South Africa",   "Pretoria",         "ZAR"),
    ("United Kingdom", "London",           "GBP"),
    ("United States",  "Washington, D.C.", "USD")
    ]

def sortby(tree, col, descending):
    """Sort tree contents when a column is clicked on."""
    # grab values to sort
    data = [(tree.set(child, col), child) for child in tree.get_children('')]

    # reorder data
    data.sort(reverse=descending)
    for indx, item in enumerate(data):
        tree.move(item[1], '', indx)

    # switch the heading so that it will sort in the opposite direction
    tree.heading(col,
        command=lambda col=col: sortby(tree, col, int(not descending)))

class App(object):
    def __init__(self):
        self.tree = None
        self._setup_widgets()
        self._build_tree()

    def _setup_widgets(self):
        msg = ttk.Label(wraplength="4i", justify="left", anchor="n",
            padding=(10, 2, 10, 6),
            text=("Ttk is the new Tk themed widget set. One of the widgets it "
                  "includes is a tree widget, which can be configured to "
                  "display multiple columns of informational data without "
                  "displaying the tree itself. This is a simple way to build "
                  "a listbox that has multiple columns. Clicking on the "
                  "heading for a column will sort the data by that column. "
                  "You can also change the width of the columns by dragging "
                  "the boundary between them."))
        msg.pack(fill='x')

        container = ttk.Frame()
        container.pack(fill='both', expand=True)

        # XXX Sounds like a good support class would be one for constructing
        #     a treeview with scrollbars.
        self.tree = ttk.Treeview(columns=tree_columns, show="headings")
        vsb = ttk.Scrollbar(orient="vertical", command=self.tree.yview)
        hsb = ttk.Scrollbar(orient="horizontal", command=self.tree.xview)
        self.tree.configure(yscrollcommand=vsb.set, xscrollcommand=hsb.set)
        self.tree.grid(column=0, row=0, sticky='nsew', in_=container)
        vsb.grid(column=1, row=0, sticky='ns', in_=container)
        hsb.grid(column=0, row=1, sticky='ew', in_=container)

        container.grid_columnconfigure(0, weight=1)
        container.grid_rowconfigure(0, weight=1)

    def _build_tree(self):
        for col in tree_columns:
            self.tree.heading(col, text=col.title(),
                command=lambda c=col: sortby(self.tree, c, 0))
            # XXX tkFont.Font().measure expected args are incorrect according
            #     to the Tk docs
            self.tree.column(col, width=tkFont.Font().measure(col.title()))

        for item in tree_data:
            self.tree.insert('', 'end', values=item)

            # adjust columns lenghts if necessary
            for indx, val in enumerate(item):
                ilen = tkFont.Font().measure(val)
                if self.tree.column(tree_columns[indx], width=None) < ilen:
                    self.tree.column(tree_columns[indx], width=ilen)

def main():
    root = Tkinter.Tk()
    root.wm_title("Multi-Column List")
    root.wm_iconname("mclist")

    import plastik_theme
    try:
        plastik_theme.install('~/tile-themes/plastik/plastik')
    except Exception:
        import warnings
        warnings.warn("plastik theme being used without images")

    app = App()
    root.mainloop()

if __name__ == "__main__":
    main()


Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
15 Jun 2024 8.33 AM
root / root
0755
img
--
15 Jun 2024 8.33 AM
root / root
0755
combo_themes.py
1.579 KB
19 Apr 2020 9.13 PM
root / root
0644
combo_themes.pyc
1.882 KB
10 Apr 2024 4.58 AM
root / root
0644
combo_themes.pyo
1.882 KB
10 Apr 2024 4.58 AM
root / root
0644
dirbrowser.py
2.653 KB
19 Apr 2020 9.13 PM
root / root
0644
dirbrowser.pyc
3.883 KB
10 Apr 2024 4.58 AM
root / root
0644
dirbrowser.pyo
3.883 KB
10 Apr 2024 4.58 AM
root / root
0644
listbox_scrollcmd.py
1.13 KB
19 Apr 2020 9.13 PM
root / root
0644
listbox_scrollcmd.pyc
1.563 KB
10 Apr 2024 4.58 AM
root / root
0644
listbox_scrollcmd.pyo
1.563 KB
10 Apr 2024 4.58 AM
root / root
0644
mac_searchentry.py
3.631 KB
19 Apr 2020 9.13 PM
root / root
0644
mac_searchentry.pyc
3.884 KB
10 Apr 2024 4.58 AM
root / root
0644
mac_searchentry.pyo
3.884 KB
10 Apr 2024 4.58 AM
root / root
0644
notebook_closebtn.py
2.468 KB
19 Apr 2020 9.13 PM
root / root
0644
notebook_closebtn.pyc
2.906 KB
10 Apr 2024 4.58 AM
root / root
0644
notebook_closebtn.pyo
2.906 KB
10 Apr 2024 4.58 AM
root / root
0644
plastik_theme.py
9.363 KB
19 Apr 2020 9.13 PM
root / root
0644
plastik_theme.pyc
7.342 KB
10 Apr 2024 4.58 AM
root / root
0644
plastik_theme.pyo
7.342 KB
10 Apr 2024 4.58 AM
root / root
0644
roundframe.py
5.47 KB
19 Apr 2020 9.13 PM
root / root
0644
roundframe.pyc
6.284 KB
10 Apr 2024 4.58 AM
root / root
0644
roundframe.pyo
6.284 KB
10 Apr 2024 4.58 AM
root / root
0644
theme_selector.py
1.925 KB
19 Apr 2020 9.13 PM
root / root
0644
theme_selector.pyc
2.811 KB
10 Apr 2024 4.58 AM
root / root
0644
theme_selector.pyo
2.811 KB
10 Apr 2024 4.58 AM
root / root
0644
treeview_multicolumn.py
4.146 KB
19 Apr 2020 9.13 PM
root / root
0644
treeview_multicolumn.pyc
5.351 KB
10 Apr 2024 4.58 AM
root / root
0644
treeview_multicolumn.pyo
5.351 KB
10 Apr 2024 4.58 AM
root / root
0644
ttkcalendar.py
8.123 KB
19 Apr 2020 9.13 PM
root / root
0644
ttkcalendar.pyc
9.535 KB
10 Apr 2024 4.58 AM
root / root
0644
ttkcalendar.pyo
9.535 KB
10 Apr 2024 4.58 AM
root / root
0644
widget_state.py
2.657 KB
19 Apr 2020 9.13 PM
root / root
0644
widget_state.pyc
3.328 KB
10 Apr 2024 4.58 AM
root / root
0644
widget_state.pyo
3.328 KB
10 Apr 2024 4.58 AM
root / root
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF