Exemplo n.º 1
0
#  *********** GUI ****************
WIDTH = 450
HEIGHT = 650

# COLORS
# bg
canvasbg = '#212121'
framebg = '#3F51B5'
redbg = '#f44336'
greenbg = '#4CAF50'
# fg
whitefg = '#FFF'

runBTcolor = '#00C853'

root = ThemedTk(theme='equilux')
# root.resizable(False, False)
root.minsize(WIDTH, HEIGHT)
root.title('Wallhavener')
root.attributes("-alpha", 0.93)

# root.update_idletasks()
# root.overrideredirect(True)
# root.wait_visibility(root)
# root.attributes('-type', 'normal')
# root.attributes('-alpha', 0.8)

# Styling * ---- *


def gui_style():
Exemplo n.º 2
0
                        default=30,
                        help="Number of LED pixels")
    parser.add_argument("--led_pin",
                        type=int,
                        help="GPIO pin connected to the pixels")
    parser.add_argument("--led_brightness",
                        type=int,
                        help="Brightness of pixels (between 0 and 255)")
    parser.add_argument(
        "--use_gui",
        type=bool,
        default=True,
        help="If True, launch Tkinter GUI. If False, use command line")
    args = parser.parse_args()

    # Create a Moodlight object
    moodlights = Moodlights(args.led_count, args.led_pin, LED_FREQ_HZ, LED_DMA,
                            LED_INVERT, args.led_brightness, LED_CHANNEL)

    if args.use_gui:
        root = ThemedTk(theme="arc")
        gui = GUI(root, moodlights)
        root.protocol("WM_DELETE_WINDOW", moodlights.shutdown)
        root.mainloop()
    else:
        # Ask for user input
        while True:
            print_menu()
            option = input("Option: ")
            action(option)
Exemplo n.º 3
0
from tkinter import *
from tkinter import ttk
from ttkthemes import ThemedTk
import pandas as pd
import os
from tkinter.filedialog import askopenfile, asksaveasfilename

win = ThemedTk(theme="aqua")
win.title("Notepad")
win.geometry("720x480")
win.minsize(720, 480)
win.config(background='#272C35')


def open_file():
    blank.delete("1.0", END)
    file = askopenfile(mode='r',
                       filetypes=[('All', '*'), ('Text files', '*.txt'),
                                  ('Hyper Text Language Markup', '*.html'),
                                  ('Comma-Separated Values', '*.csv')])
    if file is not None:
        text = file.read()
        blank.insert("1.0", text)


