bimpy - References

Submodules

bimpy.themes module

bimpy.themes.set_light_theme()[source]

light style from Pacome Danhiez (user itamago) https://github.com/ocornut/imgui/pull/511#issuecomment-175719267

Module contents

class bimpy.App(width=600, height=600, title='Hello', **kwargs)[source]

Bases: object

A base class for the application.

Note

You need to implement your own application class that derives from this class.

Warning

You will need to call set_image before you can run it

Parameters
  • width (int) – width of the window. Default: 600.

  • height (int) – height of the window. Default: 600.

  • title (str) – title of the window. Default: “Hello”.

Example

>>> import bimpy
>>>
>>> class App(bimpy.App):
>>>     def __init__(self):
>>>         # Calling constructor of base class
>>>         super(App, self).__init__(title='Test')
>>>
>>> # Run app
>>> app = App()
>>> app.run()
property height

Height of the window

on_keyboard(key, down, mods)[source]

Is called on keybord key event from event loop that is run in run() method

Empty method, you need to overwrite it

Warning

  • Don’t call it, this is callback

Parameters
  • key (int) – The key that generated even. Can be anntoolkit.KeyEscape, anntoolkit.KeyTab, anntoolkit.KeyBackspace, anntoolkit.KeyInsert, anntoolkit.KeyDelete, anntoolkit.KeyRight, anntoolkit.KeyLeft, anntoolkit.KeyDown, anntoolkit.KeyUp or any char from ‘A’ to ‘Z’

  • down (bool) – True if key is pressed. False if key is released.

  • mods (int) – Indicates additional modifing keys, such as Ctrl, Shift, Alt

Example

>>> def on_keyboard(self, key, down, mods):
>>>     if down:
>>>         if key == anntoolkit.KeyLeft:
>>>             ...
>>>         if key == anntoolkit.KeyRight:
>>>             ...
>>>         if key == anntoolkit.KeyUp:
>>>             ...
>>>         if key == anntoolkit.KeyDown:
>>>             ...
>>>         if key == anntoolkit.KeyDelete:
>>>             ...
>>>         if key == anntoolkit.KeyBackspace:
>>>             ...
>>>         if key == 'R':
>>>             ...
>>>         if key == 'A':
>>>             ...
>>>         if key == 'Q':
>>>             ...
on_mouse_button(button, down, x, y)[source]

Is called on left mouse button event from event loop that is run in run() method If the user presses left button on the mouse, this method is called

Empty method, you need to overwrite it

Warning

  • Don’t call it, this is callback

Parameters
  • button (int) – If 0 - Left mouse button; if 1 - right mouse button; if > 1 - other buttons.

  • down (bool) – True if left mouse button is pressed. False if left mouse button is released.

  • x (float) – x coordinate of mouse cursor in window coordinate system

  • y (float) – y coordinate of mouse cursor in window coordinate system

on_mouse_position(x, y)[source]

Is called on mouse move event from event loop that is run in run() method If the user moves mouse, this method is called

Empty method, you need to overwrite it

Warning

  • Don’t call it, this is callback

Parameters
  • x (float) – x coordinate of mouse cursor in window coordinate system

  • y (float) – y coordinate of mouse cursor in window coordinate system

on_update()[source]

Is called each frame from the event loop that is run in run() method

Empty method, you need to overwrite it. Do all drawing from here.

Note

  • Calls to draw API are valid only from within this method. Draw API: point(), box(), text(), etc.

Warning

  • Don’t call it, this is callback

run()[source]

Runs the application.

Note

This is a blocking call. It won’t return until the window is closed

Runs an event loop, where it process user input and updates window. Call callback method on_update().

Example

>>> app = App()
>>> app.run()
property width

Width of the window

class bimpy.Bool

Bases: pybind11_builtins.pybind11_object

property value
class bimpy.Colors

Bases: pybind11_builtins.pybind11_object

Members:

Text

TextDisabled

WindowBg

ChildBg

PopupBg

Border

BorderShadow

FrameBg

FrameBgHovered

FrameBgActive

TitleBg

TitleBgActive

TitleBgCollapsed

MenuBarBg

ScrollbarBg

ScrollbarGrab

ScrollbarGrabHovered

ScrollbarGrabActive

CheckMark

SliderGrab

SliderGrabActive

Button

ButtonHovered

ButtonActive

Header

HeaderHovered

HeaderActive

Separator

SeparatorHovered

SeparatorActive

ResizeGrip

ResizeGripHovered

ResizeGripActive

Tab

TabHovered

TabActive

TabUnfocused

TabUnfocusedActive

PlotLines

PlotLinesHovered

PlotHistogram

PlotHistogramHovered

TextSelectedBg

DragDropTarget

NavHighlight

NavWindowingHighlight

NavWindowingDimBg

ModalWindowDimBg

ChildWindowBg

ModalWindowDarkening

