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

Create House Like Structure Perform Operations Program In C | VCMIT

Program to create a house like figure and perform the following operations.  Scaling about the origin followed by translation.  Scaling with reference to an arbitrary point. Reflect about the line y = mx + c. INPUT #include <stdio.h> #include <graphics.h> #include <stdlib.h> #include <math.h> #include <conio.h> void reset (int h[][2]) { int val[9][2] = { { 50, 50 },{ 75, 50 },{ 75, 75 },{ 100, 75 }, { 100, 50 },{ 125, 50 },{ 125, 100 },{ 87, 125 },{ 50, 100 } }; int i; for (i=0; i<9; i++) { h[i][0] = val[i][0]-50; h[i][1] = val[i][1]-50; } } void draw (int h[][2]) { int i; setlinestyle (DOTTED_LINE, 0, 1); line (320, 0, 320, 480); line (0, 240, 640, 240); setlinestyle (SOLID_LINE, 0, 1); for (i=0; i<8; i++) line (320+h[i][0], 240-h[i][1], 320+h[i+1][0], 240-h[i+1][1]); line (320+h[0][0], 240-h[0][1], 320+h[8][0], 240-h[8][1]); } void rotate (int h[][2], float angle) { int i; for (i=0; i<9; i++) { int xnew, ynew; xnew = h[i][0] * cos (angl...

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 ...

Drawing Different Shapes Program In C | BGI | VCMIT

Drawing Different Shapes Program In C INPUT #include<graphics.h> #include<conio.h> main() {    int gd = DETECT,gm,left=100,top=100,right=200,bottom=200,x= 300,y=150,radius=50;    initgraph(&gd, &gm, "C:\\TC\\BGI");    rectangle(left, top, right, bottom);    circle(x, y, radius);    bar(left + 300, top, right + 300, bottom);    line(left - 10, top + 150, left + 410, top + 150);    ellipse(x, y + 200, 0, 360, 100, 50);    outtextxy(left + 100, top + 325, "My first C graphics program");    getch();    closegraph();    return 0; } OUTPUT