Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if imgui.begin_main_menu_bar():
if imgui.begin_menu("File", True):
clicked_quit, selected_quit = imgui.menu_item(
"Quit", 'Cmd+Q', False, True
)
if clicked_quit:
exit(1)
imgui.end_menu()
imgui.end_main_menu_bar()
imgui.show_test_window()
imgui.begin("Custom window", True)
imgui.text("Bar")
imgui.text_colored("Eggs", 0.2, 1., 0.)
imgui.end()
gl.glClearColor(1., 1., 1., 1)
gl.glClear(gl.GL_COLOR_BUFFER_BIT)
imgui.render()
impl.render(imgui.get_draw_data())
glfw.swap_buffers(window)
impl.shutdown()
glfw.terminate()
if imgui.begin_main_menu_bar():
if imgui.begin_menu("File", True):
clicked_quit, selected_quit = imgui.menu_item(
"Quit", 'Cmd+Q', False, True
)
if clicked_quit:
exit(1)
imgui.end_menu()
imgui.end_main_menu_bar()
imgui.show_test_window()
imgui.begin("Custom window", True)
imgui.text("Bar")
imgui.text_colored("Eggs", 0.2, 1., 0.)
imgui.end()
gl.glClearColor(1., 1., 1., 1)
gl.glClear(gl.GL_COLOR_BUFFER_BIT)
imgui.render()
SDL_GL_SwapWindow(window)
renderer.shutdown()
SDL_GL_DeleteContext(gl_context)
SDL_DestroyWindow(window)
SDL_Quit()
on_exit()
try:
sys.exit()
except SystemExit as e:
time.sleep(0.5)
# sys.exit()
# sys.terminate()
os._exit(1)
pygame_renderer.process_event(event)
imgui.new_frame()
if params.provide_default_window:
imgui.set_next_window_position(0, 0)
imgui.set_next_window_size(win_size[0], win_size[1])
imgui.begin("Default window")
gui_loop_function()
if params.provide_default_window:
imgui.end()
ImGuiImageLister._heartbeat()
# note: cannot use screen.fill((1, 1, 1)) because pygame's screen
# does not support fill() on OpenGL surfaces
gl.glClearColor(1, 1, 1, 1)
gl.glClear(gl.GL_COLOR_BUFFER_BIT)
imgui.render()
pygame_renderer.render(imgui.get_draw_data())
pygame.display.flip()
imgui_cv._clear_all_cv_textures()
imgui_ext.__clear_all_unique_labels()
def on_frame():
if imgui.begin_main_menu_bar():
if imgui.begin_menu("File", True):
clicked_quit, selected_quit = imgui.menu_item(
"Quit", 'Cmd+Q', False, True
)
if clicked_quit:
exit(1)
imgui.end_menu()
imgui.end_main_menu_bar()
imgui.show_test_window()
imgui.begin("Custom window", True)
imgui.text("Bar")
imgui.text_colored("Eggs", 0.2, 1., 0.)
imgui.end()
if imgui.begin_main_menu_bar():
if imgui.begin_menu("File", True):
clicked_quit, selected_quit = imgui.menu_item(
"Quit", 'Cmd+Q', False, True
)
if clicked_quit:
exit(1)
imgui.end_menu()
imgui.end_main_menu_bar()
imgui.show_test_window()
imgui.begin("Custom window", True)
imgui.text("Bar")
imgui.text_colored("Eggs", 0.2, 1., 0.)
imgui.end()
imgui.render()
self.imgui.render(imgui.get_draw_data())
def main():
global ERROR
renderer = NXRenderer()
currentDir = os.getcwd()
while True:
renderer.handleinputs()
imgui.new_frame()
width, height = renderer.io.display_size
imgui.set_next_window_size(width, height)
imgui.set_next_window_position(0, 0)
imgui.begin("",
flags=imgui.WINDOW_NO_TITLE_BAR | imgui.WINDOW_NO_RESIZE | imgui.WINDOW_NO_MOVE | imgui.WINDOW_NO_SAVED_SETTINGS
)
imgui.begin_group()
imgui.text("Welcome to PyNX!")
imgui.text("Touch is supported")
imgui.text("Current dir: " + os.getcwd())
if os.getcwd() != "sdmc:/":
imgui.push_style_color(imgui.COLOR_BUTTON, *FOLDER_COLOR)
if imgui.button("../", width=200, height=60):
os.chdir("..")
imgui.pop_style_color(1)
dirs = []
files = []
def _heartbeat(self):
if not self.opened:
return
if self.current_image == "":
self._select_first_image()
imgui.set_next_window_position(self.position.x, self.position.y, imgui.APPEARING)
imgui.set_next_window_size(self.actual_window_startup_size().x, self.actual_window_startup_size().y,
imgui.APPEARING)
expanded, self.opened = imgui.begin("Imgui Image Lister")
self._show_list()
imgui.same_line()
self._show_image()
imgui.end()