Compare commits
	
		
			2 Commits
		
	
	
		
			ccae883f17
			...
			e58518327e
		
	
	| Author | SHA1 | Date | 
|---|---|---|
|  | e58518327e | |
|  | 8b2476eeeb | 
							
								
								
									
										11
									
								
								main.py
								
								
								
								
							
							
						
						
									
										11
									
								
								main.py
								
								
								
								
							|  | @ -1,11 +0,0 @@ | ||||||
| from MutiFunctionProgramProject.ui.centered_window import CenteredWindow |  | ||||||
| 
 |  | ||||||
| def main(): |  | ||||||
|     # Crear una instancia de la ventana centrada |  | ||||||
|     app = CenteredWindow(title="Ventana Principal", width_percentage=0.75, height_percentage=0.75) |  | ||||||
|      |  | ||||||
|     # Ejecutar la ventana |  | ||||||
|     app.mainloop() |  | ||||||
| 
 |  | ||||||
| if __name__ == "__main__": |  | ||||||
|     main() |  | ||||||
|  | @ -0,0 +1,11 @@ | ||||||
|  | from ui.centered_window import CenteredWindow | ||||||
|  | 
 | ||||||
|  | def main(): | ||||||
|  |     # Crear una instancia de la ventana centrada | ||||||
|  |     app = CenteredWindow() | ||||||
|  |      | ||||||
|  |     # Ejecutar la ventana | ||||||
|  |     app.mainloop() | ||||||
|  | 
 | ||||||
|  | if __name__ == "__main__": | ||||||
|  |     main() | ||||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							|  | @ -9,8 +9,8 @@ class CenteredWindow(ctk.CTk): | ||||||
|         self.title(title) |         self.title(title) | ||||||
| 
 | 
 | ||||||
|         # Obtener la resolucion de la pantalla: |         # Obtener la resolucion de la pantalla: | ||||||
|         screen_width = self.winfo.screenwidth() |         screen_width = self.winfo_screenwidth() | ||||||
|         screen_height = self.winfo.screenheight() |         screen_height = self.winfo_screenheight() | ||||||
| 
 | 
 | ||||||
|         # Calcula el tamaño de la ventana según procentaje de la pantalla: |         # Calcula el tamaño de la ventana según procentaje de la pantalla: | ||||||
|         window_width = int(screen_width * width_percentage) |         window_width = int(screen_width * width_percentage) | ||||||
|  | @ -22,6 +22,7 @@ class CenteredWindow(ctk.CTk): | ||||||
| 
 | 
 | ||||||
|         self.geometry(f"{window_width}x{window_height}+{position_x}+{position_y}") |         self.geometry(f"{window_width}x{window_height}+{position_x}+{position_y}") | ||||||
| 
 | 
 | ||||||
|  |         #Configura la ventana (fuera del constructor) | ||||||
|         self.configure_window() |         self.configure_window() | ||||||
| 
 | 
 | ||||||
|     def configure_window(self): |     def configure_window(self): | ||||||
		Loading…
	
		Reference in New Issue