コード例 #1
0
ファイル: main.py プロジェクト: AtakamaLLC/passman
def main():
    THEME = "blue"

    if THEME in ThemedTk.pixmap_themes:
        root = ThemedTk(theme=THEME)
    else:
        root = tk.Tk()
        ttk.Style(root).theme_use(THEME)

    root.title("Password Manager for Encrypted Mount")

    assets = Path(__file__).parent / "assets"

    photo = tk.PhotoImage(file=assets / "icon.png")
    root.iconphoto(False, photo)

    path_to_my_project = sys.argv[-1]

    sup = MainWindow(root, path=path_to_my_project)

    try:
        sup.mainloop()
    finally:
        sup.done()
        pubsub.shutdown(wait=False)
コード例 #2
0
ファイル: mcpil.py プロジェクト: leha-code/MCPIL
def main():
    if platform.system() != 'Linux':
        showerror('Error', 'Linux Is Required')
        return 1

    global window

    window = ThemedTk(theme='equilux', className='mcpil')
    window.title('MCPIL')
    window.geometry('512x400')
    window.resizable(True, True)

    # Set icon in taskbar
    window.iconphoto(True, PhotoImage(file="/usr/share/pixmaps/mcpil.png"))

    tabs = ttk.Notebook(window)
    tabs.add(play_tab(tabs), text='Play')
    tabs.add(features_tab(tabs), text='Features')
    tabs.add(multiplayer_tab(tabs), text='Multiplayer')
    tabs.add(settings_tab(tabs), text='Settings')
    tabs.add(about_tab(tabs), text='About')
    tabs.pack(fill=BOTH, expand=True)

    load()
    save()

    window.wm_protocol('WM_DELETE_WINDOW', quit)
    signal.signal(signal.SIGINT, lambda *args: quit())

    try:
        window.mainloop()
    except KeyboardInterrupt:
        quit()

    return 0
コード例 #3
0
class FrontEnd:
    APP_WIDTH = 400
    APP_HEIGHT = 450
    PROJECT_PATH = os.getcwd()

    def __init__(self, inputs, main_script):
        self.root = ThemedTk(theme="equilux")
        self.root.geometry(f"{self.APP_WIDTH}x{self.APP_HEIGHT}")
        self.root.resizable(False, False)
        self.root.title('Gui Scripter')
        icon = ImageTk.PhotoImage(
            Image.open(os.path.join(self.PROJECT_PATH, 'static/rob_icon.png')))
        self.root.iconphoto(False, icon)

        self.app_frame = ttk.Frame(self.root,
                                   width=self.APP_WIDTH,
                                   height=self.APP_HEIGHT)
        self.app_frame.pack(expand=True, fill='both')

        main_image = ImageTk.PhotoImage(
            Image.open(os.path.join(self.PROJECT_PATH, 'static/rob.png')))
        panel = tk.Label(self.app_frame, image=main_image, bg='#464646')
        panel.pack()

        self.inputs_dict = {}
        self.label_dict = {}
        for input_name in inputs:
            self.inputs_dict[input_name] = ttk.Entry(self.app_frame)
            self.label_dict[input_name] = ttk.Label(self.app_frame,
                                                    text=input_name)
            self.label_dict[input_name].pack(anchor='center')
            self.inputs_dict[input_name].pack(anchor='center', pady=2)

        self.run_script_button = ttk.Button(self.app_frame,
                                            text="Run !",
                                            command=main_script,
                                            takefocus=0)
        self.run_script_button.pack(anchor='center', pady=15)

        self.progress_bar = ttk.Progressbar(self.app_frame,
                                            orient="horizontal",
                                            length=self.APP_WIDTH - 100,
                                            mode='determinate')
        self.progress_bar.pack(side='top', padx=0, pady=35, anchor='n')

        self.root.mainloop()