def save_file():
    notepad_text = blank.get("1.0", "end-1c")
    file = asksaveasfilename(title="Save",
                             filetypes=[('All', '*'), ('Text files', '*.txt'),
                                        ('Hyper Text Language Markup',
                                         '*.html'),
Exemplo n.º 4
0

def get_weather(event=''):
    if entry.get():
        params = {
            'appid': API_KEY,
            'q': entry.get(),
            'units': 'metric',
            'lang': 'ru'
        }
    req = requests.get(API_URL, params=params)
    weather = req.json()
    lbl['text'] = print_weather(weather)


root = ThemedTk(theme='ark')
root.geometry('500x400+300+200')
root.resizable(0, 0)

s = ttk.Style()
s.configure('TLabel', padding=5, font='Arial 12')

top_frame = ttk.Frame(root)
top_frame.place(relx=0.5, rely=0.1, relwidth=0.9, relheight=0.1, anchor='n')

entry = ttk.Entry(top_frame)
entry.place(relwidth=0.7, relheight=1)
entry.bind('<Return>', get_weather)

btn = ttk.Button(top_frame, text='Запрос погоды', command=get_weather)
btn.place(relx=0.7, relwidth=0.3, relheight=1)
Exemplo n.º 5
0
def browse_data():
    filename.set(
        askopenfilename(initialdir=curr_dir, title="Select simulation file"))


def get_output_dir():
    output_dir.set(
        askdirectory(initialdir=curr_dir, title="Select output path"))


logger = logger_init()

curr_dir = os.getcwd()
logger.debug(curr_dir)
root = ThemedTk(
    theme="breeze"
)  # themes: https://ttkthemes.readthedocs.io/en/latest/themes.html
root.title(NAME)

if platform.system(
) == "Windows":  # pq no linux nao consegue utilizar esse comando
    root.iconbitmap(BUILD_ICON_PATH)

user = StringVar()
password = StringVar()
filename = StringVar()
filename.set("No file selected")
output_dir = StringVar()
output_dir.set("No folder selected")

CREDENTIALS_FILE_PATH = f"{os.getenv('APPDATA')}/Iposim Automator/credentials.json"
Exemplo n.º 6
0
from tkinter import *
# import tkinter as tk
from tkinter import ttk
from ttkthemes import ThemedTk

window = ThemedTk(theme="breeze")

tab_control = ttk.Notebook(window)

tab1 = ttk.Frame(tab_control)
tab_control.add(tab1, text='Mass')

tab2 = ttk.Frame(tab_control)

tab3 = ttk.Frame(tab_control)

tab4 = ttk.Frame(tab_control)

tab5 = ttk.Frame(tab_control)

tab6 = ttk.Frame(tab_control)

tab_control.add(tab2, text='Length')

tab_control.add(tab3, text='Speed')

tab_control.add(tab4, text='Temperature')

tab_control.add(tab5, text='Currency')

tab_control.add(tab6, text='Date')
import tkinter as tk
from tkinter import ttk
from ttkthemes import ThemedTk
from translate import Translator
# DOWNLOAD: python -m pip install translate

# autor: backup_python.dev

raiz = ThemedTk(theme="vista")
raiz.geometry("600x300")
raiz.title("Traductor")
letra = "Helvetica 12 bold"

# StringVar
var = tk.StringVar()
var2 = tk.StringVar()

text = ttk.Label(raiz, text="Español:", font=letra)
text2 = ttk.Label(raiz, text="Inglés:", font=letra)
texto = ttk.Entry(raiz, textvariable=var2, font=letra, width=70)
traduccion = ttk.Entry(raiz, textvariable=var, font=letra, width=70)


def Traductor():
    traductor = Translator(from_lang="Spanish", to_lang="English")
    traduccion = traductor.translate(texto.get())
    return var.set(traduccion)


BtnT = ttk.Button(raiz, text="Traducir", width=14, command=Traductor)
Exemplo n.º 8
0
    def ManageBudget():
        income = ThemedTk(theme = ttk_theme, themebg = True)
        income.title("Manage Budget")
        income.resizable(False, False)
        labelframe2 = ttk.LabelFrame(income, text="Set Month and Year")  
        labelframe2.grid(row=1,column = 2, rowspan = 6, columnspan=4, sticky='WE', \
                padx=30, pady=30, ipadx=30, ipady=30)

        rootlabel = ttk.Label(labelframe2, text="Please provide the following: ", width=30, font=("bold", 10))  
        rootlabel.grid(row=2,column = 0,columnspan = 4,padx = 10, pady=4)

        label_1 = ttk.Label(labelframe2, text="Set Budget Value ",width=30,font=("bold", 10))
        label_1.grid(row=3,column = 0,columnspan = 4, pady=4)

        entry_1 = Entry(labelframe2, bd=5)
        entry_1.grid(row=4,column = 0, pady=4)


        # label_1 = ttk.Label(income, text="Set Budget Value",width=20,font=("bold", 10))
        # label_1.place(x=30,y=60)

        # entry_1 = Entry(income, bd=5)
        # entry_1.place(x=240,y=60)
        def printamount():
            s = entry_1.get()
            if s.isdigit():
                print('Budget: ' + s)
                return s
            else:
                messagebox.showinfo("Attention!","Budget Value Should be a number and not text or any Special Character!\nEntry Not Saved. Try Again!")
                entry_1.delete(0, END)
                entry_1.insert(0, "")
                return "stop"

        label_2 = ttk.Label(labelframe2, text="Set Percentage to Notify:",width=30,font=("bold", 10))
        label_2.grid(row=5, column = 0, columnspan = 4, pady=4)

        entry_2 = Entry(labelframe2, bd=5)
        entry_2.grid(row=6, column = 0, pady=4)

        def printper():
            s = int(entry_2.get())
            if s>100 or s<0:
                messagebox.showinfo("Title", "Invalid Percentage! Set Between 0 to 100")
                return 1
            print('Percentage: ' + str(s))
            return s

        def put():
            t1 =printamount()
            if t1 == "stop":
                get()
            else:
                t2 = printper()
                if t2 == 1:
                    get()
                else:
                    u1 = int(t1)
                    u2 = int(t2)
                    db = sqlite3.connect('myspendmate.db')
                    cursor = db.cursor()
                    cursor.execute("insert into budget values('%d','%d')"%(int(t1),int(t2)))
                    
                    
                    cursor.close()
                    db.commit()
                    db.close
                    get()
        
       
            
        def get():
            db = sqlite3.connect('myspendmate.db')
            cursor = db.cursor()
            total = cursor.rowcount
            cursor.execute("SELECT amount FROM budget ORDER BY ROWID DESC LIMIT 1")
            budgetamt = cursor.fetchone()[0]
            print("-------" + str(budgetamt))
            
            cursor.execute("SELECT percentage FROM budget ORDER BY ROWID DESC LIMIT 1")
            budgetper = cursor.fetchone()[0]
            print("-------" + str(budgetper))
            cursor.execute("select sum(amount) from expense")
            total_expense = cursor.fetchone()[0]
            if total_expense == None:
                total_expense = 0
            print(total_expense)            
            
            cursor.close()
            db.commit()
            db.close
            spentper = (total_expense*100)/budgetamt
            print(spentper)
            budgetlabel1.config(text=str(budgetamt) + CurrencyCurrent)
            Spentlabel1.config(text=str(budgetper) + "%")
            if budgetper<spentper:
                budgetlabel2 = ttk.Label(budgetframe1, text="Message :")  
                budgetlabel2.grid(row = 5, column = 0, pady =2)
                budgetlabel2 = ttk.Label(budgetframe1, text="!!!BUDGET EXCEEDED!!!")  
                budgetlabel2.grid(row = 5, column = 1, pady =2)
                # budgetlabel2.config(bg="Red")
            else:
                budgetlabel2 = ttk.Label(budgetframe1, text="Message :")  
                budgetlabel2.grid(row = 5, column = 0, pady =2)
                budgetlabel2 = ttk.Label(budgetframe1, text="Budget under control")  
                budgetlabel2.grid(row = 5, column = 1, pady =2)
            income.destroy()


        btn1 = ttk.Button(labelframe2, text = 'Set', command=put) 
        btn1.grid(row=7,column = 0, pady=4)
Exemplo n.º 9
0
import tkinter as tk
from tkinter import ttk
from ttkthemes import ThemedTk
# Download comando: python -m pip install ttkthemes

# autor: backup_python.dev

raiz = ThemedTk(theme="equilux")
v = tk.IntVar()
v.set("")
raiz.geometry("265x188")
raiz.resizable(0, 0)
raiz.title("Radiobutton")
tipo_de_letra = "Helvetica 13"

# LABEL
Etiqueta = ttk.Label(raiz,
                     text="Elige un lenguaje de programación:",
                     font=tipo_de_letra,
                     width=50).pack()
Etiqueta2 = ttk.Label(raiz, width=50).pack()

lenguajes = ["Python", "Java", "C#", "Kotlin", "C++"]


def MostrarEleccion():
    if v.get() == 1:
        print(lenguajes[0])
    elif v.get() == 2:
        print(lenguajes[1])
    elif v.get() == 3:
Exemplo n.º 10
0
                               'Введите запрос в формате city,country_code')
    else:
        params = {
            'appdi': API_KEY,
            'q': entry.get(),
            'units': 'metric',
            'lang': 'ru'
        }
        r = requests.get(API_URL, params=params)
        weather = r.json()
        label['text'] = print_weather(weather)
        print(weather)


# root = ThemedTk(theme="Radiance")
root = ThemedTk(
    theme="radiance")  # Название темы длжно быть написана с маленькой буквы

root.geometry("500x300+800+400")
root.resizable(False, False)

s = ttk.Style()
s.configure('TLabel', padding=5, font='Arial 11')

top_frame = ttk.Frame(root)
top_frame.place(relx=0.5, rely=0.1, relwidth=0.9, relheight=0.1, anchor='n')

entry = ttk.Entry(top_frame)
entry.place(relwidth=0.6, relheight=1)

button = ttk.Button(top_frame, text='Запрос погоды', command=get_weather)
button.place(relx=0.6, relwidth=0.4, relheight=1)
Exemplo n.º 11
0
#https://stackoverflow.com/questions/51060894/adding-a-data-file-in-pyinstaller-using-the-onefile-option
def resource_path(relative_path):
    """ Get absolute path to resource, works for dev and for PyInstaller """
    try:
        # PyInstaller creates a temp folder and stores path in _MEIPASS
        base_path = sys._MEIPASS
    except Exception:
        base_path = os.path.abspath(".")
    return os.path.join(base_path, relative_path)

#------------
#Erzeugung der GUI
#------------

#Erstellt das Fenster mit dem gewünschten Aussehen
window = ThemedTk(theme='arc')
window.resizable(0,0)
window.title("Gruppenfoto 2.0")
window.configure(bg='white')

#Läd das Programmicon
window.iconbitmap(resource_path('logo.ico')) 

#Definiert die gewünschten Schriftarten und Stile der Benutzeroberfläche
fontStyle = tkFont.Font(size=12, family= "Calibri")
fontStyle_label = tkFont.Font(size=15, family='Calibri Light')
ttk.Style().configure(".", padding=6, relief="flat",
   foreground="black", background="white", font=fontStyle)
ttk.Style().configure("TLabel", font=fontStyle_label)
ttk.Style().configure("TEntry", font=fontStyle)
fontStyle_2 = tkFont.Font(size=25, family='Calibri Light')
Exemplo n.º 12
0
def Login():
    root_login = ThemedTk()
    root_login.get_themes()
    root_login.set_theme("arc")

    def BtnLogin():
        user_name = entry_username.get()
        password = entry_password.get()
        try:
            query = cur.execute("SELECT * FROM register_user").fetchall()
            if user_name == str(query[0][1]) and password == str(query[0][2]):
                messagebox.showinfo("Login Successful",
                                    "Welcome to Library Management System")
                root_login.destroy()
                main()
            else:
                messagebox.showerror("Login Fail",
                                     "Check username or password again")
                exit()
        except:
            messagebox.showerror("Login Fail",
                                 "Check username or password again")
            exit()

    #
    # # MenuBar
    # menu_bar = Menu(root_login)
    # root_login.config(menu=menu_bar)
    # file = Menu(menu_bar, tearoff=0)
    # menu_bar.add_cascade(label="File", menu=file)
    # file.add_command(label="Add a Book", )
    # file.add_command(label="Add a Member", )
    # file.add_command(label="Show Member")
    # file.add_command(label="Exit", )

    main_frame = ttk.Frame(root_login, width=400, height=200)
    main_frame.pack(fill=X)

    label_username = Label(main_frame, text="Username:"******"Arial 15 bold")
    label_username.grid(row=0, column=0, padx=(30, 0), pady=(30, 0), sticky=W)

    entry_username = ttk.Entry(main_frame, width=23, font="Arial 13 bold")
    entry_username.grid(row=0, column=1, padx=(20, 0), pady=(30, 0))

    label_password = Label(main_frame, text="Password:"******"Arial 15 bold")
    label_password.grid(row=1, column=0, padx=(30, 0), pady=(15, 0), sticky=W)

    entry_password = ttk.Entry(main_frame, width=23, font="Arial 13 bold")
    entry_password.config(show="*")
    entry_password.grid(row=1, column=1, padx=(20, 0), pady=(15, 0))
    btn_login = Button(root_login,
                       text="Login",
                       font="Arial 13 bold",
                       width=15,
                       bg="#4285f4",
                       fg="#ececec",
                       command=BtnLogin)
    btn_login.place(x=120, y=120)

    root_login.title("Library Management System")
    root_login.geometry("400x200+700+400")
    root_login.resizable(False, False)
    root_login.iconbitmap("image/book_tk.ico")
    root_login.mainloop()
Exemplo n.º 13
0
#

# UNCOMMENT THE FOLLOWING TO SAVE GEOMETRY INFO
# def save_location(e=None):
#     ''' executes at WM_DELETE_WINDOW event - see below '''
#     with open("winfo", "w") as fout:
#         fout.write(root.geometry())
#     root.destroy()

# ttkthemes
# 'alt', 'scidsand', 'classic', 'scidblue',
# 'scidmint', 'scidgreen', 'default', 'scidpink',
# 'arc', 'scidgrey', 'scidpurple', 'clam', 'smog'
# 'kroc', 'black', 'clearlooks'
# 'radiance', 'blue' : https://wiki.tcl-lang.org/page/List+of+ttk+Themes
root = ThemedTk(theme="scidmint")

# change working directory to path for this file
p = os.path.realpath(__file__)
os.chdir(os.path.dirname(p))

# UNCOMMENT THE FOLLOWING TO SAVE GEOMETRY INFO
# if os.path.isfile("winfo"):
#     with open("winfo") as f:
#         lcoor = f.read()
#     root.geometry(lcoor.strip())
# else:
#     root.geometry("400x300") # WxH+left+top


root.title("Tkinter Demo")
Exemplo n.º 14
0
from tkinter import ttk  # Normal Tkinter.* widgets are not themed!
from ttkthemes import ThemedTk

window = ThemedTk(theme="equilux")
ttk.Button(window, text="Quit", command=window.destroy).pack()
ttk.Button(window, text="Quit", command=window.destroy).pack()
ttk.Entry(window, text="Quit").pack()

L1 = ttk.Label(window, text="Label")
L1.pack(side="left")
E1 = ttk.Entry(window)
E1.pack(side="right")

window.mainloop()
Exemplo n.º 15
0
from tkinter import *
from tkinter.ttk import *
from ttkthemes import ThemedTk
import os

window = ThemedTk(theme="radiance")
uname = sys.argv[1]
window.title("New Repository")

#window.geometry('500x200')

lbl = Label(window, text="Enter the new file name:")
lbl.grid()
txtfname = Entry(window, width=30)
txtfname.grid(column=10)
# fol=txtfname.get()

# lbl=Label(window,text="Enter the path of folder:",font=("Times New Roman",20))
# lbl.grid(column=0,row=50)
# txtfpath = Entry(window,width=30)
# txtfpath.grid(column=1, row=50)


def btn_submit():
    os.system(
        "g++ -Wall -Wextra C:\\Users\\V\\Desktop\\ConMan\\BackEnd\\newrepoc.cpp && a "
        + txtfname.get() + " " + uname)
    # os.system("g++ -Wall -Wextra newrepo.cpp")
    # os.system("a "+txtfname.get())
    exit()
Exemplo n.º 16
0
    def on_buttonv_clicked(self):
        ''' copy selected item to label '''
        if self.lst.curselection() == ():  # empty tuple means nothing selected
            return  # nothing selected
        list_item = self.lst.curselection()
        fp = self.lst.get(list_item[0])
        self.vlbltext.set(str(fp))

    def on_dblclick_list(self, event):
        ''' action for double clicking the listbox item '''
        list_item = self.lst.curselection()
        fp = self.lst.get(list_item[0])
        print(
            str(fp) + " --> " + str(list_item[0]) + " of " +
            str(self.lst.size()))


# root = Tk()
# Requires ttkthemes module
# 'alt', 'scidsand', 'classic', 'scidblue',
# 'scidmint', 'scidgreen', 'default', 'scidpink',
# 'arc', 'scidgrey', 'scidpurple', 'clam', 'smog'
# 'kroc', 'black', 'clearlooks'
# 'radiance', 'blue' : https://wiki.tcl-lang.org/page/List+of+ttk+Themes
root = ThemedTk(theme="clam")

root.title("Listbox")
app = Application(root)
app.mainloop()
Exemplo n.º 17
0
from scripts.smirnov import Test_Smirnov

from simulation import SimulationApples

from exception import *
import pandas as pd
from pandastable import Table, TableModel
import tkinter.scrolledtext as scrolledtext
from ttkthemes import ThemedTk

import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg,
                                               NavigationToolbar2Tk)

