def summonWindow5():

    topFrame = tkinter.Frame(window)
    topFrame.pack(expand=True, fill=tkinter.BOTH,padx=5)
    topFrame.option_add("*Background", backgroundColour)
    bottomFrame = tkinter.Frame(window)
    bottomFrame.pack(side=tkinter.BOTTOM, fill=tkinter.X,padx=5)
    bottomFrame.option_add("*Background", backgroundColour)
    first = tkinter.Label(topFrame, text="Completed", font=(titleFont), fg=foregroundColour)
    first.grid(column=0,row=0, sticky="w")
    label= tkinter.Label(topFrame,text="Your SD card is now ready to run and use Homebrew on your Nintendo DSi.",font=(bodyFont),fg=foregroundColour,wraplength=450,justify="left")
    label.grid(column=0,row=2,sticky="w")
    labellink= tkinter.Label(topFrame,text="You can now eject your SD card and follow the steps of https://dsi.cfw.guide/",font=(bodyFont),fg=foregroundColour,wraplength=450,justify="left")
    labellink.grid(column=0,row=3,sticky="w")
    labellink.bind("<Button-1>", lambda e: webbrowser.open_new("https://dsi.cfw.guide/"))
    label= tkinter.Label(topFrame,text="Credits to",font=(bodyFont),fg=foregroundColour)
    label.grid(column=0,row=4,sticky="w")
    bulletpoints = ["YourKalamity - Creator","NightScript - Idea & writer of dsi.cfw.guide","Emiyl - Writer of dsi.cfw.guide","SNBeast - Testing and pointing out errors","Everybody that helped create the homebrew downloaded by this app","Kaisaan - Yes"]
    w = 5
    for x in bulletpoints:
        label = tkinter.Label(topFrame,text=x,font=(bigListFont),fg=foregroundColour)
        label.grid(column=0,row=w,sticky="w")
        w = w + 1
    label= tkinter.Label(topFrame,text="Press the Close button to Exit",font=(bodyFont),fg=foregroundColour)
    label.grid(column=0,row=w+1,sticky="w")
    finish = Button(bottomFrame, text="Close",width=button_width, fg=foregroundColour,bg=nextButtonColour, font=(buttonFont),command=lambda:[topFrame.destroy(),bottomFrame.destroy(),closeButtonPress(window)])
    finish.pack(side=tkinter.RIGHT, padx=5, pady=5)
    window.protocol("WM_DELETE_WINDOW",lambda:closeButtonPress(window))
def addFactionButton(faction):
    global factionGridCol
    factionGridCol += 1
    imgLocation = 'Images/Factions/{}-icon.png'.format(faction)
    img = PhotoImage(file=imgLocation)
    factionButton = Button(xwingRoot, text='', height=50, width=60, bg='black', focuscolor='white', borderless=True, image=img, command=lambda: getFaction(faction, ''))
    factionButton.grid(row='0', column=str(factionGridCol))
示例#3
0
    def popup_rules(self):
        """Creates 'Rules' button in bottom right of screen, click it opens a popup window with the rules and an 'Okay'
        button to close the window and return to the game."""
        # Toplevel instead of Tk for secondary windows, you can only have one instance of Tk which is your main.
        popup = Toplevel(bg=self.background_color)
        popup.wm_title('Rules')
        popup_text = "Welcome to Numsum!\n" \
                     "The goal is to make a sum of 15 using exactly 3 numbers.\n" \
                     "When a number is chosen by one player, it becomes unavailable to choose for the other player.\n" \
                     "If all the numbers are selected and neither player can make a sum of 15, the game is a draw.\n" \
                     "Good Luck!"
        popup_label = Label(popup,
                            text=popup_text,
                            font=[self.font, 15],
                            bg=self.background_color,
                            fg=self.text_color,
                            justify='center')
        popup_label.pack()

        # .destroy will close that window
        confirm_button = Button(popup,
                                text='Okay',
                                bg=self.button_color,
                                fg=self.text_color,
                                font=[self.font, 15],
                                command=popup.destroy)
        confirm_button.pack()
        popup.mainloop()
示例#4
0
 def __init__(self, master):
     global palette
     Grid.rowconfigure(master, 0, weight=1)
     Grid.columnconfigure(master, 0, weight=1)
     frame=Frame(master, bg = 'black')
     frame.grid(row=0, column=0, sticky=N+S+E+W)
     def contrasting_color(hex_str):
         (r, g, b) = hex_str[1:2], hex_str[3:5], hex_str[5:]
         luminance = (1 - (int(r, 16) * 0.299 + int(g, 16) * 0.587 + int(b, 16) * 0.114) / 255)
         if luminance < 0.5:
             return '#000000'
         else:
             return '#ffffff'
     def btn_click(num, idnum):
         palette.append(num)
         btn_ids[idnum].config(state="disabled")
     color = 0
     btn_ids = []
     for row_index in range(4):
         Grid.rowconfigure(frame, row_index, weight=1)
         for col_index in range(16):
             Grid.columnconfigure(frame, col_index, weight=1)
             btn = Button(frame, bg=_2C02palette[color], text=hex(color), fg=contrasting_color(_2C02palette[color]), borderless = 1, font='GB18030Bitmap', command=lambda txt=hex(color), idn=color: btn_click(txt, idn))
             btn.grid(row=row_index, column=col_index, sticky=N+S+E+W)
             color += 1
             btn_ids.append(btn)
     while True:
         master.update()
         if len(palette) == 3:
             master.destroy()
             break
示例#5
0
class Application(tk.Frame):
    def __init__(self, master=None):
        super().__init__(master)
        self.master = master
        self.pack()
        self.create_widgets()

    def create_widgets(self):
        self.hi_there = Button(self,
                               text="Hello World",
                               bg='lightblue',
                               fg='yellow',
                               borderless=1)
        self.hi_there["command"] = self.say_hi
        self.hi_there.pack(side="top")

        self.quit = Button(self,
                           text="QUIT",
                           bg='red',
                           fg='yellow',
                           borderless=1,
                           command=self.master.destroy)
        self.quit.pack(side="bottom")

    def say_hi(self):
        print("hi there, everyone!")