Border = <Colors.Border: 5>
BorderShadow = <Colors.BorderShadow: 6>
Button = <Colors.Button: 21>
ButtonActive = <Colors.ButtonActive: 23>
ButtonHovered = <Colors.ButtonHovered: 22>
CheckMark = <Colors.CheckMark: 18>
ChildBg = <Colors.ChildBg: 3>
ChildWindowBg = <Colors.ChildBg: 3>
DragDropTarget = <Colors.DragDropTarget: 43>
FrameBg = <Colors.FrameBg: 7>
FrameBgActive = <Colors.FrameBgActive: 9>
FrameBgHovered = <Colors.FrameBgHovered: 8>
Header = <Colors.Header: 24>
HeaderActive = <Colors.HeaderActive: 26>
HeaderHovered = <Colors.HeaderHovered: 25>
MenuBarBg = <Colors.MenuBarBg: 13>
ModalWindowDarkening = <Colors.ModalWindowDimBg: 47>
ModalWindowDimBg = <Colors.ModalWindowDimBg: 47>
NavHighlight = <Colors.NavHighlight: 44>
NavWindowingDimBg = <Colors.NavWindowingDimBg: 46>
NavWindowingHighlight = <Colors.NavWindowingHighlight: 45>
PlotHistogram = <Colors.PlotHistogram: 40>
PlotHistogramHovered = <Colors.PlotHistogramHovered: 41>
PlotLines = <Colors.PlotLines: 38>
PlotLinesHovered = <Colors.PlotLinesHovered: 39>
PopupBg = <Colors.PopupBg: 4>
ResizeGrip = <Colors.ResizeGrip: 30>
ResizeGripActive = <Colors.ResizeGripActive: 32>
ResizeGripHovered = <Colors.ResizeGripHovered: 31>
ScrollbarBg = <Colors.ScrollbarBg: 14>
ScrollbarGrab = <Colors.ScrollbarGrab: 15>
ScrollbarGrabActive = <Colors.ScrollbarGrabActive: 17>
ScrollbarGrabHovered = <Colors.ScrollbarGrabHovered: 16>
Separator = <Colors.Separator: 27>
SeparatorActive = <Colors.SeparatorActive: 29>
SeparatorHovered = <Colors.SeparatorHovered: 28>
SliderGrab = <Colors.SliderGrab: 19>
SliderGrabActive = <Colors.SliderGrabActive: 20>
Tab = <Colors.Tab: 33>
TabActive = <Colors.TabActive: 35>
TabHovered = <Colors.TabHovered: 34>
TabUnfocused = <Colors.TabUnfocused: 36>
TabUnfocusedActive = <Colors.TabUnfocusedActive: 37>
Text = <Colors.Text: 0>
TextDisabled = <Colors.TextDisabled: 1>
TextSelectedBg = <Colors.TextSelectedBg: 42>
TitleBg = <Colors.TitleBg: 10>
TitleBgActive = <Colors.TitleBgActive: 11>
TitleBgCollapsed = <Colors.TitleBgCollapsed: 12>
WindowBg = <Colors.WindowBg: 2>
property name
class bimpy.Condition

Bases: pybind11_builtins.pybind11_object

Members:

Always

Once

FirstUseEver

Appearing

Always = <Condition.Always: 1>
Appearing = <Condition.Appearing: 8>
FirstUseEver = <Condition.FirstUseEver: 4>
Once = <Condition.Once: 2>
property name
class bimpy.Context

Bases: pybind11_builtins.pybind11_object

property clear_color
property height
init(self: _bimpy.Context, width: int, height: int, name: str, resizable: bool = True, visible: bool = True, decorated: bool = True, focused: bool = True, auto_iconify: bool = True, floating: bool = False, maximized: bool = False, transperent: bool = False, focus_on_show: bool = True, scale_to_monitor: bool = False, full_screen: bool = False) → None

Initializes context and creates window

property keyboard_callback
property mouse_button_callback
property mouse_position_callback
new_frame(self: _bimpy.Context) → None

Starts a new frame. NewFrame must be called before any imgui functions

render(self: _bimpy.Context) → None

Finalizes the frame and draws all UI. Render must be called after all imgui functions

should_close(self: _bimpy.Context) → bool
property width
class bimpy.Corner

Bases: pybind11_builtins.pybind11_object

Members:

TopLeft

TopRight

BotRight

BotLeft

All

All = <Corner.All: 15>
BotLeft = <Corner.BotLeft: 4>
BotRight = <Corner.BotRight: 8>
TopLeft = <Corner.TopLeft: 1>
TopRight = <Corner.TopRight: 2>
property name
class bimpy.Direction

Bases: pybind11_builtins.pybind11_object

Members:

None

Left

Right

Up

Down

Down = <Direction.Down: 3>
Left = <Direction.Left: 0>
None = <Direction.None: -1>
Right = <Direction.Right: 1>
Up = <Direction.Up: 2>
property name
class bimpy.DragDropFlags

Bases: pybind11_builtins.pybind11_object

Members:

SourceNoPreviewTooltip

SourceNoDisableHover

SourceNoHoldToOpenOthers

SourceAllowNullID

SourceExtern

SourceAutoExpirePayload

AcceptBeforeDelivery

AcceptNoDrawDefaultRect

AcceptNoPreviewTooltip

AcceptPeekOnly

AcceptBeforeDelivery = <DragDropFlags.AcceptBeforeDelivery: 1024>
AcceptNoDrawDefaultRect = <DragDropFlags.AcceptNoDrawDefaultRect: 2048>
AcceptNoPreviewTooltip = <DragDropFlags.AcceptNoPreviewTooltip: 4096>
AcceptPeekOnly = <DragDropFlags.AcceptPeekOnly: 3072>
SourceAllowNullID = <DragDropFlags.SourceAllowNullID: 8>
SourceAutoExpirePayload = <DragDropFlags.SourceAutoExpirePayload: 32>
SourceExtern = <DragDropFlags.SourceExtern: 16>
SourceNoDisableHover = <DragDropFlags.SourceNoDisableHover: 2>
SourceNoHoldToOpenOthers = <DragDropFlags.SourceNoHoldToOpenOthers: 4>
SourceNoPreviewTooltip = <DragDropFlags.SourceNoPreviewTooltip: 1>
property name
class bimpy.Float

Bases: pybind11_builtins.pybind11_object

property value
class bimpy.FocusedFlags

Bases: pybind11_builtins.pybind11_object

Members:

None

ChildWindows

RootWindow

AnyWindow

RootAndChildWindows

AnyWindow = <FocusedFlags.AnyWindow: 4>
ChildWindows = <FocusedFlags.ChildWindows: 1>
None = <FocusedFlags.None: 0>
RootAndChildWindows = <FocusedFlags.RootAndChildWindows: 3>
RootWindow = <FocusedFlags.RootWindow: 2>
property name
class bimpy.Font

Bases: pybind11_builtins.pybind11_object

class bimpy.GuiStyle

Bases: pybind11_builtins.pybind11_object

