Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

Breezypythongui

28/12/2020 Client: saad24vbs Deadline: 12 Hours

breezypythongui.py

""" File: breezypythongui.py Version: 1.0 Copyright 2012 by Ken Lambert Resources for easy Python GUIs. LICENSE: This is open-source software released under the terms of the GPL (http://www.gnu.org/licenses/gpl.html). Its capabilities mirror those of BreezyGUI and BreezySwing, open-source frameworks for writing GUIs in Java, written by Ken Lambert and Martin Osborne. PLATFORMS: The package is a wrapper around tkinter (Python 3.X) and should run on any platform where tkinter is available. INSTALLATION: Put this file where Python can see it. """ import tkinter import tkinter.simpledialog N = tkinter.N S = tkinter.S E = tkinter.E W = tkinter.W CENTER = tkinter.CENTER END = tkinter.END NORMAL = tkinter.NORMAL DISABLED = tkinter.DISABLED NONE = tkinter.NONE WORD = tkinter.WORD VERTICAL = tkinter.VERTICAL HORIZONTAL = tkinter.HORIZONTAL RAISED = tkinter.RAISED SINGLE = tkinter.SINGLE ACTIVE = tkinter.ACTIVE class EasyFrame(tkinter.Frame): """Represents an application window.""" def __init__(self, title = "", width = None, height = None, background = "white", resizable = True): """Will shrink wrap the window around the widgets if width and height are not provided.""" tkinter.Frame.__init__(self, borderwidth = 4, relief = "sunken") if width and height: self.setSize(width, height) self.master.title(title) self.grid() # Expand the frame within the window self.master.rowconfigure(0, weight = 1) self.master.columnconfigure(0, weight = 1) self.grid(sticky = N+S+E+W) # Set the background color and resizability self.setBackground(background) self.setResizable(resizable) def setBackground(self, color): """Resets the window's background color to color.""" self["background"] = color def setResizable(self, state): """Resets the window's resizable property to True or False.""" self.master.resizable(state, state) def setSize(self, width, height): """Resets the window's width and height in pixels.""" self.master.geometry(str(width)+ "x" + str(height)) def setTitle(self, title): """Resets the window's title to title.""" self.master.title(title) # Methods to add widgets to the window. The row and column in # the grid are required arguments. def addLabel(self, text, row, column, columnspan = 1, rowspan = 1, sticky = N+W, font = None, background = "white", foreground = "black"): """Creates and inserts a label at the row and column, and returns the label.""" label = tkinter.Label(self, text = text, font = font, background = background, foreground = foreground) self.rowconfigure(row, weight = 1) self.columnconfigure(column, weight = 1) label.grid(row = row, column = column, columnspan = columnspan, rowspan = rowspan, padx = 5, pady = 5, sticky = sticky) return label def addButton(self, text, row, column, columnspan = 1, rowspan = 1, command = lambda: None, state = NORMAL): """Creates and inserts a button at the row and column, and returns the button.""" button = tkinter.Button(self, text = text, command = command, state = state) self.rowconfigure(row, weight = 1) self.columnconfigure(column, weight = 1) button.grid(row = row, column = column, columnspan = columnspan, rowspan = rowspan, padx = 5, pady = 5) return button def addFloatField(self, value, row, column, columnspan = 1, rowspan = 1, width = 20, precision = None, sticky = N+E, state = NORMAL): """Creates and inserts a float field at the row and column, and returns the float field.""" field = FloatField(self, value, width, precision, state) self.rowconfigure(row, weight = 1) self.columnconfigure(column, weight = 1) field.grid(row = row, column = column, columnspan = columnspan, rowspan = rowspan, padx = 5, pady = 5, sticky = sticky) return field def addIntegerField(self, value, row, column, columnspan = 1, rowspan = 1, width = 10, sticky = N+E, state = NORMAL): """Creates and inserts an integer field at the row and column, and returns the integer field.""" field = IntegerField(self, value, width, state) self.rowconfigure(row, weight = 1) self.columnconfigure(column, weight = 1) field.grid(row = row, column = column, columnspan = columnspan, rowspan = rowspan, padx = 5, pady = 5, sticky = sticky) return field def addTextField(self, text, row, column, columnspan = 1, rowspan = 1, width = 20, sticky = N+E, state = NORMAL): """Creates and inserts a text field at the row and column, and returns the text field.""" field = TextField(self, text, width, state) self.rowconfigure(row, weight = 1) self.columnconfigure(column, weight = 1) field.grid(row = row, column = column, columnspan = columnspan, rowspan = rowspan, padx = 5, pady = 5, sticky = sticky) return field def addTextArea(self, text, row, column, rowspan = 1, columnspan = 1, width = 80, height = 5, wrap = NONE): """Creates and inserts a multiline text area at the row and column, and returns the text area. Vertical and horizontal scrollbars are provided.""" frame = tkinter.Frame(self) frame.grid(row = row, column = column, columnspan = columnspan, rowspan = rowspan, sticky = N+S+E+W) self.columnconfigure(column, weight = 1) self.rowconfigure(row, weight = 1) xScroll = tkinter.Scrollbar(frame, orient = HORIZONTAL) xScroll.grid(row = 1, column = 0, sticky = E+W) yScroll = tkinter.Scrollbar(frame, orient = VERTICAL) yScroll.grid(row = 0, column = 1, sticky = N+S) area = TextArea(frame, text, width, height, xScroll.set, yScroll.set, wrap) area.grid(row = 0, column = 0, padx = 5, pady = 5, sticky = N+S+E+W) frame.columnconfigure(0, weight = 1) frame.rowconfigure(0, weight = 1) xScroll["command"] = area.xview yScroll["command"] = area.yview return area def addListbox(self, row, column, rowspan = 1, columnspan = 1, width = 10, height = 5, listItemSelected = lambda index: index): """Creates and inserts a scrolling list box at the row and column, with a width and height in lines and columns of text, and a default item selection method, and returns the list box.""" frame = tkinter.Frame(self) frame.grid(row = row, column = column, columnspan = columnspan, rowspan = rowspan, sticky = N+S+E+W) self.columnconfigure(column, weight = 1) self.rowconfigure(row, weight = 1) yScroll = tkinter.Scrollbar(frame, orient = VERTICAL) yScroll.grid(row = 0, column = 1, sticky = N+S) listBox = EasyListbox(frame, width, height, yScroll.set, listItemSelected) listBox.grid(row = 0, column = 0, sticky = N+S+E+W) frame.columnconfigure(0, weight = 1) frame.rowconfigure(0, weight = 1) yScroll["command"] = listBox.yview return listBox def addCanvas(self, canvas = None, row = 0, column = 0, rowspan = 1, columnspan = 1, width = 200, height = 100, background = "white"): """Creates and inserts a canvas at the row and column, and returns the canvas.""" if not canvas: canvas = EasyCanvas(self, width = width, height = height, background = background) canvas.grid(row = row, column = column, rowspan = rowspan, columnspan = columnspan, sticky = W+E+N+S) self.columnconfigure(column, weight = 10) self.rowconfigure(row, weight = 10) return canvas def addScale(self, row, column, rowspan = 1, columnspan = 1, command = lambda value: value, from_ = 0, to = 0, label = "", length = 100, orient = HORIZONTAL, resolution = 1, tickinterval = 0): """Creates and inserts a scale at the row and column, and returns the scale.""" scale = tkinter.Scale(self, command = command, from_ = from_, to = to, label = label, length = length, orient = orient, resolution = resolution, tickinterval = tickinterval, relief = "sunken", borderwidth = 4) self.rowconfigure(row, weight = 1) self.columnconfigure(column, weight = 1) scale.grid(row = row, column = column, columnspan = columnspan, rowspan = rowspan, sticky = N+S+E+W) return scale def addMenuBar(self, row, column, rowspan = 1, columnspan = 1, orient = "horizontal"): """Creates and inserts a menu bar at the row and column, and returns the menu bar.""" if not orient in ("horizontal", "vertical"): raise ValueError("orient must be horizontal or vertical") menuBar = EasyMenuBar(self, orient) menuBar.grid(row = row, column = column, rowspan = rowspan, columnspan = columnspan, sticky = N+W) return menuBar def addCheckbutton(self, text, row, column, rowspan = 1, columnspan = 1, sticky = N+S+E+W, command = lambda : 0): """Creates and inserts check button at the row and column, and returns the check button.""" cb = EasyCheckbutton(self, text, command) self.rowconfigure(row, weight = 1) self.columnconfigure(column, weight = 1) cb.grid(row = row, column = column, columnspan = columnspan, rowspan = rowspan, padx = 5, pady = 5, sticky = sticky) return cb def addRadiobuttonGroup(self, row, column, rowspan = 1, columnspan = 1, orient = VERTICAL): """Creates and returns a radio button group.""" return EasyRadiobuttonGroup(self, row, column, rowspan, columnspan, orient) # Added 12-18-2012 def addPanel(self, row, column, rowspan = 1, columnspan = 1, background = "white"): """Creates and returns a panel.""" return EasyPanel(self, row, column, rowspan, columnspan, background) # Method to pop up a message box from this window. def messageBox(self, title = "", message = "", width = 25, height = 5): """Creates and pops up a message box, with the given title, message, and width and height in rows and columns of text.""" dlg = MessageBox(self, title, message, width, height) return dlg.modified() # Method to pop up a prompter box from this window. def prompterBox(self, title = "", promptString = "", inputText = "", fieldWidth = 20): """Creates and pops up a prompter box, with the given title, prompt, input text, and field width in columns of text. Returns the text entered at the prompt.""" dlg = PrompterBox(self, title, promptString, inputText, fieldWidth) return dlg.getText() # Classes for easy widgets class AbstractField(tkinter.Entry): """Represents common features of float fields, integer fields, and text fields.""" def __init__(self, parent, value, width, state): self.var = tkinter.StringVar() self.setValue(value) tkinter.Entry.__init__(self, parent, textvariable = self.var, width = width, state = state) def setValue(self, value): self.var.set(value) def getValue(self): return self.var.get() class FloatField(AbstractField): """Represents a single line box for I/O of floats.""" def __init__(self, parent, value, width, precision, state): self.setPrecision(precision) AbstractField.__init__(self, parent, value, width, state) def getNumber(self): """Returns the float contained in the field. Raises: ValueError if number format is bad.""" return float(self.getValue()) def setNumber(self, number): """Replaces the float contained in the field.""" self.setValue(self._precision % number) def setPrecision(self, precision): """Resets the precision for the display of a float.""" if precision and precision >= 0: self._precision = "%0." + str(precision) + "f" else: self._precision = "%f" class IntegerField(AbstractField): """Represents a single line box for I/O of integers.""" def __init__(self, parent, value, width, state): AbstractField.__init__(self, parent, value, width, state) def getNumber(self): """Returns the integer contained in the field. Raises: ValueError if number format is bad.""" return int(self.getValue()) def setNumber(self, number): """Replaces the integer contained in the field.""" self.setValue(str(number)) class TextField(AbstractField): """Represents a single line box for I/O of strings.""" def __init__(self, parent, value, width, state): AbstractField.__init__(self, parent, value, width, state) def getText(self): """Returns the string contained in the field.""" return self.getValue() def setText(self, text): """Replaces the string contained in the field.""" self.setValue(text) class TextArea(tkinter.Text): """Represents a box for I/O of multiline text.""" def __init__(self, parent, text, width, height, xscrollcommand, yscrollcommand, wrap): tkinter.Text.__init__(self, parent, width = width, height = height, wrap = wrap, xscrollcommand = xscrollcommand, yscrollcommand = yscrollcommand) self.setText(text) def getText(self): """Returns the string contained in the text area.""" return self.get("1.0", END) def setText(self, text): """Replaces the string contained in the text area.""" self.delete("1.0", END) self.insert("1.0", text) def appendText(self, text): """Inserts the text after the string contained in the text area.""" self.insert(END, text) class EasyListbox(tkinter.Listbox): """Represents a list box.""" def __init__(self, parent, width, height, yscrollcommand, listItemSelected): self._listItemSelected = listItemSelected tkinter.Listbox.__init__(self, parent, width = width, height = height, yscrollcommand = yscrollcommand, selectmode = SINGLE) self.bind("<<ListboxSelect>>", self.triggerListItemSelected) def triggerListItemSelected(self, event): """Strategy method to respond to an item selection in the list box. Runs the client's listItemSelected method with the selected index if there is one.""" if self.size() == 0: return widget = event.widget index = widget.curselection()[0] self._listItemSelected(index) def getSelectedIndex(self): """Returns the index of the selected item or -1 if no item is selected.""" tup = self.curselection() if len(tup) == 0: return -1 else: return int(tup[0]) def

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