root = ThemedTk(theme='breeze')  # tema
root.title("Comerciante y manzanas")  # titulo
# tamaño de anchura de toda la ventana del ordenador
screen_width = root.winfo_screenwidth()
# tamaño de la altura toda la ventana del ordenador
screen_height = root.winfo_screenheight()
root.geometry(f"{screen_width}x{screen_height}")
root.minsize(1200, 700)

# root.iconbitmap('/logo.ico')


def cleanAll():
    main.wrapperGeneratorTests.pack_forget()
    main.wrapperSimulatorInv.pack_forget()
    main.wrapperHelp.pack_forget()
 def __init__(self):
     self.main_window = ThemedTk(theme="breeze", background=True)
     #CenterScreen(self.main_window)
     self.main_window.protocol("WM_DELETE_WINDOW",
                               lambda: self.main_window.iconify())
     self.main_window.resizable(False, False)
     self.main_window.title("GfxTablet GUI 1.0")
     #Status Group
     self.main_group = ttk.LabelFrame(self.main_window,
                                      text="Server Status",
                                      width=20)
     ##Server Hostname
     ttk.Label(self.main_group, text="Server Name: ",
               width=25).pack(padx=10, pady=(10, 0), anchor="w")
     self.lbl_server_name = ttk.Label(self.main_group, text="NaN")
     self.lbl_server_name.pack(padx=(30, 0), anchor="w")
     ##Server IP
     ttk.Label(self.main_group, text="Server IP: ").pack(padx=10,
                                                         pady=(10, 0),
                                                         anchor="w")
     self.lbl_server_ip = ttk.Label(self.main_group, text="NaN")
     self.lbl_server_ip.pack(padx=(30, 0), anchor="w")
     ##Screen Resolution
     ttk.Label(self.main_group, text="Selected Screen: ").pack(padx=10,
                                                               pady=(10, 0),
                                                               anchor="w")
     self.lbl_screen_resolution = ttk.Label(self.main_group, text="NaN")
     self.lbl_screen_resolution.pack(padx=(30, 0), anchor="w")
     ##Status
     ttk.Label(self.main_group, text="Status: ").pack(padx=10,
                                                      pady=(10, 0),
                                                      anchor="w")
     self.lbl_status = ttk.Label(self.main_group, text="Waiting")
     self.lbl_status.pack(padx=(30, 0), anchor="w")
     ##Refresh Button
     self.btn_refresh = ttk.Button(self.main_group,
                                   text="Refresh",
                                   command=self.refresh)
     self.btn_refresh.pack(pady=(20, 5))
     ##Help Button
     self.btn_help = ttk.Button(self.main_group,
                                text="Help",
                                command=self.help)
     self.btn_help.pack(pady=(5, 5))
     ##About Button
     self.btn_about = ttk.Button(self.main_group,
                                 text="About",
                                 command=self.show_about)
     self.btn_about.pack(pady=(5, 5))
     ##Exit Button
     self.btn_close = ttk.Button(self.main_group,
                                 text="Quit",
                                 command=self.exit_program)
     self.btn_close.pack(pady=(5, 5))
     ##Download APK
     self.lbl_down_apk = Label(self.main_group,
                               text="Download GfxTablet\nAndroid Package",
                               fg="blue",
                               font="Verdana 9 underline",
                               cursor="hand2")
     self.lbl_down_apk.bind("<1>", self.down_apk)
     self.lbl_down_apk.pack(pady=5)
     #End Status Group
     self.main_group.pack(expand=False,
                          fill="both",
                          padx=(10, 5),
                          pady=10,
                          side="left")
     #Log Group
     self.log_group = ttk.LabelFrame(self.main_window, text="Logs")
     ##Log Text
     self.txt_log = Text(self.log_group,
                         width=50,
                         bg="white",
                         relief="solid",
                         font=("Verdana", 10))
     self.txt_log.pack(expand=True,
                       fill="both",
                       padx=5,
                       pady=5,
                       side="left")
     self.txt_scrollbar = ttk.Scrollbar(self.log_group,
                                        command=self.txt_log.yview)
     self.txt_log.config(yscrollcommand=self.txt_scrollbar.set)
     self.txt_scrollbar.pack(expand=True, fill="y", side="left")
     #End Log Group
     self.log_group.pack(expand=True,
                         fill="both",
                         padx=(10, 5),
                         pady=10,
                         side="right")
     self.load_values()
     threading.Thread(target=self.connect_cli).start()
     #Check Sudo
     if not os.geteuid() == 0:
         self.main_window.withdraw()
         messagebox.showerror(
             "Error", "You need root permissions to using GfxTablet GUI")
         exit()
     self.center_screen(self.main_window)
     self.main_window.mainloop()