示例#6
0
def generateInterestQuiz(main, quiz, ops, topicDict, responses):
    # Quiz Header
    Label(quiz, text='Political Alignment Quiz').grid(row=1,
                                                      column=1,
                                                      columnspan=3)
    Label(quiz,
          text='Please rate your interest \
        level in the following issues').grid(row=2, column=1, columnspan=3)

    # Buttons for selecting interest levels in each topic
    rowCount = 3

    for t in topicDict:
        Label(quiz, text=t).grid(row=rowCount, column=1)
        Button (quiz, text="low",command=lambda x=t: enterInterest(responses,'low', x))\
            .grid(row = rowCount, column = 2)
        Button (quiz, text="high", command=lambda x=t: enterInterest(responses,'high', x))\
            .grid(row = rowCount, column = 3)
        rowCount += 1

    #Quiz footer
    Button (quiz, text='Submit interest levels(next)', \
        command=lambda:raise_frame(ops)).grid(row = rowCount, column = 1, columnspan = 3)
    rowCount += 1
    Button (quiz, text='Go to home screen', \
        command=lambda:raise_frame(main)).grid(row = rowCount, column = 1, columnspan = 3)
def enterInterest(responses, topicDict, mail, ops, results, resultsButtons,
                  level, t, oRow, rRow, issue):
    undoHigh = (responses[t].interest == 'high')
    responses[t].interest = level
    if (responses[t].interest == 'high' and not undoHigh):
        flexButts[(t, "lab")] = Label(ops, text=t)
        flexButts[(t,'fir')] = Button (ops, text=topicDict[responses[t].name][0],\
            command=lambda x=t: enterOpinion(responses,topicDict,mail,results,resultsButtons,topicDict[responses[t].name][0], x,rRow,issue))
        flexButts[(t,'sec')] = Button (ops, text=topicDict[responses[t].name][1], \
            command=lambda x=t: enterOpinion(responses,topicDict,mail,results,resultsButtons,topicDict[responses[t].name][1], x,rRowissue))

        col = 1
        for index in ["lab", "fir", "sec"]:
            flexButts[(t, index)].grid(row=oRow[0], column=col)
            col += 1

        oRow[0] += 1
        for index in ['back', "submit", "home"]:
            flexButts[index].grid(row=oRow[0], column=1, columnspan=3)
            oRow[0] += 1
    elif (undoHigh):
        print("trying to forget")
        for index in ["lab", "fir", "sec"]:
            flexButts[(t, index)].grid_forget()
            oRow[0] -= 1
        for index in ['back', "submit", "home"]:
            flexButts[index].grid(row=oRow[0], column=1, columnspan=3)
            oRow[0] += 1

    for response in responses:
        print(response, responses[response].interest)
    print("----end levels---")
示例#8
0
    def create_right_frame_widgets(self):
        self.set_lables_right_frame()
        self.create_radio_button("Maksymalizacja", True, self.max_min_method, 1, 1, "W")
        self.create_radio_button("Minimalizacja", False, self.max_min_method, 1, 1, "E")

        self.range_min = self.create_spinbox(-100, 100, 1, 11, "normal")
        self.range_min.grid(row=2, column=0, padx=(0, 112), sticky="E")

        self.range_max = self.create_spinbox(-100, 100, 1, 11, "normal")
        self.range_max.grid(row=2, column=0, padx=(0, 10), sticky="E")

        self.chromosome_precision = self.create_spinbox(0, 1, 0.01, 28, "normal")
        self.chromosome_precision.grid(row=3, column=0, padx=(0, 10), sticky="E")

        self.population_size = self.create_spinbox(0, 1000, 1, 28, "normal")
        self.population_size.grid(row=4, column=0, padx=(0, 10), sticky="E")

        self.num_of_epochs = self.create_spinbox(0, 1000, 1, 28, "normal")
        self.num_of_epochs.grid(row=5, column=0, padx=(0, 10), sticky="E")

        self.selection_option = ttk.Combobox(self.right_scrollable_frame, values=SELECTION_TYPE, width=20)
        self.selection_option.set("-- Nie wybrano --")
        self.selection_option.grid(row=6, column=0, padx=(0, 18), sticky="E")

        self.crossing_option = ttk.Combobox(self.right_scrollable_frame, values=CROSSING_TYPE, width=20)
        self.crossing_option.set("-- Nie wybrano --")
        self.crossing_option.grid(row=7, column=0, padx=(0, 18), sticky="E")

        self.crossing_precision = self.create_spinbox(0, 10, 0.1, 28, "normal")
        self.crossing_precision.grid(row=8, column=0, padx=(0, 10), sticky="E")

        self.mutation_option = ttk.Combobox(self.right_scrollable_frame, values=MUTATION_TYPE, width=20)
        self.mutation_option.set("-- Nie wybrano --")
        self.mutation_option.grid(row=9, column=0, padx=(0, 18), sticky="E")

        self.mutation_precision = self.create_spinbox(0, 10, 0.1, 28, "normal")
        self.mutation_precision.grid(row=10, column=0, padx=(0, 10), sticky="E")

        self.inversion_precision = self.create_spinbox(0, 10, 0.1, 28, "normal")
        self.inversion_precision.grid(row=11, column=0, padx=(0, 10), sticky="E")

        self.num_of_function_variables = self.create_spinbox(0, 1000, 1, 28, "normal")
        self.num_of_function_variables.grid(row=12, column=0, padx=(0, 10), sticky="E")

        self.tournament_size = self.create_spinbox(0, 1000, 1, 28, "normal")
        self.tournament_size.grid(row=13, column=0, padx=(0, 10), sticky="E")

        self.population_procent = self.create_spinbox(0, 100, 1, 28, "normal")
        self.population_procent.grid(row=14, column=0, padx=(0, 10), sticky="E")

        self.elit_strategy_population_procent = self.create_spinbox(0, 100, 1, 28, "disable")
        self.elit_strategy_population_procent.grid(row=15, column=0, padx=(0, 10), sticky="E")

        self.elit_strategy_population_size = self.create_spinbox(0, 1000, 1, 28, "disable")
        self.elit_strategy_population_size.grid(row=16, column=0, padx=(0, 10), sticky="E")

        self.button2 = Button(self.right_scrollable_frame, text="Start", bg=RIGHT_FRAME_FONT_COLOR, fg="white",
                              borderless=1,
                              takefocus=0, width=round(self.width * 0.55 - 100), command=self.plot)
        self.button2.grid(row=20, columnspan=2, pady=15, sticky="S")
