5. Visualization - Siromanec/logic_discr GitHub Wiki
Visuals
This module contains all the textures of our app and the main module with GUI interface
Interface

Classes and functions
Class Line
Used to represent the conductors and connect pins
line = Line(color="black",
width = 3,
canvas: Canvas=root_canvas,
connected_pins=(Pin, Pin))
Methods
set_connected_pins - sets tuple of pins that are connected by this line
get_connected_pins - returns a tuple of pins that are connected by this line
clear_last_pins - clears a list with the last pair of pins to connect
valide_click- checks if a user clicked on the free pin
draw_line - connects two dots with a line
Other Functions
-
deletedeletes an element from the canvas -
curr_com_putdefines that is time to call (binds left click with) a function that puts element images and creates an appropriate object -
putputs image of an element on the canvas and creates an appropriate object -
switch_clickswitches click's image on right click -
curr_com_connectresponsible for the connect button -
curr_com_deleteresponsible for the delete button -
startstarts the main Tk loop -
maincontains the setups of all the object on the app
Libraries used
- Tkinter as the main GUI toolkit
- Customtkinter a module by Tom Schimansky and co from here for custom buttons, frames, texts and etc.
- PIL for processing png images for buttons and for displaying on the canvas