Skip to main content

Python TKinter Theme Program | TKinter | VCMIT

Python TKinter Theme Program | TKinter | WaoFamHub



INPUT

from tkinter import Tk, Label, Button, Entry, X

import tkinter
from tkinter import ttk
from tkinter import messagebox


class Root(Tk):
    def __init__(self):
        super().__init__()

        for x in [ttk.Label, ttk.Button, ttk.Entry, ttk.Checkbutton, ttk.Radiobutton]:
            x(self, text='Some ' + x.__name__).pack(fill=X)
        pb = ttk.Progressbar(self, length=100)
        pb.pack(fill=X)
        pb.step(33)

        ttk.Label(self, text='Select theme:').pack(pady=[50, 10])

        self.style = ttk.Style()
        self.combo = ttk.Combobox(self, values=self.style.theme_names())
        self.combo.pack(pady=[0, 10])
        button = ttk.Button(self, text='Apply')
        button['command'] = self.change_theme
        button.pack(pady=10)

    def change_theme(self):
        content = self.combo.get()
        try:
            self.style.theme_use(content)
        except:
            print("Failed to set theme " + content)


root = Root()
root.mainloop()

OUTPUT



Comments

Popular posts from this blog

Software Engineering - Waterfall Model | VCMIT

Waterfall model Winston Royce introduced the Waterfall Model in 1970.This model has five phases: Requirements analysis and specification, design, implementation, and unit testing, integration and system testing, and operation and maintenance. The steps always follow in this order and do not overlap. The developer must complete every phase before the next phase begins. This model is named "Waterfall Model", because its diagrammatic representation resembles a cascade of waterfalls. 1. Requirements analysis and specification phase: The aim of this phase is to understand the exact requirements of the customer and to document them properly. Both the customer and the software developer work together so as to document all the functions, performance, and interfacing requirement of the software. It describes the "what" of the system to be produced and not "how."In this phase, a large document called Software Requirement Specification (SRS) document is created whic...

Software Engineering - Spiral Model | VCMIT

Spiral Model The spiral model, initially proposed by Boehm, is an evolutionary software process model that couples the iterative feature of prototyping with the controlled and systematic aspects of the linear sequential model. It implements the potential for rapid development of new versions of the software. Using the spiral model, the software is developed in a series of incremental releases. During the early iterations, the additional release may be a paper model or prototype. During later iterations, more and more complete versions of the engineered system are produced. Each cycle in the spiral is divided into four parts: Objective setting: Each cycle in the spiral starts with the identification of purpose for that cycle, the various alternatives that are possible for achieving the targets, and the constraints that exists. Risk Assessment and reduction: The next phase in the cycle is to calculate these various alternatives based on the goals and constraints. The focus of evaluation ...

Software Engineering - RAD (Rapid Application Development) Model | VCMIT

RAD (Rapid Application Development) Model RAD is a linear sequential software development process model that emphasizes a concise development cycle using an element based construction approach. If the requirements are well understood and described, and the project scope is a constraint, the RAD process enables a development team to create a fully functional system within a concise time period. RAD (Rapid Application Development) is a concept that products can be developed faster and of higher quality through: Gathering requirements using workshops or focus groups Prototyping and early, reiterative user testing of designs The re-use of software components A rigidly paced schedule that refers design improvements to the next product version Less formality in reviews and other team communication The various phases of RAD are as follows: 1.Business Modelling: The information flow among business functions is defined by answering questions like what data drives the business process, what data...