示例#9
0
    def goStart(self, stage=None):
        if stage is not None:
            host = self.hostname.get()
            if "//" not in host: host = "http://" + host

            hname = self.uname.get()
            p = {"stage": self.loc[stage], "hname": hname}
            try:
                gd = requests.get(host + "/NewGame", params=p, **TO)
            except:
                self.notConnected()
                return
            print(gd.text)
            self.gameConfig = (stage, gd.text.split(":")[1], host, hname,
                               False)
            self.charMenu()
            return

        if not self.removeMain(): return
        sl = ["Desert", "Atrium", "Taiga", "New Stage", "Forest"]

        self.title["text"] = "Select location"

        self.stb = []
        self.stp = []
        cmds = [
            lambda: self.goStart(0), lambda: self.goStart(1),
            lambda: self.goStart(2), lambda: self.goStart(3),
            lambda: self.goStart(4)
        ]
        for i in range(len(self.loc)):
            self.stb.append(
                Button(self,
                       text=self.loc[i],
                       fg="#008",
                       bg="#bdf",
                       command=cmds[i],
                       font=f))
            self.stb[-1].grid(row=2 + i // 2 * 2,
                              column=i % 2,
                              sticky=N + S + E + W,
                              ipadx=4,
                              ipady=2)
            img = ImageTk.PhotoImage(
                Image.open(PATH + "../Assets/Preview_" + sl[i] + ".png"))
            self.stp.append((Label(self, image=img), img))
            self.stp[-1][0].grid(row=3 + i // 2 * 2,
                                 column=i % 2,
                                 sticky=N + S + E + W)

        self.back = Button(self,
                           text="Back",
                           command=lambda: self.goBack(0),
                           font=g)
        self.back.grid(row=2 + (len(sl) + 1) // 2 * 2,
                       column=0,
                       sticky=E + W,
                       ipadx=4,
                       ipady=2)
示例#10
0
 def makeButton(self, frame, text, width, height, command, bg, fg):
     #        self.button = tk.Button(frame, text=text, width=width, command=command, highlightbackground=bg, fg=fg)
     self.button = Button(frame,
                          text=text,
                          width=width,
                          height=height,
                          command=command,
                          bg=bg,
                          fg=fg)
     self.button.pack(side=tk.LEFT)
示例#11
0
 def placeButton(self):
     button = Button(root,
                     text=self.name,
                     height=5,
                     width=10,
                     bg="black",
                     fg=GREEN,
                     activebackground=GREEN,
                     focuscolor=GREEN,
                     command=lambda: [insert_name(self.name)])
     button.grid(column=self.x, row=self.y, sticky="NSEW")
def extraHomebrew(source):
    homebrewWindow = tkinter.Toplevel(source)
    homebrewWindow.config(bg="#f0f0f0")
    source.withdraw()
    homebrewWindowLabel = tkinter.Label(homebrewWindow,
                                        text="Homebrew List",
                                        font=("Segoe UI", 12, "bold"),
                                        bg="#f0f0f0",
                                        fg="#000000")
    homebrewWindowLabel.pack(anchor="w")
    homebrewWindowLabel2 = tkinter.Label(
        homebrewWindow,
        text="Select additional homebrew for download then press OK",
        font=(bodyFont),
        bg="#f0f0f0",
        fg="#000000")
    homebrewWindowLabel2.pack(anchor="w")
    vscrollbar = tkinter.Scrollbar(homebrewWindow)
    canvas = tkinter.Canvas(homebrewWindow, yscrollcommand=vscrollbar.set)
    canvas.config(bg="#f0f0f0")
    vscrollbar.config(command=canvas.yview)
    vscrollbar.pack(side=tkinter.RIGHT, fill=tkinter.Y)
    homebrewFrame = tkinter.Frame(canvas)
    homebrewFrame.configure(bg="#f0f0f0")
    homebrewWindow.title("Homebrew List")
    homebrewWindow.resizable(0, 0)
    canvas.pack(side="left", fill="both", expand=True)
    canvas.create_window(0, 0, window=homebrewFrame, anchor="n")
    for count, x in enumerate(homebrewDB):
        homebrewListMenu = tkinter.Checkbutton(homebrewFrame,
                                               text=x["title"] + " by " +
                                               x["author"],
                                               font=(bigListFont),
                                               variable=homebrewList[count],
                                               bg="#f0f0f0",
                                               fg="#000000")
        homebrewListMenu.config(selectcolor="#F0F0F0")
        homebrewListMenu.pack(anchor="w")
    frame = tkinter.ttk.Frame(homebrewWindow,
                              relief=tkinter.RAISED,
                              borderwidth=1)
    frame.pack(fill=tkinter.BOTH, expand=True)
    okButton = Button(homebrewWindow,
                      text="OK",
                      font=(buttonFont),
                      command=lambda: okButtonPress(homebrewWindow, source),
                      bg="#f0f0f0",
                      fg="#000000")
    okButton.pack(side=tkinter.RIGHT, padx=5, pady=5)
    homebrewWindow.update()
    canvas.config(scrollregion=canvas.bbox("all"))
    homebrewWindow.protocol("WM_DELETE_WINDOW",
                            lambda: okButtonPress(homebrewWindow, source))
