Older stuff/Tests_alias_TKinter_gui.py
def initialize_settings(self, container):
        """
        Renders the choice of all possible settings parameters.
        """
        # Rendering the Material Menu on the very top
        self.initialize_material_menu(container)

        # Defined list of all parameters we want to get as an input from the user
        # All the parameters must have the same structure to work properly
        self.number_parameters_to_get_from_user = [
            {"name": "Simulation step",
                "input_name": "simulation_step_input_seconds",
                "default_value": 1.0,
                "parse_function": float,
                "multiplicate_to_SI": 1,
                "unit": "seconds",
                "unit_abbrev": "s"},
            {"name": "Object length",
                "input_name": "object_length_input_centimetres",
                "default_value": 1,
                "parse_function": float,
                "multiplicate_to_SI": 0.01,
                "unit": "centimeters",
                "unit_abbrev": "cm"},
            {"name": "Position of interest",
                "input_name": "place_position_input_centimetres",
                "default_value": 0.445,
                "parse_function": float,
                "multiplicate_to_SI": 0.01,
                "unit": "centimetres",
                "unit_abbrev": "cm"},
            {"name": "Number of elements",
                "input_name": "number_of_elements_input",
                "default_value": 100,
                "parse_function": int,
                "multiplicate_to_SI": 1,
                "unit": "",
                "unit_abbrev": "-"}
        ]

        # Defining characteristics for all the rows and columns
        label_x = 0.00
        label_width = 0.71
        input_x = 0.73
        input_width = 0.27
        row_height = 0.1
        space_between_rows = 0.01

        settings_label_font = ("Calibri", 16)
        settings_entry_font = ("Calibri", 20)

        row_index = 0
        # Rendering all the defined parameters at once in a loop
        for parameter in self.number_parameters_to_get_from_user:
            # Starting from 1, because Material Menu has already taken one row
            row_index += 1
            rely_of_row = row_index * (row_height + space_between_rows)
            label_text = "{} [{}]:".format(parameter["name"], parameter["unit_abbrev"])
            self.label = tk.Label(container, text=label_text, font=settings_label_font)
            self.label.place(relx=label_x, rely=rely_of_row, relheight=row_height, relwidth=label_width)
            setattr(self, parameter["input_name"], tk.Entry(container, font=settings_entry_font))
            getattr(self, parameter["input_name"]).place(relx=input_x, rely=rely_of_row,
                                                        relheight=row_height, relwidth=input_width)
            getattr(self, parameter["input_name"]).insert(0, parameter["default_value"])

        Renders the choice of all possible settings parameters.
        
Renders the choice of all possible settings parameters.
Renders the choice of all possible settings parameters .
def initialize_settings(self, container):
        self.initialize_material_menu(container)
        self.number_parameters_to_get_from_user = [
            {"name": "Simulation step",
                "input_name": "simulation_step_input_seconds",
                "default_value": 1.0,
                "parse_function": float,
                "multiplicate_to_SI": 1,
                "unit": "seconds",
                "unit_abbrev": "s"},
            {"name": "Object length",
                "input_name": "object_length_input_centimetres",
                "default_value": 1,
                "parse_function": float,
                "multiplicate_to_SI": 0.01,
                "unit": "centimeters",
                "unit_abbrev": "cm"},
            {"name": "Position of interest",
                "input_name": "place_position_input_centimetres",
                "default_value": 0.445,
                "parse_function": float,
                "multiplicate_to_SI": 0.01,
                "unit": "centimetres",
                "unit_abbrev": "cm"},
            {"name": "Number of elements",
                "input_name": "number_of_elements_input",
                "default_value": 100,
                "parse_function": int,
                "multiplicate_to_SI": 1,
                "unit": "",
                "unit_abbrev": "-"}
        ]
        label_x = 0.00
        label_width = 0.71
        input_x = 0.73
        input_width = 0.27
        row_height = 0.1
        space_between_rows = 0.01
        settings_label_font = ("Calibri", 16)
        settings_entry_font = ("Calibri", 20)
        row_index = 0
        for parameter in self.number_parameters_to_get_from_user:
            row_index += 1
            rely_of_row = row_index * (row_height + space_between_rows)
            label_text = "{} [{}]:".format(parameter["name"], parameter["unit_abbrev"])
            self.label = tk.Label(container, text=label_text, font=settings_label_font)
            self.label.place(relx=label_x, rely=rely_of_row, relheight=row_height, relwidth=label_width)
            setattr(self, parameter["input_name"], tk.Entry(container, font=settings_entry_font))
            getattr(self, parameter["input_name"]).place(relx=input_x, rely=rely_of_row,
                                                        relheight=row_height, relwidth=input_width)
            getattr(self, parameter["input_name"]).insert(0, parameter["default_value"])
def initialize_settings ( self , container ) : self . initialize_material_menu ( container ) self . number_parameters_to_get_from_user = [ { "name" : "Simulation step" , "input_name" : "simulation_step_input_seconds" , "default_value" : 1.0 , "parse_function" : float , "multiplicate_to_SI" : 1 , "unit" : "seconds" , "unit_abbrev" : "s" } , { "name" : "Object length" , "input_name" : "object_length_input_centimetres" , "default_value" : 1 , "parse_function" : float , "multiplicate_to_SI" : 0.01 , "unit" : "centimeters" , "unit_abbrev" : "cm" } , { "name" : "Position of interest" , "input_name" : "place_position_input_centimetres" , "default_value" : 0.445 , "parse_function" : float , "multiplicate_to_SI" : 0.01 , "unit" : "centimetres" , "unit_abbrev" : "cm" } , { "name" : "Number of elements" , "input_name" : "number_of_elements_input" , "default_value" : 100 , "parse_function" : int , "multiplicate_to_SI" : 1 , "unit" : "" , "unit_abbrev" : "-" } ] label_x = 0.00 label_width = 0.71 input_x = 0.73 input_width = 0.27 row_height = 0.1 space_between_rows = 0.01 settings_label_font = ( "Calibri" , 16 ) settings_entry_font = ( "Calibri" , 20 ) row_index = 0 for parameter in self . number_parameters_to_get_from_user : row_index += 1 rely_of_row = row_index * ( row_height + space_between_rows ) label_text = "{} [{}]:" . format ( parameter [ "name" ] , parameter [ "unit_abbrev" ] ) self . label = tk . Label ( container , text = label_text , font = settings_label_font ) self . label . place ( relx = label_x , rely = rely_of_row , relheight = row_height , relwidth = label_width ) setattr ( self , parameter [ "input_name" ] , tk . Entry ( container , font = settings_entry_font ) ) getattr ( self , parameter [ "input_name" ] ) . place ( relx = input_x , rely = rely_of_row , relheight = row_height , relwidth = input_width ) getattr ( self , parameter [ "input_name" ] ) . insert ( 0 , parameter [ "default_value" ] )
Renders the choice of all possible settings parameters.
Renders the choice of all possible settings parameters .
"""
        Renders the choice of all possible settings parameters.
        """ # Rendering the Material Menu on the very top # Defined list of all parameters we want to get as an input from the user # All the parameters must have the same structure to work properly # Defining characteristics for all the rows and columns # Rendering all the defined parameters at once in a loop # Starting from 1, because Material Menu has already taken one row
self
container