コード例 #4
0
def main():
	datos = None
	if len(sys.argv) > 1: #esto lo usaba para llamar el programa para pruebas con argumentos, no lo vamos a usar.
		datos = {}
		datos["semilla"] = int(sys.argv[1])
		datos["constante"] = int(sys.argv[2])
		datos["multiplicador"] = int(sys.argv[3])
		datos["modulo"] = int(sys.argv[4])
		datos["tamano"] = int(sys.argv[5])

	#root = Tk() #el holder de la gui
	root = ThemedTk(theme='clearlooks')
	root.geometry("690x405") # tamanio de la ventana
	
	#poner icono
	icono = utils.to_dir_file_local('interfaz', 'icono.png')
	img = PhotoImage(file=icono)
	root.iconphoto(False, img)

	app = Ventana(root) # ventana es una clase en el folder interfaz, estoy haciendo una instancia.
	root.mainloop() # correr la gui
コード例 #5
0
    subprocess.Popen(array)

    # NB: don't close window

# create the main window (titlebar and frame)
# https://ttkthemes.readthedocs.io/en/latest/themes.html
main_window = ThemedTk(theme="equilux")
main_window.title("APOD_Linux config")
main_window.columnconfigure(0, weight=1)
main_window.rowconfigure(0, weight=1)
main_window.resizable(False, False)

# set main womdow's icon
icon = PhotoImage(
    file = "/usr/share/icons/hicolor/128x128/apps/apod_linux_icon.png")
main_window.iconphoto(False, icon)

# register the validate function with the main window (%S is the user input,
# whether typed or pasted)
validate_func = (main_window.register(validate), "%S")

# set variables/defults
# NB: needs to be done after main window creation
var_enabled = IntVar()
var_enabled.set(1)
var_delay = IntVar()
var_delay.set(30)
var_caption = IntVar()
var_caption.set(1)
var_color_r = IntVar()
var_color_r.set(255)
コード例 #6
0
import random
import tkinter as tk
import tkinter.ttk as ttk
from tkinter.messagebox import *
from tkinter import *
from tkinter.ttk import *
from ttkthemes import ThemedTk
import re
from cryptography.fernet import Fernet

#win = tk.Tk()
win = ThemedTk(theme="radiance")
win.title('Password Generator')

photo = PhotoImage(file="Security-Password-1-icon.png")
win.iconphoto(False, photo)

pas = ''
tok = ''
dec = ''


#-------------------------------------<Password Generator>--------------------------------------------------------------
def generate():
    website = entry0.get()
    email = entry1.get()
    string = entry.get()
    username = entry2.get()
    string = string.capitalize()
    password = ''
    l = ['@', '#', '$', '%', '.']
コード例 #7
0
    timeVar.set("Date: " + data["Time"])
    temperatureVar.set("Température: " + data["Temperature"] + " °C")
    pressureVar.set("Pression: " + data["Pressure"] + " hPa")
    humidityVar.set("Humidité: " + data["Humidity"] + " %")
    updateXslx()  # Et ensuite de mettre les valeurs dans le fichier Excel


def close():
    """Fonction pour fermer la fenetre correctement"""
    main.destroy()
    excelwb.close()


main.title('Station météo')
main.geometry('515x615')  # 350x100
main.iconphoto(True, PhotoImage(file="gui/resources/icon.png"))
style = ThemedStyle(main)
main.protocol('WM_DELETE_WINDOW', close)
reloadData()
# sense.stick.direction_any = reloadData

timeLabel = Label(main,
                  textvariable=timeVar)  # On crée un label qui affiche la date
timeLabel.grid(row=0, column=0, columnspan=3)

temperatureLabel = Label(
    main,
    textvariable=temperatureVar)  # On crée un label qui affiche la température
temperatureLabel.grid(row=1, column=0)