示例#13
0
    def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)
        self.controller = controller

        canvas = Canvas(self, height=HEIGHT, width=WIDTH)
        canvas.pack()

        background_frame = Frame(self, bg="#7ECFEC")
        background_frame.place(relwidth=1, relheight=1)

        upper_frame = Frame(self, bg="Black")
        upper_frame.place(relx=0.5,
                          rely=0.02,
                          relwidth=0.9,
                          relheight=0.07,
                          anchor='n')
        welcomelabel = Label(upper_frame,
                             text="Welcome!",
                             fg="Black",
                             font=("Modern", 15, "bold"))
        welcomelabel.place(relwidth=1, relheight=1)

        middle_frame = Frame(self, bg='Black')
        middle_frame.place(relx=0.5,
                           rely=0.1,
                           relwidth=0.9,
                           relheight=0.8,
                           anchor='n')
        textlabel = Label(
            middle_frame,
            text=
            "This GUI will help you to perform LDA Topic Modeling. \n \nFirst you will be asked "
            "to select your (german) corpus.\n \n  After that you can specify the parameters, e.g. the "
            "number of topics. \n \n \n Click  'Got it'  to continue. \n \n Good luck!",
            bg='white',
            font=('Modern', 12))
        textlabel.place(relwidth=1, relheight=1)

        lower_frame = Frame(self, bg='Black', bd=5)
        lower_frame.place(relx=0.5,
                          rely=0.92,
                          relwidth=0.2,
                          relheight=0.07,
                          anchor='n')
        button = Button(lower_frame,
                        text='Got it!',
                        bg='white',
                        fg='black',
                        borderless=0,
                        font=40,
                        command=lambda: controller.show_frame("ChooseCorpus"))
        button.place(relx=0, relwidth=1, relheight=1)
示例#14
0
    def check_replay(self):
        """Displays 'play again' label with 'yes' and 'no' buttons. Selecting 'yes' runs restart_program function,
        selecting 'no' exits the program."""
        play_again_label = Label(self.canvas,
                                 text='Play Again?',
                                 font=[self.font, 20],
                                 bg=self.background_color,
                                 fg=self.text_color,
                                 justify='center')
        play_again_label.place(relx=0.418, rely=0.8)

        yes_button = Button(self.canvas,
                            bg=self.button_color,
                            fg=self.text_color,
                            font=[self.font, 15],
                            text='Yes',
                            width=80,
                            height=60,
                            command=self.restart_program)
        no_button = Button(self.canvas,
                           bg=self.button_color,
                           fg=self.text_color,
                           font=[self.font, 15],
                           text='No',
                           width=80,
                           height=60,
                           command=sys.exit)

        yes_button.place(relx=.395, rely=0.85)
        no_button.place(relx=0.5, rely=0.85)
def summonWindow1():
    topFrame = tkinter.Frame(window)
    topFrame.pack(expand=True, fill=tkinter.BOTH,padx=5)
    topFrame.option_add("*Background", backgroundColour)
    bottomFrame = tkinter.Frame(window)
    bottomFrame.pack(side=tkinter.BOTTOM, fill=tkinter.X,padx=5)
    bottomFrame.option_add("*Background", backgroundColour)
    first = tkinter.Label(topFrame, text="Memory Pit", font=(titleFont), fg=foregroundColour)
    first.grid(column=0,row=0, sticky="w",padx=5)
    subtitle = tkinter.Label(topFrame, text='thank you, shutterbug2000!', font=(subtitleFont), fg=foregroundColour)
    subtitle.grid(column=0,row=1, sticky="w",padx=5)
    filler = tkinter.Label(topFrame, text=" ")
    filler.grid(column=0,row=3)
    downloadmemorypitCheck = tkinter.Checkbutton(topFrame, text = "Download Memory pit exploit?",font=(buttonFont),fg=foregroundColour, variable = downloadmemorypit)
    downloadmemorypitCheck.grid(column=0,row=2, sticky="w")
    firmwareLabel = tkinter.Label(topFrame, text = "Select your DSi firmware : ",fg=foregroundColour,font=(buttonFont))
    firmwareLabel.grid(column=0,row=4, sticky="w")
    selector = tkinter.OptionMenu(topFrame, firmwareVersion, *dsiVersions)
    selector.config(bg=buttonColour,fg=foregroundColour,font=(buttonFont))
    selector["menu"].config(bg=buttonColour,fg=foregroundColour,font=(buttonFont))
    selector.grid(column=0,row=5,sticky="w")

    if platform.system() == "Darwin":
        macOS_hiddentext = tkinter.Label(topFrame, text = "(Click the area above this text\n if you can't see the drop down menu) ",fg=foregroundColour,font=(bodyFont))
        macOS_hiddentext.grid(column=0,row=6, sticky="w")

    backButton = Button(bottomFrame,text="Back", font=(buttonFont),fg=foregroundColour,bg=backButtonColour,command=lambda: [topFrame.destroy(),bottomFrame.destroy(),summonWindow0()], width=button_width)
    backButton.pack(side=tkinter.LEFT)
    nextButton = Button(bottomFrame, text="Next",width=button_width, fg=foregroundColour,bg=nextButtonColour, font=(buttonFont),command=lambda:[topFrame.destroy(),bottomFrame.destroy(),summonWindow2()])
    nextButton.pack(side=tkinter.RIGHT, padx=5, pady=5)
    window.protocol("WM_DELETE_WINDOW",lambda:closeButtonPress(window))