property alpha
property anti_aliased_fill
property anti_aliased_lines
property button_text_align
property child_border_size
property child_rounding
property color_button_position
property columns_min_spacing
property curve_tessellation_tol
property display_safe_area_padding
property display_window_padding
property frame_border_size
property frame_padding
property frame_rounding
get_color(self: _bimpy.GuiStyle, arg0: _bimpy.Colors) → _bimpy.Vec4
property grab_min_size
property grab_rounding
property indent_spacing
property item_inner_spacing
property item_spacing
property mouse_cursor_scale
property popup_border_size
property popup_rounding
property scroll_bar_rounding
property scroll_bar_size
property selectable_text_align
set_color(self: _bimpy.GuiStyle, arg0: _bimpy.Colors, arg1: _bimpy.Vec4) → None
property tab_border_size
property tab_rounding
property touch_extra_spacing
property window_border_size
property window_menu_button_position
property window_min_size
property window_padding
property window_rounding
property window_title_align
class bimpy.HoveredFlags

Bases: pybind11_builtins.pybind11_object

Members:

None

ChildWindows

RootWindow

AnyWindow

AllowWhenBlockedByPopup

AllowWhenBlockedByActiveItem

AllowWhenOverlapped

AllowWhenDisabled

RectOnly

AllowWhenBlockedByActiveItem = <HoveredFlags.AllowWhenBlockedByActiveItem: 32>
AllowWhenBlockedByPopup = <HoveredFlags.AllowWhenBlockedByPopup: 8>
AllowWhenDisabled = <HoveredFlags.AllowWhenDisabled: 128>
AllowWhenOverlapped = <HoveredFlags.AllowWhenOverlapped: 64>
AnyWindow = <HoveredFlags.AnyWindow: 4>
ChildWindows = <HoveredFlags.ChildWindows: 1>
None = <HoveredFlags.None: 0>
RectOnly = <HoveredFlags.RectOnly: 104>
RootWindow = <HoveredFlags.RootWindow: 2>
property name
class bimpy.IO

Bases: pybind11_builtins.pybind11_object

property backend_platform_name
property backend_render_name
property delta_time
property display_size
property font_global_scale
property mouse_down
property mouse_pos
property mouse_wheel
class bimpy.Image

Bases: pybind11_builtins.pybind11_object

grayscale_to_alpha(self: _bimpy.Image) → None

For grayscale images, uses values as alpha

property height
property width
class bimpy.InputTextFlags

Bases: pybind11_builtins.pybind11_object

Members:

CharsDecimal

CharsHexadecimal

CharsUppercase

CharsNoBlank

AutoSelectAll

EnterReturnsTrue

AllowTabInput

CtrlEnterForNewLine

NoHorizontalScroll

AlwaysInsertMode

ReadOnly

Password

Multiline

AllowTabInput = <InputTextFlags.AllowTabInput: 1024>
AlwaysInsertMode = <InputTextFlags.AlwaysInsertMode: 8192>
AutoSelectAll = <InputTextFlags.AutoSelectAll: 16>
CharsDecimal = <InputTextFlags.CharsDecimal: 1>
CharsHexadecimal = <InputTextFlags.CharsHexadecimal: 2>
CharsNoBlank = <InputTextFlags.CharsNoBlank: 8>
CharsUppercase = <InputTextFlags.CharsUppercase: 4>
CtrlEnterForNewLine = <InputTextFlags.CtrlEnterForNewLine: 2048>
EnterReturnsTrue = <InputTextFlags.EnterReturnsTrue: 32>
Multiline = <InputTextFlags.Multiline: 1048576>
NoHorizontalScroll = <InputTextFlags.NoHorizontalScroll: 4096>
Password = <InputTextFlags.Password: 32768>
ReadOnly = <InputTextFlags.ReadOnly: 16384>
property name
class bimpy.Int

Bases: pybind11_builtins.pybind11_object

property value
class bimpy.String

Bases: pybind11_builtins.pybind11_object

property value
class bimpy.Style

Bases: pybind11_builtins.pybind11_object

Members:

Alpha

WindowPadding

WindowRounding

WindowBorderSize

WindowMinSize

WindowTitleAlign

ChildRounding

ChildBorderSize

PopupRounding

PopupBorderSize

FramePadding

FrameRounding

FrameBorderSize

ItemSpacing

ItemInnerSpacing

IndentSpacing

ScrollbarSize

ScrollbarRounding

GrabMinSize

GrabRounding

TabRounding

ButtonTextAlign

SelectableTextAlign

Alpha = <Style.Alpha: 0>
ButtonTextAlign = <Style.ButtonTextAlign: 21>
ChildBorderSize = <Style.ChildBorderSize: 7>
ChildRounding = <Style.ChildRounding: 6>
FrameBorderSize = <Style.FrameBorderSize: 12>
FramePadding = <Style.FramePadding: 10>
FrameRounding = <Style.FrameRounding: 11>
GrabMinSize = <Style.GrabMinSize: 18>
GrabRounding = <Style.GrabRounding: 19>
IndentSpacing = <Style.IndentSpacing: 15>
ItemInnerSpacing = <Style.ItemInnerSpacing: 14>
ItemSpacing = <Style.ItemSpacing: 13>
PopupBorderSize = <Style.PopupBorderSize: 9>
PopupRounding = <Style.PopupRounding: 8>
ScrollbarRounding = <Style.ScrollbarRounding: 17>
ScrollbarSize = <Style.ScrollbarSize: 16>
SelectableTextAlign = <Style.SelectableTextAlign: 22>
TabRounding = <Style.TabRounding: 20>
WindowBorderSize = <Style.WindowBorderSize: 3>
WindowMinSize = <Style.WindowMinSize: 4>
WindowPadding = <Style.WindowPadding: 1>
WindowRounding = <Style.WindowRounding: 2>
WindowTitleAlign = <Style.WindowTitleAlign: 5>
property name
class bimpy.TreeNodeFlags

Bases: pybind11_builtins.pybind11_object

Members:

None

Selected

Framed

AllowItemOverlap

NoTreePushOnOpen

NoAutoOpenOnLog

DefaultOpen

OpenOnDoubleClick

OpenOnArrow

Leaf

Bullet

FramePadding

NavLeftJumpsBackHere

CollapsingHeader