Exemplo n.º 19
0
    def __init__(self, Book_ManegementFrame):

        self.root = ThemedTk(theme="equilux")

        #Setting the Title
        self.root.title("Library Management System")

        #Setting the icon
        self.root.iconbitmap('src\\picture\\library.ico')

        #Get the screen resolution
        self.x = self.root.winfo_screenwidth()
        self.y = self.root.winfo_screenheight()

        #Get the value for windows size
        self.x1 = self.x * (4 / 9)
        self.y1 = self.y * (5 / 11)

        #Get the value for Starting point for windows
        self.x2 = self.x * (3 / 11)
        self.y2 = self.y * (2 / 9)

        self.root.geometry("%dx%d+%d+%d" %
                           (self.x1, self.y1, self.x2, self.y2))
        self.root.resizable(False, False)

        #Easy for configure within attribute
        self.x1 = int(self.x1)
        self.y1 = int(self.y1)

        #Setting Entry variable
        self.nameBook = StringVar()
        self.price = StringVar()
        self.type = StringVar()
        self.author = StringVar()
        self.workplace = StringVar()
        self.publisher = StringVar()
        self.address = StringVar()

        self.style = ttk.Style()
        self.style.configure("Title.TLabel", foreground="snow")
        self.style.configure("Nav.TButton",
                             font=("Cascadia Code SemiBold", 12))
        self.style.configure("Content.TFrame",
                             foreground="black",
                             background="LightSkyBlue2")
        self.style.configure("Content.TLabel",
                             foreground="black",
                             background="LightSkyBlue2")
        self.style.configure("Nav.TFrame",
                             foreground="black",
                             background="SeaGreen1")

        self.content_frame = ttk.Frame(self.root, style="Content.TFrame")
        self.content_frame.place(relwidth=1, relheight=1)

        self.idBookLabel = ttk.Label(self.content_frame,
                                     text="Book ID :",
                                     font=("Cascadia Code SemiBold", 12),
                                     style="Content.TLabel")
        self.idBookLabel.place(relx=0.3, rely=0.05)

        self.idBookEntry = ttk.Label(self.content_frame,
                                     text="%s" % Book_ManegementFrame.idbook,
                                     font=("Cascadia Code", 12),
                                     style="Content.TLabel")
        self.idBookEntry.place(relx=0.43, rely=0.05)

        self.nameBookLabel = ttk.Label(self.content_frame,
                                       text="Name :",
                                       font=("Cascadia Code SemiBold", 12),
                                       style="Content.TLabel")
        self.nameBookLabel.place(relx=0.34, rely=0.15)

        self.nameBookEntry = ttk.Entry(self.content_frame,
                                       font=("Cascadia Code", 12),
                                       textvariable=self.nameBook)
        self.nameBookEntry.place(relx=0.43, rely=0.15)

        self.priceLabel = ttk.Label(self.content_frame,
                                    text="Price :",
                                    font=("Cascadia Code SemiBold", 12),
                                    style="Content.TLabel")
        self.priceLabel.place(relx=0.327, rely=0.25)

        self.priceEntry = ttk.Entry(self.content_frame,
                                    font=("Cascadia Code", 12),
                                    textvariable=self.price)
        self.priceEntry.place(relx=0.43, rely=0.25)

        self.typeLabel = ttk.Label(self.content_frame,
                                   text="Type :",
                                   font=("Cascadia Code SemiBold", 12),
                                   style="Content.TLabel")
        self.typeLabel.place(relx=0.34, rely=0.35)

        self.typeEntry = ttk.Entry(self.content_frame,
                                   font=("Cascadia Code", 12),
                                   textvariable=self.type)
        self.typeEntry.place(relx=0.43, rely=0.35)

        self.authorLabel = ttk.Label(self.content_frame,
                                     text="Author :",
                                     font=("Cascadia Code SemiBold", 12),
                                     style="Content.TLabel")
        self.authorLabel.place(relx=0.15, rely=0.45)

        self.authorEntry = ttk.Entry(self.content_frame,
                                     font=("Cascadia Code", 12),
                                     textvariable=self.author)
        self.authorEntry.place(relx=0.26, rely=0.45, relwidth=0.2)

        self.workplaceLabel = ttk.Label(self.content_frame,
                                        text="Workplace :",
                                        font=("Cascadia Code SemiBold", 12),
                                        style="Content.TLabel")
        self.workplaceLabel.place(relx=0.5, rely=0.45)

        self.workplaceEntry = ttk.Entry(self.content_frame,
                                        font=("Cascadia Code", 12),
                                        textvariable=self.workplace)
        self.workplaceEntry.place(relx=0.65, rely=0.45, relwidth=0.2)

        self.publisherLabel = ttk.Label(self.content_frame,
                                        text="Publisher :",
                                        font=("Cascadia Code SemiBold", 12),
                                        style="Content.TLabel")
        self.publisherLabel.place(relx=0.11, rely=0.55)

        self.publisherEntry = ttk.Entry(self.content_frame,
                                        font=("Cascadia Code", 12),
                                        textvariable=self.publisher)
        self.publisherEntry.place(relx=0.26, rely=0.55, relwidth=0.2)

        self.addressLabel = ttk.Label(self.content_frame,
                                      text="Address :",
                                      font=("Cascadia Code SemiBold", 12),
                                      style="Content.TLabel")
        self.addressLabel.place(relx=0.528, rely=0.55)

        self.addressEntry = ttk.Entry(self.content_frame,
                                      font=("Cascadia Code SemiBold", 12),
                                      textvariable=self.address)
        self.addressEntry.place(relx=0.65, rely=0.55, relwidth=0.2)

        self.updateButton = ttk.Button(self.content_frame,
                                       text="Update",
                                       style="Nav.TButton")
        self.updateButton.place(relx=0.45, rely=0.7)

        self.root.mainloop()