def summonWindow2():

    topFrame = tkinter.Frame(window)
    topFrame.pack(expand=True, fill=tkinter.BOTH,padx=5)
    topFrame.option_add("*Background", backgroundColour)
    bottomFrame = tkinter.Frame(window)
    bottomFrame.pack(side=tkinter.BOTTOM, fill=tkinter.X,padx=5)
    bottomFrame.option_add("*Background", backgroundColour)
    first = tkinter.Label(topFrame, text="Homebrew Section", font=(titleFont), fg=foregroundColour)
    first.grid(column=0,row=0, sticky="w")
    subtitle = tkinter.Label(topFrame, text='brewed at home', font=(subtitleFont), fg=foregroundColour)
    subtitle.grid(column=0,row=1,sticky="w")
    downloadtwlmenuCheck = tkinter.Checkbutton(topFrame, text = "Download latest TWiLight Menu++ version?",fg=foregroundColour, variable = downloadtwlmenu,font=(buttonFont))
    downloadtwlmenuCheck.grid(column=0,row=2, sticky ="w")
    downloaddumptoolCheck = tkinter.Checkbutton(topFrame, text ="Download latest dumpTool version?", variable=downloaddumptool,fg=foregroundColour,font=(buttonFont))
    downloaddumptoolCheck.grid(column=0,row=3,sticky="w")
    unlaunchCheck = tkinter.Checkbutton(topFrame, text = "Download latest Unlaunch version?", variable =unlaunch, fg=foregroundColour,font=(buttonFont))
    unlaunchCheck.grid(column=0,row=4,sticky="w")
    seperator = tkinter.Label(topFrame, text="───────────────────────────────────────────────────────────", font=(buttonFont), fg=foregroundColour)
    seperator.grid(column=0,row=5,sticky="w")
    GodMode9iCheck = tkinter.Checkbutton(topFrame, text = "Download latest GodMode9i version?", variable =godmode9i, fg=foregroundColour,font=(buttonFont))
    GodMode9iCheck.grid(column=0,row=6,sticky="w")
    updateHiyaCheck = tkinter.Checkbutton(topFrame, text = "Update hiyaCFW? (must have run hiyaHelper once before)", variable =updateHiyaCFW, fg=foregroundColour,font=(buttonFont))
    updateHiyaCheck.grid(column=0,row=7,sticky="w")
    buttonExtraHomebrew = tkinter.Button(topFrame, text = "Additional homebrew...", command =lambda:[extraHomebrew(window)], fg=foregroundColour,font=(buttonFont),bg=buttonColour)
    buttonExtraHomebrew.grid(column=0,row=8,sticky="w",pady=5)
    backButton = Button(bottomFrame,text="Back", font=(buttonFont),fg=foregroundColour,bg=backButtonColour,command=lambda: [topFrame.destroy(),bottomFrame.destroy(),summonWindow1()], width=button_width)
    backButton.pack(side=tkinter.LEFT)
    nextButton = Button(bottomFrame, text="Next",width=button_width, fg=foregroundColour,bg=nextButtonColour, font=(buttonFont),command=lambda:[topFrame.destroy(),bottomFrame.destroy(),summonWindow3()])
    nextButton.pack(side=tkinter.RIGHT, padx=5, pady=5)
    window.protocol("WM_DELETE_WINDOW",lambda:closeButtonPress(window))
def summonWindow0():
    window.title("Lazy DSi file Downloader")
    window.resizable(0,0)
    window.geometry("500x360")
    window.option_add("*Background", backgroundColour)
    window.configure(bg=backgroundColour)
    topFrame = tkinter.Frame(window)
    topFrame.pack(expand=True, fill=tkinter.BOTH,padx=5)
    topFrame.option_add("*Background", backgroundColour)
    bottomFrame = tkinter.Frame(window)
    bottomFrame.pack(side=tkinter.BOTTOM, fill=tkinter.X,padx=5)
    bottomFrame.option_add("*Background", backgroundColour)
    first = tkinter.Label(topFrame, text="Welcome to the Lazy DSi File Downloader", font=(titleFont), fg=foregroundColour)
    first.grid(column=0,row=0, sticky="w",padx=5)
    
    bulletpoints = [
        "This is an application made by Your Kalamity that downloads and place files for homebrew'ing your Nintendo DSi in the correct location. If you have already installed homebrew, this can also update the one you have.",
        "This is to be used in conjunction with the Nintendo DSi Modding guide by NightScript and emiyl",
        "Check it out here: https://dsi.cfw.guide/",
        "By using this application, you do not need to follow any of the 'Preparing SD card' steps.",
        "This application is to be given for free. If you have paid to receive this, contact the person that sold you this application; you have been scammed.",
        "You may use any part of this application for your own purposes as long as credit is given.",
        "Please proceed by hitting the 'Next' button"
        ]
    
    for count, x in enumerate(bulletpoints):
        bullet = tkinter.Label(topFrame, text=x, font=(paragraphFont),fg=foregroundColour,wraplength=450, justify="left")
        bullet.grid(column=0,row=count+3, sticky="w", padx=5)
    
    discordButton = Button(bottomFrame, text="DS⁽ⁱ⁾ Mode Hacking Discord server", fg=foregroundColour,bg=buttonColour, font=(buttonFont),command=lambda:webbrowser.open("https://discord.gg/yD3spjv",new=1))
    discordButton.pack(side=tkinter.LEFT, padx="5", pady="5")
    nextButton = Button(bottomFrame, text="Next",width=button_width, fg=foregroundColour,bg=nextButtonColour, font=(buttonFont),command=lambda:[topFrame.destroy(),bottomFrame.destroy(),summonWindow1()])
    nextButton.pack(side=tkinter.RIGHT, padx=5, pady=5)

    window.protocol("WM_DELETE_WINDOW",lambda:closeButtonPress(window))
示例#18
0
def main(Root, frame, subject):

    global Questionframe
    global ParsedQuestion
    global ParsedAnswer
    global button
    global NextFrame
    global root
    global statusBar
    global totalQuestion

    root = Root

    #divide approprate questions and multiple choice answers
    ParsedQuestion, ParsedAnswer = getSubQuestion(str(subject))

    frame.destroy()
    root.title("FunSmart " + str(subject) + " Prestest Screen")

    # create new frame that will replace the previous one
    frame = Frame(root, bg="white")
    frame.place(relwidth=0.8, relheight=0.8, relx=0.1, rely=0.1)

    # create question frames storing only next question button
    Questionframe = Frame(frame, bg="white")
    Questionframe.pack(side="top", fill="x")

    NextFrame = Frame(frame, bg="white")
    NextFrame.pack(side="bottom", fill="x")

    # Question = Label(Questionframe, text= "Welcome to the "+str(subject) + " pre-test, please click 'Next Question' to continue")

    Question = Label(Questionframe,
                     font=("Arial", 11),
                     wraplength=480,
                     justify=LEFT,
                     text="Welcome to the " + str(subject) +
                     " pre-test, please click 'Next Question' to continue")
    Question.grid(row=1, column=0)

    statusBar = Label(NextFrame,
                      text=str(questionIndex) + " - " + str(totalQuestion))
    statusBar.pack(anchor=W)

    button = Button(NextFrame,
                    bg="#82E0AA",
                    text="Next Question",
                    command=lambda: nextQuestion(frame, subject))
    button.pack(anchor=E)