AllowItemOverlap = <TreeNodeFlags.AllowItemOverlap: 4>
Bullet = <TreeNodeFlags.Bullet: 512>
CollapsingHeader = <TreeNodeFlags.CollapsingHeader: 26>
DefaultOpen = <TreeNodeFlags.DefaultOpen: 32>
FramePadding = <TreeNodeFlags.FramePadding: 1024>
Framed = <TreeNodeFlags.Framed: 2>
Leaf = <TreeNodeFlags.Leaf: 256>
NavLeftJumpsBackHere = <TreeNodeFlags.NavLeftJumpsBackHere: 8192>
NoAutoOpenOnLog = <TreeNodeFlags.NoAutoOpenOnLog: 16>
NoTreePushOnOpen = <TreeNodeFlags.NoTreePushOnOpen: 8>
None = <TreeNodeFlags.None: 0>
OpenOnArrow = <TreeNodeFlags.OpenOnArrow: 128>
OpenOnDoubleClick = <TreeNodeFlags.OpenOnDoubleClick: 64>
Selected = <TreeNodeFlags.Selected: 1>
property name
class bimpy.Vec2

Bases: pybind11_builtins.pybind11_object

property x
property y
class bimpy.Vec4

Bases: pybind11_builtins.pybind11_object

property w
property x
property y
property z
class bimpy.WindowFlags

Bases: pybind11_builtins.pybind11_object

Members:

NoTitleBar

NoResize

NoMove

NoScrollbar

NoScrollWithMouse

NoCollapse

AlwaysAutoResize

NoBackground

NoSavedSettings

NoMouseInputs

MenuBar

HorizontalScrollbar

NoFocusOnAppearing

NoBringToFrontOnFocus

AlwaysVerticalScrollbar

AlwaysHorizontalScrollbar

AlwaysUseWindowPadding

NoNavInputs

NoNavFocus

UnsavedDocument

NoNav

NoDecoration

NoInputs

AlwaysAutoResize = <WindowFlags.AlwaysAutoResize: 64>
AlwaysHorizontalScrollbar = <WindowFlags.AlwaysHorizontalScrollbar: 32768>
AlwaysUseWindowPadding = <WindowFlags.AlwaysUseWindowPadding: 65536>
AlwaysVerticalScrollbar = <WindowFlags.AlwaysVerticalScrollbar: 16384>
HorizontalScrollbar = <WindowFlags.HorizontalScrollbar: 2048>
MenuBar = <WindowFlags.MenuBar: 1024>
NoBackground = <WindowFlags.NoBackground: 128>
NoBringToFrontOnFocus = <WindowFlags.NoBringToFrontOnFocus: 8192>
NoCollapse = <WindowFlags.NoCollapse: 32>
NoDecoration = <WindowFlags.NoDecoration: 43>
NoFocusOnAppearing = <WindowFlags.NoFocusOnAppearing: 4096>
NoInputs = <WindowFlags.NoInputs: 786944>
NoMouseInputs = <WindowFlags.NoMouseInputs: 512>
NoMove = <WindowFlags.NoMove: 4>
NoNav = <WindowFlags.NoNav: 786432>
NoNavFocus = <WindowFlags.NoNavFocus: 524288>
NoNavInputs = <WindowFlags.NoNavInputs: 262144>
NoResize = <WindowFlags.NoResize: 2>
NoSavedSettings = <WindowFlags.NoSavedSettings: 256>
NoScrollWithMouse = <WindowFlags.NoScrollWithMouse: 16>
NoScrollbar = <WindowFlags.NoScrollbar: 8>
NoTitleBar = <WindowFlags.NoTitleBar: 1>
UnsavedDocument = <WindowFlags.UnsavedDocument: 1048576>
property name
bimpy.accept_drag_drop_payload_string(arg0: int) → str
bimpy.accept_drag_drop_payload_string_preview(arg0: int) → str
bimpy.add_bezier_curve(pos0: _bimpy.Vec2, cp0: _bimpy.Vec2, cp1: _bimpy.Vec2, pos1: _bimpy.Vec2, col: int, thickness: float, num_segments: int = 0) → None
bimpy.add_circle(centre: _bimpy.Vec2, radius: float, col: int, num_segments: int = 12, thickness: float = 1.0) → None
bimpy.add_circle_filled(centre: _bimpy.Vec2, radius: float, col: int, num_segments: int = 12) → None
bimpy.add_font_default(oversample: int = 2, merge: bool = False) → ImFont
bimpy.add_font_from_file_ttf(filename: str, size_pixels: float, oversample: int = 2, merge: bool = False, range: List[int] = []) → ImFont
bimpy.add_line(a: _bimpy.Vec2, b: _bimpy.Vec2, col: int, thickness: float = 1.0) → None
bimpy.add_quad(a: _bimpy.Vec2, b: _bimpy.Vec2, c: _bimpy.Vec2, d: _bimpy.Vec2, col: int, thickness: float = 1.0) → None
bimpy.add_quad_filled(a: _bimpy.Vec2, b: _bimpy.Vec2, c: _bimpy.Vec2, d: _bimpy.Vec2, col: int) → None
bimpy.add_rect(a: _bimpy.Vec2, b: _bimpy.Vec2, col: int, rounding: float = 0.0, rounding_corners_flags: int = <Corner.All: 15>, thickness: float = 1.0) → None
bimpy.add_rect_filled(a: _bimpy.Vec2, b: _bimpy.Vec2, col: int, rounding: float = 0.0, rounding_corners_flags: int = <Corner.All: 15>) → None
bimpy.add_rect_filled_multicolor(a: _bimpy.Vec2, b: _bimpy.Vec2, col_upr_left: int, col_upr_right: int, col_bot_right: int, col_bot_lefs: int) → None
bimpy.add_triangle(a: _bimpy.Vec2, b: _bimpy.Vec2, c: _bimpy.Vec2, col: int, thickness: float = 1.0) → None
bimpy.add_triangle_filled(a: _bimpy.Vec2, b: _bimpy.Vec2, c: _bimpy.Vec2, col: int) → None
bimpy.align_text_to_frame_padding() → None
bimpy.arrow_button(arg0: str, arg1: int) → bool