Exemplo n.º 20
0
    McVers = natsorted(McVers)
    McVers.reverse()
    McVers.insert(0, Config.Config["LastSelected"]) #using a bug in ttk to our advantage
    ListVariable = StringVar(MainWindow)
    Ver_List = ttk.OptionMenu(MainWindow, ListVariable, *McVers)
    Ver_List.configure(width=Config.ListLen) #only way i found of maintaining same width
    Ver_List.grid(row=10, column=0, sticky=W)

#The creation of the main window
if __name__ == '__main__':
    if Config.RPCEnable:
        RPC = Presence(Config.ClientId)
        RPC.connect()
        DefaultPresence()
    ConfigLoad()
    MainWindow = ThemedTk(theme=Config.Theme)
    Update()
    #Styles
    s = ttk.Style()
    s.configure('TButton', background=Config.FG_Colour, fieldbackground=Config.FG_Colour)
    s.configure('TCheckbutton', background=Config.BG_Colour, foreground="white")
    s.configure('TEntry', fieldbackground=Config.FG_Colour, background=Config.FG_Colour)

    MainWindow.configure(background=Config.BG_Colour) # sets bg colour
    MainWindow.title("PyMyMC") # sets window title
    if System == "Windows":
        #other systems dont use ico
        MainWindow.iconbitmap(Path.Logo_Icon) # sets window icon
    MainWindow.resizable(False, False) #makes the window not resizable
    MainWindow.protocol("WM_DELETE_WINDOW", ExitHandler) #runs the function when the user presses the X button