示例#19
0
    def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)
        self.controller = controller
        canvas = Canvas(self, height=HEIGHT, width=WIDTH)
        canvas.pack()

        background_frame = Frame(self, bg="#7ECFEC")
        background_frame.place(relwidth=1, relheight=1)

        upper_frame = Frame(self, bg="Black")
        upper_frame.place(relx=0.5,
                          rely=0.02,
                          relwidth=0.9,
                          relheight=0.07,
                          anchor='n')
        welcomelabel = Label(upper_frame,
                             text="Corpus",
                             fg="Black",
                             font=("Modern", 15, "bold"))
        welcomelabel.place(relwidth=1, relheight=1)

        middle_frame = Frame(self, bg='white')
        middle_frame.place(relx=0.5,
                           rely=0.1,
                           relwidth=0.9,
                           relheight=0.8,
                           anchor='n')
        textlabel = Label(
            middle_frame,
            text=
            "If this is your first time performing LDA, \n please select some csv files"
            " to build your corpus.\n Click 'Select Files' to do so. \n \n"
            "Otherwise your saved data will be used, \n so you can skip this step and the preprocessing.",
            bg='white',
            font=('Modern', 12))
        textlabel.place(relwidth=1, relheight=1)

        lower_frame = Frame(self, bg='Black', bd=5)
        lower_frame.place(relx=0.5,
                          rely=0.92,
                          relwidth=0.5,
                          relheight=0.07,
                          anchor='n')
        button1 = Button(lower_frame,
                         text='Select Files',
                         bg='white',
                         fg='black',
                         borderless=0,
                         font=40,
                         command=lambda: addFile(middle_frame))
        button1.place(relx=0, relwidth=0.5, relheight=1)
        button2 = Button(lower_frame,
                         text='Done',
                         bg='white',
                         fg='black',
                         borderless=0,
                         font=40,
                         command=lambda: controller.show_frame("Preprocess"))
        button2.place(relx=0.5, relwidth=0.5, relheight=1)
示例#20
0
    def create_widgets(self):
        self.hi_there = Button(self,
                               text="Hello World",
                               bg='lightblue',
                               fg='yellow',
                               borderless=1)
        self.hi_there["command"] = self.say_hi
        self.hi_there.pack(side="top")

        self.quit = Button(self,
                           text="QUIT",
                           bg='red',
                           fg='yellow',
                           borderless=1,
                           command=self.master.destroy)
        self.quit.pack(side="bottom")
def summonWindow0():
    window.title("Lazy DSi file Downloader")
    window.resizable(0, 0)
    window.geometry("500x360")
    window.option_add("*Background", backgroundColour)
    window.configure(bg=backgroundColour)
    topFrame = tkinter.Frame(window)
    topFrame.pack(expand=True, fill=tkinter.BOTH, padx=5)
    topFrame.option_add("*Background", backgroundColour)
    bottomFrame = tkinter.Frame(window)
    bottomFrame.pack(side=tkinter.BOTTOM, fill=tkinter.X, padx=5)
    bottomFrame.option_add("*Background", backgroundColour)
    first = tkinter.Label(topFrame,
                          text="Lazy DSi File Downloader",
                          font=(titleFont),
                          fg=foregroundColour)
    first.grid(column=0, row=0, sticky="w", padx=5)
    bulletpoints = [
        "This program will download all files necessary to run homebrew on your Nintendo DSi.",
        "This is to be used in conjunction with the Nintendo DSi Modding guide by NightScript, emiyl and the rest of the community.",
        "Check it out here: https://dsi.cfw.guide/",
        "By using this application, you don't need to follow any of the 'Preparing SD card' steps.",
        "If you need help, join the Discord server with the button below.",
        "Please proceed by hitting the 'Next' button"
    ]

    for count, x in enumerate(bulletpoints):
        bullet = tkinter.Label(topFrame,
                               text="• " + x,
                               font=(paragraphFont),
                               fg=foregroundColour,
                               wraplength=500,
                               justify="left")
        bullet.grid(column=0, row=count + 3, sticky="w", padx=5)

    discordButton = Button(
        bottomFrame,
        text="DS⁽ⁱ⁾ Mode Hacking Discord server",
        fg=foregroundColour,
        bg=buttonColour,
        font=(buttonFont),
        command=lambda: webbrowser.open("https://discord.gg/yD3spjv", new=1))
    discordButton.pack(side=tkinter.LEFT, padx="5", pady="5")
    nextButton = Button(
        bottomFrame,
        text="Next",
        width=button_width,
        fg=foregroundColour,
        bg=nextButtonColour,
        font=(buttonFont),
        command=lambda:
        [topFrame.destroy(),
         bottomFrame.destroy(),
         summonWindow1()])
    nextButton.pack(side=tkinter.RIGHT, padx=5, pady=5)

    window.protocol("WM_DELETE_WINDOW", lambda: closeButtonPress(window))
def summonWindow4():
    startThread = threading.Thread(target=start, daemon=True)
    topFrame = tkinter.Frame(window)
    topFrame.pack(expand=True, fill=tkinter.BOTH, padx=5)
    topFrame.option_add("*Background", backgroundColour)
    bottomFrame = tkinter.Frame(window)
    bottomFrame.pack(side=tkinter.BOTTOM, fill=tkinter.X, padx=5)
    bottomFrame.option_add("*Background", backgroundColour)
    first = tkinter.Label(topFrame,
                          text="Download Screen",
                          font=(titleFont),
                          fg=foregroundColour)
    first.grid(column=0, row=0, sticky="w")
    subtitle = tkinter.Label(topFrame,
                             text='please wait...',
                             font=(subtitleFont),
                             fg=foregroundColour)
    subtitle.grid(column=0, row=1, sticky="w")
    global outputBox
    outputBox = tkinter.Text(topFrame,
                             state='disabled',
                             width=60,
                             height=15,
                             bg="black",
                             fg="white")
    outputBox.grid(column=0, row=2, sticky="w")
    startThread.start()
    global finalbackButton
    finalbackButton = Button(
        bottomFrame,
        state="disabled",
        text="Back",
        font=(buttonFont),
        fg=foregroundColour,
        bg=backButtonColour,
        command=lambda:
        [topFrame.destroy(),
         bottomFrame.destroy(),
         summonWindow3()],
        width=button_width)
    finalbackButton.pack(side=tkinter.LEFT)
    global finalnextButton
    finalnextButton = Button(
        bottomFrame,
        state="disabled",
        text="Finish",
        width=button_width,
        fg=foregroundColour,
        bg=nextButtonColour,
        font=(buttonFont),
        command=lambda:
        [topFrame.destroy(),
         bottomFrame.destroy(),
         summonWindow5()])
    finalnextButton.pack(side=tkinter.RIGHT, padx=5, pady=5)
    window.protocol("WM_DELETE_WINDOW", lambda: donothing)