square button with an arrow shape

bimpy.begin(name: str, opened: _bimpy.Bool = <_bimpy.Bool object at 0x7fb37b7e5420>, flags: int = <WindowFlags.???: 0>) → bool

Push a new ImGui window to add widgets to

bimpy.begin_child(str_id: str, size: _bimpy.Vec2 = <_bimpy.Vec2 object at 0x7fb37b7e5570>, border: bool = False, extra_flags: int = <WindowFlags.???: 0>) → bool

begin a scrolling region. size==0.0f: use remaining window size, size<0.0f: use remaining window size minus abs(size). size>0.0f: fixed size. each axis can use a different mode, e.g. ImVec2(0,400).

bimpy.begin_combo(label: str, preview_value: str, flags: int = 0) → bool
bimpy.begin_drag_drop_source(arg0: int) → bool
bimpy.begin_drag_drop_target() → bool
bimpy.begin_group() → None
bimpy.begin_main_menu_bar() → bool

create and append to a full screen menu-bar. only call EndMainMenuBar() if this returns true!

bimpy.begin_menu(name: str, enabled: _bimpy.Bool = <_bimpy.Bool object at 0x7fb37b7e55a8>) → bool

create a sub-menu entry. only call EndMenu() if this returns true!

bimpy.begin_menu_bar() → bool

append to menu-bar of current window (requires ImGuiWindowFlags_MenuBar flag set on parent window). only call EndMenuBar() if this returns true!

bimpy.begin_popup(name: str, flags: int = <WindowFlags.???: 0>) → bool
bimpy.begin_popup_context_item() → None

helper to open and begin popup when clicked on last item. if you can pass a NULL str_id only if the previous item had an id. If you want to use that on a non-interactive item such as Text() you need to pass in an explicit ID here.

bimpy.begin_popup_context_void() → None

helper to open and begin popup when clicked in void (where there are no imgui windows).

bimpy.begin_popup_context_window() → None

helper to open and begin popup when clicked on current window.

bimpy.begin_popup_modal(arg0: str) → bool
bimpy.begin_root(name='root', menu=False)[source]
bimpy.begin_tab_bar(str_id: str, flags: int = 0) → bool
bimpy.begin_tab_item(label: str, opened: _bimpy.Bool = <_bimpy.Bool object at 0x7fb37b7e5688>, flags: int = 0) → bool

create a Tab. Returns true if the Tab is selected.

bimpy.begin_tooltip() → None
bimpy.build_font() → None
bimpy.bullet() → None
bimpy.bullet_text(arg0: str) → None
bimpy.button(label: str, size: _bimpy.Vec2 = <_bimpy.Vec2 object at 0x7fb37b7e56f8>) → bool
bimpy.calc_item_width() → float
bimpy.calc_text_size(text: str, text_end: str = None, hide_text_after_double_hash: bool = False, wrap_width: float = 0.0) → _bimpy.Vec2
bimpy.capture_keyboard_from_app(arg0: bool) → None
bimpy.capture_mouse_from_app(arg0: bool) → None
bimpy.checkbox(arg0: str, arg1: _bimpy.Bool) → bool
bimpy.close_current_popup() → None
bimpy.collapsing_header(label: str, flags: int = 0) → bool
bimpy.color_button(desc_id: str, col: _bimpy.Vec4, flags: int = 0, size: _bimpy.Vec2 = <_bimpy.Vec2 object at 0x7fb37b7e5d18>) → bool

display a colored square/button, hover for details, return true when pressed.

bimpy.color_edit(arg0: str, arg1: _bimpy.Vec4) → bool
bimpy.color_picker(arg0: str, arg1: _bimpy.Vec4) → bool
bimpy.columns(count: int = 1, id: str = None, border: bool = True) → None
bimpy.combo(arg0: str, arg1: _bimpy.Int, arg2: List[str]) → bool
bimpy.drag_float(label: str, v: _bimpy.Float, v_speed: float = 1.0, v_min: float, v_max: float, display_format: str = '%.3f', power: float = 1.0) → bool
bimpy.drag_float2(label: str, v1: _bimpy.Float, v2: _bimpy.Float, v_speed: float = 1.0, v_min: float, v_max: float, display_format: str = '%.3f', power: float = 1.0) → bool
bimpy.drag_float3(label: str, v1: _bimpy.Float, v2: _bimpy.Float, v3: _bimpy.Float, v_speed: float = 1.0, v_min: float, v_max: float, display_format: str = '%.3f', power: float = 1.0) → bool
bimpy.drag_float4(label: str, v1: _bimpy.Float, v2: _bimpy.Float, v3: _bimpy.Float, v4: _bimpy.Float, v_speed: float = 1.0, v_min: float, v_max: float, display_format: str = '%.3f', power: float = 1.0) → bool
bimpy.drag_int(label: str, v: _bimpy.Int, v_speed: float = 1.0, v_min: int, v_max: int, display_format: str = '%.0f') → bool
bimpy.drag_int2(label: str, v1: _bimpy.Int, v2: _bimpy.Int, v_speed: float = 1.0, v_min: int, v_max: int, display_format: str = '%.0f') → bool
bimpy.drag_int3(label: str, v1: _bimpy.Int, v2: _bimpy.Int, v3: _bimpy.Int, v_speed: float = 1.0, v_min: int, v_max: int, display_format: str = '%.0f') → bool
bimpy.drag_int4(label: str, v1: _bimpy.Int, v2: _bimpy.Int, v3: _bimpy.Int, v4: _bimpy.Int, v_speed: float = 1.0, v_min: int, v_max: int, display_format: str = '%.0f') → bool
bimpy.dummy(arg0: _bimpy.Vec2) → None
bimpy.end() → None
bimpy.end_child() → None
bimpy.end_combo() → None

only call EndCombo() if BeginCombo() returns true!