Exemplo n.º 21
0
# A starter program for Python with Tkinter
# A starter program for Python with Tkinter

from tkinter import *
from tkinter.ttk import *
from ttkthemes import ThemedTk

window = ThemedTk(theme="elegance")

window.title("smiley face")

window.geometry('350x200')
chk_state = BooleanVar()

chk_state.set(True)  #set check state

chk = Checkbutton(window, text='Choose', var=chk_state)

chk.grid(column=0, row=0)
combo = Combobox(window)

combo['values'] = (1, 2, 3, 4, 5, "secret")

combo.current(1)  #set the selected item

combo.grid(column=0, row=0)

lbl = Label(window, text="a weird botton")

lbl.grid(column=0, row=0)
Exemplo n.º 22
0
                           column=1,
                           padx=5,
                           pady=5,
                           sticky=W + E + N + S,
                           columnspan=2)

        self.login = ttk.Button(self.mainFrame,
                                text='Login',
                                style='TButton',
                                command=self.auth)
        self.login.grid(row=4,
                        column=1,
                        padx=5,
                        pady=5,
                        sticky=W + E + N + S,
                        columnspan=2)

        self.lSpace = ttk.Label(self.mainFrame, width=4)
        self.lSpace.grid(row=0, column=0, pady=50)

        self.rSpace = ttk.Label(self.mainFrame, width=10)
        self.rSpace.grid(row=5, column=3, pady=100)

        bind_id = mainWin.bind('<Return>', self.auth)