University Coursework Help
Homework Guru
Helping Hand
Top Essay Tutor
Writer Writer Name Offer Chat
University Coursework Help

ONLINE

University Coursework Help

Hi dear, I am ready to do your homework in a reasonable price.

$77 Chat With Writer
Homework Guru

ONLINE

Homework Guru

Hi dear, I am ready to do your homework in a reasonable price and in a timely manner.

$77 Chat With Writer
Helping Hand

ONLINE

Helping Hand

I am an Academic writer with 10 years of experience. As an Academic writer, my aim is to generate unique content without Plagiarism as per the client’s requirements.

$75 Chat With Writer
Top Essay Tutor

ONLINE

Top Essay Tutor

I have more than 12 years of experience in managing online classes, exams, and quizzes on different websites like; Connect, McGraw-Hill, and Blackboard. I always provide a guarantee to my clients for their grades.

$80 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

Business is a poker game and we are all bluffing - Thin layer chromatography post lab questions - Royles wilmslow bike shop - Swot analysis of singapore economy - Hymn of acxiom lyrics - Kilo mega giga tera peta - Pepsi refresh case study - Complying fund letter hesta - Managerial decision modeling with spreadsheets 3rd edition solutions - Acc 202 budget variance report - Managing employee retention and turnover with 21st century ideas - Discussion - Phi 103 week 4 journal - Balloon breathing conscious discipline - Humn 8660 - Separating substances virtual lab answers - Letter from birmingham jail critical thinking questions answers - You are using an exponential smoothing model for forecasting - Katy perry firework song lyrics - Campbell soup annual report 2011 - ASSIGNMENT 04 - Closed stratification system example - Your inner critic lowers your self esteem by - Directors assistant funeral software - Peter drucker management theory ppt - Negotiation exam questions - General Biology - Apple upgrade program return phone - Gain crossover frequency in bode plot - BA Assignment - Practical connection paper - The economic injustice of plastic - Rectangular tray using sheet metal - Sodium acetate trihydrate pka - Bio rad pcr song - Buzz lightyear intro speech - Juris doctor uwa handbook - Case study - Love song of j alfred prufrock beginning - Kingspan k10 soffit board - Cat d6c 76a specs - Calculate the emf of the dry cell, in volts. - Css lab activity - Jim pearson alzheimer scotland - Blood brothers edward key quotes - Ol 125 personal leadership reflection template - 17995 constitution circle hagerstown md - Ashrae self directed learning - Acounting - How to clone rootstock - Engstrom auto mirror plant root cause - PS490 Assignment 7 - Ccnpv7 tshoot skills based assessment answers - MKT/435 WEEK 2 - Homework 2.3 piecewise functions answers - George mason university application essay - What is cultural literacy in education - Davies v swan motor co - Code 61 62 flange dimensions - Lounge suite warehouse st marys - Project control should always focus on the critical path - CIS450 Discussion Mod 4: - Prm handbook free download - College lane surgery ackworth - The term shaman comes from the tungus language of: - How to find the multiplicity of a zero - Chemistry of life test answer key - Managerial Accounting: CLA2 - Below are incomplete financial statements for bulldog inc - Spontaneous communitas abolishes status. - Week 6 assignment 3.2 voice mail follow up - Endeavour energy technical review request - Suppose the baseball hall of fame in cooperstown - Dry ice inc is a manufacturer of air conditioners - Week -2 diss -833 - Winthrop a model of christian charity pdf - COM303 Week 4 Discussion 13 - IT SOURCING AND DEVELOPMENT IN A GLOBAL ECONOMY - All or nothing thinking worksheet - Fin 534 homework set 4 answers - 2.1 10 practice complete your assignment - Eight crazy nights script - Lección 3 grammar quiz - Bowlby and ainsworth 3 8 months - Assignment - Why be happy when you could be normal litcharts - How many tpc courses are there - In bennis's definition of leadership the word subordinate seems to - Argument - Good things about cell phones in school - Webassign college algebra answer key - Destitute domestic violence concession - Sanaa architects rolex learning center - Comm skills for criminal justice week 5 discussion - How has the proliferation of mobile devices affect it professionals - The wallace group case analysis - Main idea of me talk pretty one day - Ava worthington cape cod - Aig bailout summary - Three ethical decision criteria