示例#23
0
def click():
    labeltext = ''
    politiciantext = ''
    gotZipcode = False
    gotState = False
    userInput['name'] = name.get()
    userInput['party'] = party.get()
    userInput['zipcode'] = zipcode.get()
    userInput['state'] = state.get()
    userInput['topic'] = topic1.get()
    userInput['issue'] = str(issue.get())
    if userInput['zipcode'] != None:
        try:
            houserep = sr.findHouseRep(userInput['zipcode'])
            politiciantext += 'Your house representative is: ' + houserep + '\n'
            gotZipcode = True
        except:
            labeltext += 'invalid zipcode    '
    if userInput['state'] != None and sr.findSenators(
            userInput['state']) != set():
        senators = sr.findSenators(userInput['state'])
        politiciantext += ' Your senators are: ' + ', '.join(senators)
        gotState = True
    else:
        labeltext += 'invalid state    '
    if gotZipcode and gotState and name.get() != None and party.get(
    ) != None and issue.get() != None:
        Label(mail, text = 'Information received, gathering data...', bg = 'white')\
        .grid(row = 10, column = 3, columnspan = 3, sticky = W)
    else:
        Label(mail, text = labeltext, bg = 'white') \
        .grid(row = 10, column = 3, columnspan = 3, sticky = W)
    if gotZipcode and gotState and name.get() != None and party.get(
    ) != None and issue.get() != None:
        Label(mail, text = politiciantext, bg = 'white') \
        .grid(row = 14, column = 2, columnspan = 3, sticky = W)
        senators = list(senators)
        Label(mail, text = 'Choose a politician to email: ', bg = 'pink', font = 'Arial 13 bold') \
        .grid(row = 13, column = 2, sticky = W)
        Button (mail, text = houserep, width = 100, command= lambda x=houserep: generateEmail(x, 'Representative') ) \
        .grid(row = 13, column = 3, columnspan = 3, sticky = W)
        Button (mail, text = senators[0], width = 100, command=lambda x=senators[0]: generateEmail(x, 'Senator')) \
        .grid(row = 13, column = 3, columnspan = 3)
        Button (mail, text = senators[1], width = 100, command=lambda x=senators[1]: generateEmail(x, 'Senator')) \
        .grid(row = 13, column = 3, columnspan = 3, sticky = E)
示例#24
0
    def goJoin(self):
        if not self.removeMain(): return

        host = self.hostname.get()
        if "//" not in host: host = "http://" + host

        uname = self.uname.get()
        try:
            ag = requests.get(host + "/List", **TO)
        except:
            self.notConnected()
            return
        ag = json.loads(ag.text.replace("+", " "))
        self.gameList = ag

        self.title["text"] = "Join Game"

        self.avls = Listbox(self, width=20, height=10, font=h)
        self.avls.bind("<<ListboxSelect>>", self.setGD)
        for d in ag:
            et = d + " " * (20 - len(d))
            et += "(" + ag[d]["Stage"] + ")" + " " * (10 - len(ag[d]["Stage"]))
            et += "/ " + ag[d]["Host"]
            self.avls.insert(END, et)
        if len(ag) > 0:
            self.avls.config(width=0)
        self.avls.grid(row=2, column=0, rowspan=2)

        self.jg = Button(self,
                         text="Join",
                         fg="#008",
                         bg="#bfd",
                         command=self.joinGame,
                         font=f)
        self.jg.grid(row=2, column=1, sticky=E + W, ipadx=4, ipady=4)

        self.back = Button(self,
                           text="Back",
                           command=lambda: self.goBack(1),
                           font=g)
        self.back.grid(row=3, column=1, sticky=E + W, ipadx=4, ipady=4)

        self.columnconfigure(1, weight=1, uniform="c")
示例#25
0
 def criar_botao(app_name, text, bg, fg, cmd):
     if sys.platform == MAC_OS:
         return Button(app_name, text=text, bg=bg, fg=fg, command=cmd)
     else:
         return tk.Button(app_name,
                          text=text,
                          bg=bg,
                          command=cmd,
                          width=20,
                          height=4,
                          borderwidth=3)
示例#26
0
    def add_button(self, b, r, c, frames, col=None):
        if platform.system() in ["Darwin"]:
            kwargs = {
                "activebackground": self.colors["inactive"],
                "borderless": True,
                "height": 50,
                "width": 70,
            }
        else:
            kwargs = {"height": 4, "width": 10}

        f = Frame(frames[b + 2], bg=self.colors["bg"])
        f.grid(row=r, column=c)
        bt = Button(f,
                    text=col[2] if col else '',
                    bg=self.colors["inactive"],
                    **kwargs)
        self.w_buttons[b].append(bt)

        if col:
            key = col[2]
            if key == "\\":
                key = "backslash"
            self.bind(
                f"<KeyPress-{key}>",
                lambda *args, rowx=r, colx=c, bankx=b, **kwargs: self.
                button_press_repeat(rowx, colx, bankx, *args, **kwargs),
            )

            self.bind(
                f"<KeyRelease-{key}>",
                lambda *args, rowx=r, colx=c, bankx=b, **kwargs: self.
                button_release_repeat(rowx, colx, bankx, *args, **kwargs),
            )

        bt.bind(
            "<ButtonPress>",
            lambda *args, rowx=r, colx=c, bankx=b, **kwargs: self.button_press(
                rowx, colx, bankx, *args, **kwargs),
        )
        bt.bind(
            "<ButtonRelease>",
            lambda *args, rowx=r, colx=c, bankx=b, **kwargs: self.
            button_release(rowx, colx, bankx, *args, **kwargs),
        )
        bt.pack(side=TOP, fill=X)
        if col:
            lb = Label(f, text=col[0] if col else '', bg=self.colors["bg"])
            lb.pack(side=TOP, fill=X)
            lb = Label(f, text=col[1] if col else '', bg=self.colors["bg"])
            lb.pack(side=TOP, fill=X)
