Esempio n. 1
0
def confirmation_popup(spend_output):
    popup = ttk.Tk()
    popup.wm_title("Please confirm your transaction")
    label = ttk.Label(popup,
                      text="You're about to spend: " +
                      str(spend_output["vout"][0]["value"]) + " " + ac_name)
    label2 = ttk.Label(
        popup,
        text="Destination address: " +
        str(spend_output["vout"][0]["scriptPubKey"]["addresses"][0]))
    label3 = ttk.Label(popup,
                       text="Input txid: " +
                       str(spend_output["vin"][0]["txid"]))
    if spend_output["retcodes"][0] == 0:
        label4 = ttk.Label(popup, text="Input notarized")
    else:
        label4 = ttk.Label(popup, text="Input NOT notarized")
    label5 = ttk.Label(popup, text="Tx fee: 0.0001 " + ac_name)
    label6 = ttk.Label(popup,
                       text="Rewards: " + str(spend_output["rewards"]) + " " +
                       ac_name)
    label.pack(side="top", fill="x", pady=10)
    label2.pack(side="top", fill="x", pady=10)
    label3.pack(side="top", fill="x", pady=10)
    label4.pack(side="top", fill="x", pady=10)
    label5.pack(side="top", fill="x", pady=10)
    label6.pack(side="top", fill="x", pady=10)
    button1 = ttk.Button(
        popup,
        text="Confirm",
        command=lambda: confirm_broadcasting(spend_output, popup))
    button2 = ttk.Button(popup, text="Cancel", command=popup.destroy)
    button1.pack()
    button2.pack()
    popup.mainloop()
Esempio n. 2
0
def display():
    db = sqlite3.connect('stform3.db')
    with db:
        cursor = db.cursor()
        window = ttk.Tk()
        window.geometry("400x250")

    select = cursor.execute('''SELECT * from STFORM3 ''')
    i = 0
    for STFORM3 in select:
        for j in range(len(STFORM3)):
            e = Entry(my_w, width=10, fg='blue')
            e.grid(row=i, column=j)
            e.insert(END, STFORM3[j])
        i = i + 1
Esempio n. 3
0
    def __init__(self, controller):
        # create a window
        self.window = ttk.Tk()
        style = ttk.Style()
        style.theme_use('classic')
        # set window title
        self.window.title("TicTacToe - " + controller.player.getName())
        # store the controller in an attribute
        self.controller = controller
        # create 3x3 buttons for the fields of the board and store them in a list
        self.buttons = []
        for row in range(0,3):
            buttonRow = []
            for col in range(0,3):
               # create the button and add it to the window
               b = self.addButton(row,col)
               # store the button in buttonRow
               buttonRow.append(b)
            self.buttons.append(buttonRow)
        # self.buttons is now of the form [ [button, button, button], [button, button, button], [button, button, button] ]

        # 6.3: create label and position it
        self.label = ttk.Label(self.window)
        self.label["text"] = "State of the Game"
        self.label.place(relx = 0, rely = 3/5, relheight = 1/5, relwidth = 1)

        # create 2 buttons for a new game as player 1/2 and add it to the window
        b1 = ttk.Button(self.window)
        b2 = ttk.Button(self.window)
        # set the text of the buttons
        b1["text"] = "New Game as 1"
        b2["text"] = "New Game as 2"
        # position them at the bottom
        b1.place(relx = 0, rely=4/5, relheight=1/5)
        b2.place(relx = 1/2, rely=4/5, relheight=1/5)
        # set the statement to execute when the buttons are pressed
        b1["command"] = lambda:controller.notifyNewGamePressed(1)
        b2["command"] = lambda:controller.notifyNewGamePressed(2)
Esempio n. 4
0
        padding = 15
        self.window = Toplevel(padx=padding, pady=padding)
        title = 'New Scatterer'
        self.window.wm_title(title)
        self.window.attributes("-topmost", True)
        self.header = tk.Label(self.window, 
                               text = 'Enter a name for the scatterer.')
        self.header.pack(side=TOP)
        self.name = StringVar()
        self.name_entry = tk.Entry(self.window, 
                                   width = 20, 
                                   textvariable = self.name)
        self.name_entry.pack(side=TOP)
        self.done = tk.Button(self.window, 
                              text='Done', 
                              command = self.Done)
        self.done.pack(side=TOP)
        self.name_entry.focus()
        
    def Done(self):
        name = self.name.get() 
        self.controller.newScatterer(name)
        self.parent.cbox.set(name)
        self.controller.setCurrentScatterer(name)
        self.window.destroy()

if __name__ == "__main__":
    mainwin = tk.Tk()
    app = View(mainwin)
    mainwin.mainloop()
Esempio n. 5
0
from pydoc import getdoc as _getdoc
import inspect as _inspect
from types import ModuleType, MethodType, FunctionType

import expyriment
from ._internals import get_version

try:
    import tkinter as _tk  # future (Python 3)
except:
    _tk = None

try:
    import tkinter.ttk as _ttk
    # for OS X, if there is no Tile support
    _root = _ttk.Tk()
    _root.destroy()
except:
    _ttk = _tk  # for Python < 2.7 # TODO Python 3 support only


def _get_doc_and_function(obj):
    rtn = []
    for var in dir(obj):
        if not var.startswith("_"):
            rtn.append(var)
    return _getdoc(obj), rtn


def _read_module(mod, doc_dict):
    doc_dict[mod.__name__], classes = _get_doc_and_function(mod)
Esempio n. 6
0
from ttkthemes import themed_tk as tk  # Also imports the normal tk definitions, such as Button, Label, etc.
import tkinter.ttk as ttk  # Imports the themed extensions for Tkinter

window = tk.ThemedTk()

window.get_themes()  # Returns a list of all themes that can be set
window.set_theme("clearlooks")  # Sets an available theme

label = ttk.Label(window, text="This is a themed label")
label2 = ttk.Label(window, text="This is not a themed label")
button = ttk.Button(window, text="Themed exit button", command=window.destroy)
button2 = ttk.Button(window,
                     text="This is not a themed exit button",
                     command=window.destroy)

root = ttk.Tk()
scrollbar = Scrollbar(root)
scrollbar.pack(side=RIGHT, fill=Y)

mylist = Listbox(root, yscrollcommand=scrollbar.set)
for line in range(100):
    mylist.insert(END, "This is line number " + str(line))

mylist.pack(side=LEFT, fill=BOTH)
scrollbar.config(command=mylist.yview)

label.pack()
label2.pack()
button.pack()
button2.pack()