bimpy.end_drag_drop_source() → None
bimpy.end_drag_drop_target() → None
bimpy.end_group() → None
bimpy.end_main_menu_bar() → None
bimpy.end_menu() → None
bimpy.end_menu_bar() → None
bimpy.end_popup() → None
bimpy.end_tab_bar() → None
bimpy.end_tab_item() → None
bimpy.end_tooltip() → None
bimpy.get_column_index() → int
bimpy.get_column_offset(column_index: int = - 1) → float
bimpy.get_column_width(column_index: int = - 1) → float
bimpy.get_columns_count() → int
bimpy.get_content_region_avail() → _bimpy.Vec2
bimpy.get_content_region_avail_width() → float
bimpy.get_content_region_max() → _bimpy.Vec2
bimpy.get_cursor_pos() → _bimpy.Vec2
bimpy.get_cursor_pos_x() → float
bimpy.get_cursor_pos_y() → float
bimpy.get_cursor_screen_pos() → _bimpy.Vec2
bimpy.get_cursor_start_pos() → _bimpy.Vec2
bimpy.get_display_framebuffer_scale() → _bimpy.Vec2
bimpy.get_drag_drop_payload() → str
bimpy.get_font() → ImFont
bimpy.get_font_global_scale() → float
bimpy.get_font_size() → float
bimpy.get_frame_count() → int
bimpy.get_frame_height() → float
bimpy.get_frame_height_with_spacing() → float
bimpy.get_glyph_ranges_chinese_full() → List[int]
bimpy.get_glyph_ranges_chinese_simplified_common() → List[int]
bimpy.get_glyph_ranges_cyrillic() → List[int]
bimpy.get_glyph_ranges_default() → List[int]
bimpy.get_glyph_ranges_japanese() → List[int]
bimpy.get_glyph_ranges_korean() → List[int]
bimpy.get_glyph_ranges_thai() → List[int]
bimpy.get_glyph_ranges_vietnamese() → List[int]
bimpy.get_id_str(str_id_begin: str, str_id_end: str = None) → None
bimpy.get_item_rect_max() → _bimpy.Vec2
bimpy.get_item_rect_min() → _bimpy.Vec2
bimpy.get_item_rect_size() → _bimpy.Vec2
bimpy.get_key_index(arg0: int) → int
bimpy.get_key_pressed_amount(arg0: int, arg1: float, arg2: float) → int
bimpy.get_mouse_drag_delta(arg0: int, arg1: float) → _bimpy.Vec2
bimpy.get_mouse_pos() → _bimpy.Vec2
bimpy.get_mouse_pos_on_opening_current_popup() → _bimpy.Vec2
bimpy.get_scroll_max_x() → float
bimpy.get_scroll_max_y() → float
bimpy.get_scroll_x() → float
bimpy.get_scroll_y() → float
bimpy.get_style() → _bimpy.GuiStyle
bimpy.get_text_line_height() → float
bimpy.get_text_line_height_with_spacing() → float
bimpy.get_time() → float
bimpy.get_window_content_region_max() → _bimpy.Vec2
bimpy.get_window_content_region_min() → _bimpy.Vec2
bimpy.get_window_content_region_width() → float
bimpy.get_window_height() → float
bimpy.get_window_pos() → _bimpy.Vec2
bimpy.get_window_size() → _bimpy.Vec2
bimpy.get_window_width() → float
bimpy.getio() → _bimpy.IO
bimpy.image(*args, **kwargs)

Overloaded function.

  1. image(arg0: int, arg1: _bimpy.Vec2) -> None

  2. image(arg0: _bimpy.Image, arg1: _bimpy.Vec2) -> None

  3. image(arg0: _bimpy.Image) -> None

bimpy.image_button(arg0: capsule, arg1: _bimpy.Vec2, arg2: _bimpy.Vec2, arg3: _bimpy.Vec2, arg4: int, arg5: _bimpy.Vec4, arg6: _bimpy.Vec4) → bool
bimpy.indent(indent_w: float = 0.0) → None
bimpy.inject_imgui_context(arg0: capsule) → None
bimpy.input_float(label: str, v: _bimpy.Float, step: float = 0.0, step_fast: float = 0.0, display_format: str = '%.3f', flags: int = 0) → bool
bimpy.input_float2(label: str, v1: _bimpy.Float, v2: _bimpy.Float, display_format: str = '%.3f', flags: int = 0) → bool
bimpy.input_float3(label: str, v1: _bimpy.Float, v2: _bimpy.Float, v3: _bimpy.Float, display_format: str = '%.3f', flags: int = 0) → bool
bimpy.input_float4(label: str, v1: _bimpy.Float, v2: _bimpy.Float, v3: _bimpy.Float, v4: _bimpy.Float, display_format: str = '%.3f', flags: int = 0) → bool
bimpy.input_int(label: str, v: _bimpy.Int, step: int = 1, step_fast: int = 100, flags: int = 0) → bool
bimpy.input_int2(label: str, v1: _bimpy.Int, v2: _bimpy.Int, flags: int = 0) → bool
bimpy.input_int3(label: str, v1: _bimpy.Int, v2: _bimpy.Int, v3: _bimpy.Int, flags: int = 0) → bool
bimpy.input_int4(label: str, v1: _bimpy.Int, v2: _bimpy.Int, v3: _bimpy.Int, v4: _bimpy.Int, flags: int = 0) → bool
bimpy.input_text(label: str, text: _bimpy.String, buf_size: int, flags: int = 0) → bool
bimpy.input_text_multiline(label: str, text: _bimpy.String, buf_size: int, size: _bimpy.Vec2 = <_bimpy.Vec2 object at 0x7fb37b7e57a0>, flags: int = 0) → bool
bimpy.input_text_with_hint(label: str, hint: str, text: _bimpy.String, buf_size: int, flags: int = 0) → bool
bimpy.invisible_button(arg0: str, arg1: _bimpy.Vec2) → bool

button behavior without the visuals, frequently useful to build custom behaviors using the public api (along with IsItemActive, IsItemHovered, etc.)