pressureLabel = Label(
コード例 #8
0
import os
from image_master import ImageMaster
from tkinter import ttk
from tkinter import filedialog
import tkinter as tk
from ttkthemes import ThemedTk
import math
from tkinter import colorchooser
from tkinter import messagebox
from reinit_app import reinit_app

GREY = "#dddddd"
FONT_DATA = ("TkMenuFont", 10, "normal")
window = ThemedTk(theme="arc", background=True)
window.iconphoto(False, tk.PhotoImage(file='assets/images/default_imgs/icon.png'))
window.title("OpenWater")
window.config(padx=50, pady=50)
image_controller = ImageMaster()
font_colour = ("black", "black")
text_rotation_angle = 0


def plus_angle():
    global text_rotation_angle
    text_rotation_angle += 10
    rotation_label.config(text=f"{text_rotation_angle}°")


def minus_angle():
    global text_rotation_angle
    text_rotation_angle -= 10
コード例 #9
0
ファイル: app.py プロジェクト: tushargithub44/SpendMate
# Database Maker:
makedatabase()

from Main_Window.theme import ttk_theme
from Main_Window.balance import *
from Main_Window.income import *
from Main_Window.budget import *
from Main_Window.goals import *
from Main_Window.analysis import *
from Main_Window.expense import *
from Menubar.menuFunctions import *
from Menubar.menuOthers import *

root = ThemedTk(theme=ttk_theme, themebg=True)
root.title("SpendMate - Your Money Manager")
root.iconphoto(True, tk.PhotoImage(file='SpendMate1.png'))
root.resizable(False, False)
img = ImageTk.PhotoImage(PIL.Image.open("SpendMate1.png"))
panel = tk.Label(root, image=img)
panel.grid(row=0, column=0, columnspan=4)

tlabel = ttk.Label(root, text="Welcome to SpendMate :)")
tlabel.grid(row=0, column=1, columnspan=8, pady=2)
tlabel.config(font=("Comic Sans MS", 25))

menubar = Menu(root)
# Function menu
callmenuFunc(menubar, root)
# Others menu
callmenuOther(menubar)
root.config(menu=menubar)
コード例 #10
0
ファイル: app.py プロジェクト: beb7/gflare-tk
def main():
    # Check if Greenflare has been launched as part of a binary bundle as this
    # impacts the working_dir
    if getattr(sys, 'frozen', False):
        Defaults.set_working_dir(path.dirname(sys.executable))
    else:
        Defaults.set_working_dir(path.dirname(path.realpath(__file__)))

    # Linux specific settings
    if sys.platform == 'linux':

        import importlib
        check = importlib.util.find_spec("ttkthemes")

        # Use arc theme if available
        if check:
            from ttkthemes import ThemedTk
            root = ThemedTk(theme=Defaults.linux_theme)
        else:
            root = tk.Tk()

        # This ugly step is needed to initialise the filemanager variables we
        # are setting below
        try:
            root.tk.call('tk_getOpenFile', '-foobarbaz')
        except TclError:
            pass

        # Disable hidden files in file dialogues by default but show option to
        # show them
        root.tk.call('set', '::tk::dialog::file::showHiddenBtn', '1')
        root.tk.call('set', '::tk::dialog::file::showHiddenVar', '0')

    else:
        root = tk.Tk()

    root.geometry("1024x768")
    # macOS tkinter cannot handle iconphotos at the time being, disabling it
    # for now
    if sys.platform != "darwin":
        root.iconphoto(False, tk.PhotoImage(file=Defaults.root_icon()))

    globalLock = Lock()
    crawl_items = Defaults.crawl_items
    Settings = Defaults.settings.copy()
    Crawler = GFlareCrawler(settings=Settings, gui_mode=True, lock=globalLock)

    app = mainWindow(root, crawler=Crawler)

    # running on macOS
    if sys.platform == "darwin":
        # Use TK's Apple Event Handler to react to clicked/open documents
        root.createcommand("::tk::mac::OpenDocument", app.open_file_on_macos)

    # Parse and load db file if provided
    parser = argparse.ArgumentParser()
    parser.add_argument("file_path", type=Path, nargs='*')

    p = parser.parse_args()

    if p.file_path and p.file_path[0].exists():
        app.load_crawl(db_file=p.file_path[0])

    root.protocol("WM_DELETE_WINDOW", app.on_closing)
    root.mainloop()