示例#27
0
    def display_seats(available_seats):
        global selected_seat
        # for each row
        for i in range(10):
            letter = chr(i + 97).upper()
            row_label = Label(seat_selection_frame, text=letter)
            row_label.grid(row=i + 1, column=0)
            # for each column
            for j in range(20):
                column_label = Label(seat_selection_frame, text=j + 1)
                column_label.grid(row=0, column=j + 1)

                # linear search through each position in the 2D list
                if available_seats[i][j] == 'False':
                    button_colour = "red"
                else:
                    button_colour = "green"

                print(button_colour)

                b = Button(seat_selection_frame,
                           bg=button_colour,
                           height=20,
                           width=50)
                b.grid(row=i + 1, column=j + 1)

        Label(seat_selection_frame, text='Enter seat -->').grid(row=13,
                                                                column=0,
                                                                padx=5,
                                                                pady=20,
                                                                columnspan=10,
                                                                sticky=W)

        seat_choose_field = Entry(seat_selection_frame)
        seat_choose_field.grid(row=13,
                               column=1,
                               padx=5,
                               pady=20,
                               columnspan=10)

        def fetch_entry():
            global selected_seat
            selected_seat = seat_choose_field.get()

            check_selected_seat(selected_seat, available_seats)

        seat_select = Button(seat_selection_frame,
                             text="Choose seat",
                             command=lambda: fetch_entry())
        seat_select.grid(row=14, column=0, padx=5, pady=20, columnspan=10)
示例#28
0
    def __init__(self, name=None):
        self.name = name
        self.default_name = "Player 1"
        self.stone_type = None
        self.color = ""
        self.move_referee = MoveReferee()
        self.click = None

        # Creates self.root window
        self.root = Tk()
        self.root.title("Go Game GUI")
        self.root.resizable(0, 0)
        self.root.geometry('1000x1000')

        self.e = Entry(self.root,
                       text="ENTER YOUR NAME HERE",
                       width=20,
                       borderwidth=5,
                       bg="yellow",
                       fg="black")
        self.e.grid(row=0, column=0, columnspan=7)

        self.e1 = Entry(self.root,
                        width=20,
                        borderwidth=5,
                        bg="yellow",
                        fg="black")
        self.e1.grid(row=10, column=0, columnspan=7)

        self.button_register = Button(self.root,
                                      text="Register",
                                      command=self.myClick)
        self.button_move = Button(self.root,
                                  text="Make Move",
                                  command=self.myMove)
        self.pass_move = Button(self.root, text="Pass", command=self.Pass)
        self.button_register.grid(row=0, column=10, columnspan=1)
        self.button_move.grid(row=10, column=10, columnspan=1)
        self.pass_move.grid(row=9, column=10, columnspan=1)

        self.buttons = dict()
        for x in range(1, BOARD_DIM + 1):
            for y in range(1, BOARD_DIM + 1):
                button_num = "{}-{}".format(y, x)
                self.buttons["{}-{}".format(y, x)] = Button(
                    self.root,
                    text=" ",
                    bg="goldenrod",
                    padx=0.0,
                    pady=20,
                    command=lambda butt=button_num: self.button_click(butt))
                self.buttons["{}-{}".format(y, x)].grid(row=x,
                                                        column=y,
                                                        columnspan=1)
def quit_page(self):
    self.root.update()
    rightframe = Frame(self.root, bg=rightframe_background_color)
    rightframe.pack(side=RIGHT)
    rightframe.place(height=800, width=800, x=200, y=0)
    quit_heading = Label(rightframe,
                         text="Quit",
                         font=(standard_font_name, text_font_size,
                               font_weight))
    quit_heading.place(x=35, y=20)

    quit_note = "Pressing Yes button will shut the entirely."
    quit_heading = Label(rightframe,
                         text=quit_note,
                         font=(standard_font_name, text_font_size,
                               font_weight))
    quit_heading.place(x=35, y=50)
    quit_button = Button(rightframe,
                         text="Yes",
                         fg="black",
                         width=20,
                         command=lambda: quit_program(self))
    quit_button.place(x=35, y=100)
def create_all_tabs():
    tab_names_dict = {
        key: key.split()[0]
        for key, value in json_config.items()
    }

    for key, first in tab_names_dict.items(
    ):  # key for key name / first for first word using split(' ')
        first = Frame(
            tab_parent,
            width=tab_parent.winfo_width(),
            height=tab_parent.winfo_height(),
        )

        tab_parent.add(first, text=key)
        x = 0

        for desc, command in json_config[key].items():
            line_frame = LabelFrame(first, bd=0)
            line_frame.pack(side=TOP, fill=X)

            Label(line_frame,
                  width=35,
                  wraplength=300,
                  text=desc,
                  justify=LEFT,
                  anchor=W,
                  padx=10).pack(side=LEFT, fill=X)

            Button(
                line_frame,
                text=command,
                width=500,
                bg='#4a4a4a' if dark_mode_enabled() else '#dddddd',
                fg='#dddddd' if dark_mode_enabled() else
                '#4a4a4a',  # #dddddd = off-white  & #4a4a4a = dark-grey
                command=lambda p=command: send_command(p)).pack(side=RIGHT,
                                                                fill=BOTH)

            separator = ttk.Separator(line_frame, orient=HORIZONTAL)
            separator.place(
                relx=0.015,  # starting position on X axis (0.01 == 1% of width)
                rely=0.97,  # starting position on Y axis
                relwidth=0.98,  # width %
                relheight=0.01  # height %
            )

            x += 1
    set_min_size()