bimpy.is_any_item_active() → bool
bimpy.is_any_item_focused() → bool
bimpy.is_any_item_hovered() → bool
bimpy.is_any_mouse_down() → bool
bimpy.is_item_activated() → bool
bimpy.is_item_active() → bool
bimpy.is_item_clicked(mouse_button: int = 0) → bool
bimpy.is_item_deactivated() → bool
bimpy.is_item_deactivated_after_edit() → bool
bimpy.is_item_edited() → bool
bimpy.is_item_focused() → bool
bimpy.is_item_hovered(flags: int = 0) → bool
bimpy.is_item_toggled_open() → bool
bimpy.is_item_visible() → bool
bimpy.is_key_down(arg0: int) → bool
bimpy.is_key_pressed(arg0: int, arg1: bool) → bool
bimpy.is_key_released(arg0: int) → bool
bimpy.is_mouse_clicked(arg0: int, arg1: bool) → bool
bimpy.is_mouse_double_clicked(arg0: int) → bool
bimpy.is_mouse_down(arg0: int) → bool
bimpy.is_mouse_dragging(arg0: int, arg1: float) → bool
bimpy.is_mouse_hovering_rect(arg0: _bimpy.Vec2, arg1: _bimpy.Vec2, arg2: bool) → bool
bimpy.is_mouse_pos_valid(arg0: _bimpy.Vec2) → bool
bimpy.is_mouse_released(arg0: int) → bool
bimpy.is_popup_open(arg0: str) → bool
bimpy.is_window_appearing() → bool
bimpy.is_window_collapsed() → bool
bimpy.is_window_focused(arg0: int) → bool
bimpy.is_window_hovered(arg0: int) → bool
bimpy.label_text(arg0: str, arg1: str) → None
bimpy.list_box_header(label: str, size: _bimpy.Vec2) → None
bimpy.menu_item(name: str, shortcut: str, selected: _bimpy.Bool = <_bimpy.Bool object at 0x7fb37b7e55e0>, enabled: bool = True) → bool

return true when activated + toggle (*p_selected) if p_selected != NULL

bimpy.new_line() → None
bimpy.next_column() → None
bimpy.open_popup(arg0: str) → None

call to mark popup as open (don’t call every frame!). popups are closed when user click outside, or if CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block. By default, Selectable()/MenuItem() are calling CloseCurrentPopup(). Popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level).

bimpy.open_popup_on_item_click(arg0: str, arg1: int) → None

helper to open popup when clicked on last item. return true when just opened.

bimpy.path_clear() → None
bimpy.path_fill_convex(col: int) → None
bimpy.path_line_to(pos: _bimpy.Vec2) → None
bimpy.path_stroke(col: int, closed: bool, thickness: float) → None
bimpy.plot_lines(label: str, values: List[float], values_offset: int = 0, overlay_text: str = None, scale_min: float = 3.4028234663852886e+38, scale_max: float = 3.4028234663852886e+38, graph_size: _bimpy.Vec2 = <_bimpy.Vec2 object at 0x7fb37b7e5ca8>, stride: int = 4) → None
bimpy.pop_allow_keyboard_focus() → None
bimpy.pop_button_repeat() → None
bimpy.pop_clip_rect() → None
bimpy.pop_font() → None
bimpy.pop_id() → None
bimpy.pop_item_width() → None
bimpy.pop_style_color(count: int = 1) → None
bimpy.pop_style_var(count: int = 1) → None
bimpy.pop_text_wrap_pos() → None
bimpy.progress_bar(fraction: float, size_arg: _bimpy.Vec2 = <_bimpy.Vec2 object at 0x7fb37b7e5ce0>, overlay: str = None) → None
bimpy.push_allow_keyboard_focus(arg0: bool) → None
bimpy.push_button_repeat(arg0: bool) → None
bimpy.push_clip_rect(arg0: _bimpy.Vec2, arg1: _bimpy.Vec2, arg2: bool) → None
bimpy.push_font(arg0: ImFont) → None
bimpy.push_id_int(arg0: int) → None
bimpy.push_id_str(str_id_begin: str, str_id_end: str = None) → None
bimpy.push_item_width(arg0: float) → None
bimpy.push_style_color(arg0: _bimpy.Colors, arg1: _bimpy.Vec4) → None
bimpy.push_style_var(*args, **kwargs)

Overloaded function.

  1. push_style_var(arg0: _bimpy.Style, arg1: float) -> None

  2. push_style_var(arg0: _bimpy.Style, arg1: _bimpy.Vec2) -> None

bimpy.push_text_wrap_pos(wrap_pos_x: float = 0.0) → None
bimpy.radio_button(*args, **kwargs)

Overloaded function.

  1. radio_button(arg0: str, arg1: bool) -> bool

  2. radio_button(arg0: str, arg1: _bimpy.Int, arg2: int) -> bool

bimpy.reset_mouse_drag_delta(arg0: int) → None
bimpy.same_line(local_pos_x: float = 0.0, spacing_w: float = - 1.0) → None
bimpy.selectable(*args, **kwargs)

Overloaded function.

  1. selectable(label: str, selected: bool = False, flags: int = 0, size: _bimpy.Vec2 = <_bimpy.Vec2 object at 0x7fb37b7e5d50>) -> bool

  2. selectable(label: str, selected: _bimpy.Bool, flags: int = 0, size: _bimpy.Vec2 = <_bimpy.Vec2 object at 0x7fb37b7e5d88>) -> bool

bimpy.separator() → None
bimpy.set_column_offset(column_index: int, offset_x: float) → None
bimpy.set_column_width(column_index: int, column_width: float) → None
bimpy.set_cursor_pos(arg0: _bimpy.Vec2) → None
bimpy.set_cursor_pos_x(arg0: float) → None
bimpy.set_cursor_pos_y(arg0: float) → None
bimpy.set_cursor_screen_pos(arg0: _bimpy.Vec2) → None
bimpy.set_display_framebuffer_scale(scale: float) → None
bimpy.set_drag_drop_payload_string(arg0: str) → None
bimpy.set_font_global_scale(scale: float) → None
bimpy.set_item_allow_overlap() → None
bimpy.set_item_default_focus() → None
bimpy.set_keyboard_focus_here(*args, **kwargs)

