Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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()
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()
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()
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()
# note: cannot use screen.fill((1, 1, 1)) because pygame's screen
# does not support fill() on OpenGL sufraces
gl.glClearColor(1, 1, 1, 1)
gl.glClear(gl.GL_COLOR_BUFFER_BIT)
imgui.render()
pygame.display.flip()
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())
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()
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 changed:
return (ent, att, new_value)
elif (metadata and metadata["type"] == 1) or (not metadata and isinstance(v, str)):
changed, new_value = imgui.input_text(
iden,
v,
256,
imgui.INPUT_TEXT_ENTER_RETURNS_TRUE
)
if changed:
return (ent, att, new_value)
except Exception as e:
print("--------")
traceback.print_exc()
print("--------")
imgui.text_colored(str(v), 1, 0, 0, 1)
if imgui.is_item_hovered() and metadata:
imgui.begin_tooltip()
imgui.text_colored("Type: ", 0, 0, 1, 1)
imgui.same_line()
descriptor = ""
if metadata.get("is_list"):
descriptor = "list"
imgui.text(DB.type_name[metadata["type"]] + " " + descriptor)
imgui.text(metadata["description"])
imgui.end_tooltip()
return None
)
imgui.pop_item_width()
imgui.same_line()
if query_language == 0:
imgui.push_font(monospace_font)
changed, query_value = imgui.input_text(
'##query-box',
query_value,
256,
imgui.INPUT_TEXT_ENTER_RETURNS_TRUE
)
if query_language == 0:
imgui.pop_font()
if query_binds == {}:
imgui.text_colored("The results match, but no bindings were created", 0, 1, 0, 1)
elif query_binds:
draw_query(query_binds)
elif query_binds is None and query_result:
imgui.text_colored("Bindings empty but backtracker still present. Try clicking 'Next'", 0, 0, 1, 1)
else:
imgui.text("No results")
if changed:
if query_language == 0:
try:
query_result = eav.evaluate_rule(DB, eav.body(query_value)[0], query_binds or {})
query_error = ""
new_query_result = True
except Exception as e:
query_error = "Parse Error: " + str(e)
traceback.print_exc()
imgui.next_column()
res = draw_eav_value(DB, ent, att, v)
if res:
changes.append(res)
imgui.next_column()
for change in changes:
try:
DB.add(change)
table_error = ""
except ValueError as e:
table_error = "Data Error: " + str(e)
imgui.columns(1)
imgui.text_colored(table_error, 1, 0, 0, 1)
imgui.end()