From 723103628ccb1679fc7e94022f5a97176442544d Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Mon, 13 Dec 2021 18:31:05 +0100 Subject: Clean up GUI code, set up network constellation plots --- src/gui/test.py | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 src/gui/test.py (limited to 'src/gui/test.py') diff --git a/src/gui/test.py b/src/gui/test.py deleted file mode 100644 index f3accf3..0000000 --- a/src/gui/test.py +++ /dev/null @@ -1,40 +0,0 @@ -import dearpygui.dearpygui as dpg - -# Callbacks -def cb_nextpic(sender, app_data, user_data): - dpg.set_value(texture_id, user_data['textures'][user_data['next_key']]) - - # Set key for next Image. Rotate back to 1 when last image has been shown - if user_data['next_key'] < 11: - user_data['next_key'] = user_data['next_key']+1 - else: - user_data['next_key'] = 1 - - -# Load in the Logo and add it to the texture_registry -# TODO: Find out, what that thing is actually doing. It is not really clear atm. -width, height, channels, data = dpg.load_image("logo.png") -with dpg.texture_registry(): - texture_id = dpg.add_dynamic_texture(width, height, data) - -# Next, load in the rest of the pictures -# Important: We are only interested in the data part here! -# Important: All the images must have the same size, because they are -# displayed on the image that will be created from the -# texture_id of the registry -img_dict = {} -for a in range(11): - width, height, channels, data = dpg.load_image(f"resources\img{a+1}.png") - img_dict[a+1] = data - -img_handler_dict = { - 'next_key': 1, - 'textures': img_dict -} - -with dpg.window(label="Hangman") as main_window: - dpg.add_image(texture_id) - dpg.add_button(label="Next IMG", callback=cb_nextpic, user_data=img_handler_dict) - -dpg.set_primary_window(main_window, True) -dpg.start_dearpygui() \ No newline at end of file -- cgit v1.2.1