Overloaded function.

  1. set_keyboard_focus_here(offset: int = 0.0) -> None

  2. set_keyboard_focus_here(arg0: int) -> None

bimpy.set_next_item_open(is_open: bool, cond: int = 0) → None
bimpy.set_next_item_width(arg0: float) → None
bimpy.set_next_tree_node_open(is_open: bool, cond: int = 0) → None
bimpy.set_next_window_bg_alpha(alpha: float) → None
bimpy.set_next_window_collapsed(collapsed: bool, cond: int = 0) → None
bimpy.set_next_window_content_size(size: _bimpy.Vec2) → None
bimpy.set_next_window_focus() → None
bimpy.set_next_window_pos(pos: _bimpy.Vec2, cond: int = 0, pivot: _bimpy.Vec2 = <_bimpy.Vec2 object at 0x7fb37b7e5650>) → None
bimpy.set_next_window_size(size: _bimpy.Vec2, cond: int = 0) → None
bimpy.set_next_window_size_constraints(size_min: _bimpy.Vec2, size_max: _bimpy.Vec2 = 0) → None
bimpy.set_scroll_from_pos_x(pos_x: float, center_x_ratio: float = 0.5) → None
bimpy.set_scroll_from_pos_y(pos_y: float, center_y_ratio: float = 0.5) → None
bimpy.set_scroll_here(center_y_ratio: float = 0.5) → None
bimpy.set_scroll_here_x(center_x_ratio: float = 0.5) → None
bimpy.set_scroll_here_y(center_y_ratio: float = 0.5) → None
bimpy.set_scroll_x(scroll_x: float) → None
bimpy.set_scroll_y(scroll_y: float) → None
bimpy.set_style(arg0: _bimpy.GuiStyle) → None
bimpy.set_tab_item_closed(tab_or_docked_window_label: str) → None
bimpy.set_tooltip(arg0: str) → None
bimpy.set_window_collapsed(name: str, collapsed: bool, cond: int = 0) → None
bimpy.set_window_focus(name: str) → None
bimpy.set_window_font_scale(*args, **kwargs)

Overloaded function.

  1. set_window_font_scale(arg0: float) -> None

  2. set_window_font_scale(arg0: float) -> None

bimpy.set_window_pos(name: str, pos: _bimpy.Vec2, cond: int = 0) → None
bimpy.set_window_size(name: str, size: _bimpy.Vec2, cond: int = 0) → None
bimpy.show_about_window() → None

create About window. display Dear ImGui version, credits and build/system information.

bimpy.show_demo_window() → None

create demo/test window (previously called ShowTestWindow). demonstrate most ImGui features.

bimpy.show_font_selector(arg0: str) → None

add font selector block (not a window), essentially a combo listing the loaded fonts.

bimpy.show_metrics_window() → None

create metrics window. display ImGui internals: draw commands (with individual draw calls and vertices), window list, basic internal state, etc.

bimpy.show_style_editor() → None

add style editor block (not a window). you can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it uses the default style)

bimpy.show_style_selector(arg0: str) → None

add style selector block (not a window), essentially a combo listing the default styles.

bimpy.show_user_guide() → None

add basic help/info block (not a window): how to manipulate ImGui as a end-user (mouse/keyboard controls).

bimpy.slider_angle(label: str, v_rad: _bimpy.Float, v_degrees_min: float = - 360.0, v_degrees_max: float = 360.0, display_format: str = '%.0f deg') → bool
bimpy.slider_float(label: str, v: _bimpy.Float, v_min: float, v_max: float, display_format: str = '%.3f', power: float = 1.0) → bool
bimpy.slider_float2(label: str, v1: _bimpy.Float, v2: _bimpy.Float, v_min: float, v_max: float, display_format: str = '%.3f', power: float = 1.0) → bool
bimpy.slider_float3(label: str, v1: _bimpy.Float, v2: _bimpy.Float, v3: _bimpy.Float, v_min: float, v_max: float, display_format: str = '%.3f', power: float = 1.0) → bool
bimpy.slider_float4(label: str, v1: _bimpy.Float, v2: _bimpy.Float, v3: _bimpy.Float, v4: _bimpy.Float, v_min: float, v_max: float, display_format: str = '%.3f', power: float = 1.0) → bool
bimpy.slider_int(label: str, v: _bimpy.Int, v_min: int, v_max: int, display_format: str = '%.0f') → bool
bimpy.slider_int2(label: str, v1: _bimpy.Int, v2: _bimpy.Int, v_min: int, v_max: int, display_format: str = '%.0f') → bool
bimpy.slider_int3(label: str, v1: _bimpy.Int, v2: _bimpy.Int, v3: _bimpy.Int, v_min: int, v_max: int, display_format: str = '%.0f') → bool
bimpy.slider_int4(label: str, v1: _bimpy.Int, v2: _bimpy.Int, v3: _bimpy.Int, v4: _bimpy.Int, v_min: int, v_max: int, display_format: str = '%.0f') → bool
bimpy.small_button(arg0: str) → bool
bimpy.spacing() → None
bimpy.style_colors_classic() → None
bimpy.style_colors_dark() → None
bimpy.style_colors_light() → None
bimpy.text(arg0: str) → None
bimpy.text_colored(arg0: _bimpy.Vec4, arg1: str) → None
bimpy.text_disabled(arg0: str) → None
bimpy.text_wrapped(arg0: str) → None
bimpy.tree_node(label: str) → bool
bimpy.tree_node_ex(id: int, flags: int = 0, label: str = '') → bool
bimpy.tree_pop() → None
bimpy.unindent(indent_w: float = 0.0) → None
bimpy.v_slider_float(label: str, size: _bimpy.Vec2, v: _bimpy.Float, v_min: float, v_max: float, display_format: str = '%.3f', power: float = 1.0) → bool
bimpy.v_slider_int(label: str, size: _bimpy.Vec2, v: _bimpy.Int, v_min: int, v_max: int, display_format: str = '%.0f') → bool