Showing posts with label simple GUI. Show all posts
Showing posts with label simple GUI. Show all posts

Wednesday, 13 February 2019

Changing Colours

img_a_01

Well, in this opportunity I got some simple animation that involves a straight line that change its colour between 4 options in a fixed order, it's a relatively simple task, although I've seen codes that involve the use of objects and classes, so I hope to get a better understanding on them before posting about it.

Tuesday, 26 July 2016

Canvas - Drawing Polygons

img_a_01

The first code is a simple example:

import Tkinter
root    =  Tkinter.Tk()
ch, cw  =  170, 170
c1 = Tkinter.Canvas(root, height = ch, width = cw, bg = "black")
ps = [   60, 130,  40, 120,  40,  80,  70,  40,
        100,  40, 130,  80, 130, 120, 110, 130] 

Saturday, 2 July 2016

Canvas - Drawing Ovals

img_a_01

The first code is a simple example:

import Tkinter
root    =  Tkinter.Tk()
ch, cw  =  200, 200
c1 = Tkinter.Canvas(root, height = ch, width = cw, bg = "black")
c1.create_oval(30, 30, 175, 175, outline = "yellow", width = 2) 

Thursday, 10 March 2016

Canvas - Drawing Rectangles

img_16_10_001001001

The first code is a simple example:

from Tkinter import *
root = Tk()
c1 = Canvas(root, height = 180, width = 200, background = "black" )
c1.create_rectangle( 27, 17, 103,  93, fill = "blue", outline = "cyan")
c1.create_rectangle(103, 93, 179, 169, fill = "red", outline = "yellow")
c1.pack()
root.title("Rectangles")
root.mainloop()
 

Sunday, 29 November 2015

Drop Down Menus



The next code is a simple example of how to make appear menus with Tkinter:

from Tkinter import *
def dns():

Monday, 26 October 2015

Solving 2 Linear equations

img_01

The next code is based on the Gauss Elimination method for solving a system of linear equations.

# Gauss elimination method for 2 linear equations
import Tkinter as tk

def lab_1(txt, foreground, row, col):
    w = tk.Label(root, text = txt, fg = foreground)
    w.grid(row = row, column = col)
    return w