예제 #1
0

def openTitleChange():
    winman.switchView("titlechanger")


def quitProgram():
    winman.close()


# Drawing the interface, row by row
menuFrame = UIFrame(mainMenuFrame)

channelCheckButton = UIButton(menuFrame,
                              text="Open Channel Check...",
                              command=openChannelCheck)
titleChangeButton = UIButton(menuFrame,
                             text="Open Title Change...",
                             command=openTitleChange)
mainMenuView.addLine([menuFrame])

quitButton = UIButton(mainMenuFrame, text="Quit", command=quitProgram)
mainMenuView.addLine([quitButton])

# GRIDing frame members
channelCheckButton.grid(row=0, column=0, padx=5, pady=5)
titleChangeButton.grid(row=0, column=1, padx=5, pady=5)

# Finishing up: Registering channelCheckView
winman.registerView(mainMenuView, "mainmenu")
예제 #2
0
errorViewFrame = UIFrame(winman.mainWin)
errorViewFrame.grid()
errorView = View(title="will never be seen, managed by windowmanager")


# Defining functions for buttons
def quitProgram():
    winman.close()


# Drawing the interface, row by row
headingLabel = UILabel(errorViewFrame,
                       text="Critical error",
                       font=("bold", 30),
                       underline=0)
errorView.addLine([headingLabel])

moreInfoLabel = UILabel(errorViewFrame, text="An unknown error has occured.")
errorView.addLine([moreInfoLabel])

quitFrame = UIFrame(errorViewFrame)
willQuitLabel = UILabel(quitFrame, text="The program will terminate.")
quitButton = UIButton(quitFrame, text="Quit", command=quitProgram)
errorView.addLine([quitFrame])

# PACKing frame components
willQuitLabel.pack(side="left")
quitButton.pack(side="right")

# Finishing up: Registering errorView
winman.registerView(errorView, "error")
        confirmationLabel.config(text="A connection error occured!")
        confirmationLabel.after(3000, clearConfirmationLabel)
        return

    confirmationLabel.config(text="Title set!")
    confirmationLabel.after(3000, clearConfirmationLabel)


# Drawing the interface, row by row
youLabel = UILabel(titleChangeFrame, text="You are logged in as:")
# # # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = # # #
youValueFrame = UIFrame(titleChangeFrame)
youValueName = UILabel(youValueFrame, text="...")
youValueId = UILabel(youValueFrame, text="...")
# # # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = # # #
titleChangeView.addLine([youLabel, youValueFrame])

instructionFrame = UIFrame(titleChangeFrame)
instructionLabel = UILabel(instructionFrame,
                           text="Enter your stream title here:")
moreInfoLabel = UILabel(instructionFrame,
                        text="(Twitch Guidelines and restrictions apply)")
# # # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = # # #
titleField = UITextField(titleChangeFrame, width=75)
confirmButton = UIButton(titleChangeFrame,
                         text="Confirm",
                         command=confirmButton)
# # # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = # # #
titleChangeView.addLine([instructionFrame, titleField, confirmButton])

backButton = UIButton(titleChangeFrame, text="<--", command=backButton)