mainWin = ThemedTk(theme='arc')
mainWin.resizable(False, False)
mainWin.geometry('500x500+200+150')
atm(mainWin)
mainWin.mainloop()
# Importing Are Modules:
from tkinter import *
from ttkthemes import ThemedTk, THEMES
from tkinter import ttk
conversion_can_do = ('png', 'gif', 'tiff', 'ico', 'jpg', 'bmp'
                     )  # Formats That This Converter Can Do.
conversion_can_do_with_pdf = ('png', 'gif', 'tiff', 'ico', 'jpg', 'bmp', 'pdf'
                              )  # Formats That This Converter Can Do.
from tkinter import filedialog
from PIL import Image
import os  # arc
root = ThemedTk(themebg=True)  # Our Main Window.
root.set_theme('arc')
opend_file_path = ttk.Label(
    root, text=None)  # Creating Label For Showing Path Of Opened File.
saved_file_path = ttk.Label(
    root, text=None)  # Creating Label For Showing Path Of Saved File.
root.maxsize(500, 200)  # Maxsize Of Our Window is height=400,width=200
root.minsize(500, 200)  # Minsize Of Our Window is height=400,width=200
Slect_FILE_FROM_DONW_BELOW_OPTIOn = ttk.Label(
    root,
    text=
    'Select A Fromat To Import From Down Below Than Select File Type To Save'
)  # This Is Our Heading That Tells How To Use This Converter.
Slect_FILE_FROM_DONW_BELOW_OPTIOn.pack(
)  # Showing Our Label In Our Main Window That Means I Am Packing The Label.


def tkinter_window_is_closed(
):  # A Function That Ask Are You Sure Quit? When User Closes The Window.
    from tkinter import messagebox  # Importing messagebox For Asking Question.
Exemplo n.º 24
0
    'breeze',
    'clearlooks',
    'elegance',
    'equilux',
    'itft1',
    'keramik',
    'kroc',
    'plastik',
    'radiance',
    'scid themes',
    'smog',
    'winxpblue',
    'yaru'
]

root = ThemedTk(theme=Themes[2])
menubar = Menu(root)
filemenu = Menu(menubar, tearoff=0)
filemenu.add_command(label="New", command=donothing)
filemenu.add_command(label="Open", command=donothing)
filemenu.add_command(label="Save", command=donothing)
filemenu.add_command(label="Save as...", command=donothing)
filemenu.add_command(label="Close", command=donothing)

filemenu.add_separator()

