-
I have been using import cv2
import numpy as np
from imgui_bundle import hello_imgui, imgui, immapp, immvision
from imgui_bundle.demos_python import demo_utils
immvision.use_bgr_color_order()
def panel_gui():
imgui.button("Test panel")
def image_gui(img: np.ndarray):
immvision.image_display("test img", img, (500, 428))
def runner_params_setup(img: np.ndarray):
runner_params = hello_imgui.RunnerParams()
runner_params.app_window_params.window_geometry.size = (650, 500)
runner_params.app_window_params.resizable = False
runner_params.imgui_window_params.default_imgui_window_type = hello_imgui.DefaultImGuiWindowType.provide_full_screen_dock_space
split = hello_imgui.DockingSplit(initial_dock_ = "MainDockSpace",
direction_ = imgui.Dir.left,
ratio_ = 0.1,
new_dock_ = "NewDockSpace",
)
runner_params.docking_params.docking_splits = [split]
image_window = hello_imgui.DockableWindow(label_ = "image",
dock_space_name_="MainDockSpace",
gui_function_ = lambda: image_gui(img),
can_be_closed_= False
)
panel_window = hello_imgui.DockableWindow(label_ = "panel",
dock_space_name_="NewDockSpace",
gui_function_ = panel_gui,
can_be_closed_= False
)
# I want to disable resizable (the bordering line between the two windows)
# such that `image_window` and `panel_window` are fixed with the size that the two windows spawn/load with
runner_params.docking_params.dockable_windows = [image_window, panel_window]
immapp.run(runner_params)
def main():
img_path = demo_utils.demos_assets_folder() + "/images/house.jpg"
img = cv2.imread(img_path)
img = cv2.resize(img, dsize=None, fx=0.5, fy=0.5)
runner_params_setup(img)
if __name__ == '__main__':
main() |
Beta Was this translation helpful? Give feedback.
Answered by
pthom
Dec 19, 2024
Replies: 1 comment
-
Look at imgui_bundle/bindings/imgui_bundle/hello_imgui.pyi Lines 2410 to 2446 in bd7d372 And thus: runner_params.docking_params.main_dock_space_node_flags = imgui.DockNodeFlags_.no_resize.value |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
angecide
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Look at
main_dock_space_node_flags
in DockingParamsimgui_bundle/bindings/imgui_bundle/hello_imgui.pyi
Lines 2410 to 2446 in bd7d372