filemenu.add_command(label="Exit", command=root.quit)
menubar.add_cascade(label="File", menu=filemenu)
editmenu = Menu(menubar, tearoff=0)
editmenu.add_command(label="Undo", command=donothing)
Exemplo n.º 25
0
from tkinter import *
from tkinter import ttk
from tkinter import messagebox
from ttkthemes import ThemedTk

window = ThemedTk(theme='clearlooks')
window.title('Форма регистрации')
window.resizable(False, False)


def window_exit():
    answer = messagebox.askokcancel(title='Выход', message="Закрыть программу?")
    if answer:
        window.destroy()


def print_data():
    messagebox.showinfo("Зарегистрирован!", e_user.get() + " " + e_pass.get())
    login = e_user.get()
    passw = e_pass.get()
    print(login)
    print(passw)


l_user = ttk.Label(window, text='Login').grid(row=0, column=0, padx=10, pady=10, sticky=W)
e_user = ttk.Entry(window)
e_user.grid(row=0, column=1, columnspan=2, padx=10, sticky=W+E)

l_pass = ttk.Label(window, text='Password:').grid(row=1, column=0, padx=10, pady=10)
e_pass = ttk.Entry(window)
e_pass.grid(row=1, column=1, columnspan=2, padx=10, sticky=W+E)
Exemplo n.º 26
0
from tkinter import *
from tkinter import filedialog
from tkinter import messagebox
import pandas as pd
from tkinter import ttk
from ttkthemes import ThemedTk
import tkinter.font as tkFont

#root= ThemedTk(theme="scid themes")
#root= ThemedTk(theme="radiance")
#root= ThemedTk(theme="elegance")
root = ThemedTk(theme="clearlooks")
#root= ThemedTk(theme="breeze")
#root= ThemedTk(theme="aquativo")
root.geometry('400x300+400+230')
root.title('File Conversion Tool')

count = 0
sliderwords = " "


def labelslider():
    global count, sliderwords
    text = 'File Conversion Tool'
    if (count >= len(text)):
        count = 0
        sliderwords = ''
    sliderwords += text[count]
    count += 1
    label1.configure(text=sliderwords)
    label1.after(150, labelslider)
import tkinter as tk
from tkinter import ttk  # Normal Tkinter.* widgets are not themed!
from ttkthemes import ThemedTk
from tkinter import messagebox
from pytube import YouTube
from PIL import ImageTk, Image
import requests
import urllib.parse
import io
import time
from tkinter import filedialog
import os
import threading


root = ThemedTk(theme="radiance")
root.title("Youtbe video downloader")
root.geometry('670x340')
root.maxsize(670, 340)
root.minsize(670, 340)
root.iconbitmap('images/youtube-downloader.ico')
root.configure(bg='#100E17')

text = tk.Label(root, text="Download Video and Audio from YouTube",
                font='Helvetica 15 bold', bg="#100E17", fg="white")
text.pack()

status = tk.Label(root, text="Status bar", font='Helvetica 10',
                  relief='sunken', anchor="w",bg="#312D3C",fg="white")
status.pack(side="bottom", fill='x')
Exemplo n.º 28
0
        button_next = ttk.Button(
            frame_pos_google, text=">>", command=lambda: forward(href_number + 1)
        ).grid(row=0, column=5, padx=10)
    else:
        v.set(resultarr[href_number])
        button_prev = ttk.Button(
            frame_pos_google, text="<<", command=lambda: back(href_number - 1)
        ).grid(row=0, column=0, padx=10)
        button_next = ttk.Button(
            frame_pos_google, text=">>", command=lambda: forward(href_number + 1)
        ).grid(row=0, column=5, padx=10)


# Creating the Root window with "BLACK" theme

root = ThemedTk(theme="black")

# For Styling Buttons in ttk
s = ttk.Style()
s.configure("TButton", anchor=tk.CENTER)


height = root.winfo_screenheight()
width = root.winfo_screenwidth()
root.title("ChotaPacket")
root.geometry("%dx%d+0+0" % (width, height))

# Adding an image icon to root that works both on all os
# if iconbitmap is used then in UBUNUTU only black and white images of xbm format can be used

root.tk.call(
Exemplo n.º 29
0
from tkinter import ttk
from ttkthemes import ThemedTk


# used to hide / show the feather
def updateFeather():
    if pic.winfo_viewable():
        pic.grid_remove()
        namelbl.grid_remove()
    else:
        pic.grid()
        namelbl.grid()


# create the root window
root = ThemedTk(theme="breeze")
root.title("Feather Window")
root.option_add('*tearOff', FALSE)  # so the menu doesn't look weird

# create the main frame of the program and the sub frame
content = ttk.Frame(root)
subframe = ttk.Frame(content, borderwidth=5, relief='sunken')

# create a menu
menubar = Menu(root)
sub1 = Menu(root)

menubar.add_cascade(label="test1", menu=sub1)

sub1.add_command(label='a')
sub1.add_command(label='b')
Exemplo n.º 30
0
from tkinter import ttk  # Normal Tkinter.* widgets are not themed!
from ttkthemes import ThemedTk

window = ThemedTk(theme="arc")
ttk.Button(window, text="Quit", command=window.destroy).pack()
window.mainloop()