Comments (4)
@hugle: This example is different. Here you are trying to edit a list of float.
In the ImGui code, the declaration is as below:
bool ImGui::DragFloat4(const char* label, float v[4], float v_speed, float v_min, float v_max, const char* format, ImGuiSliderFlags flags)
It is true that in some cases you can see C++ code like this
ImGui::DragFloat4(const char* label, &someImVec4Value)
However, this uses the fact that the memory layout of ImVec4 and float[4] happens to be the same in C and C++. There is no such thing in Python, and IMHO this is for the better
from imgui_bundle.
I use get_style()
and has no problem, but you will need to set x
, y
, z
, w
one by one in python as no API binding for python for direct assignment:
padding_list = [1.0,1.0,1.0,1.0]
style = ed.get_style()
style.node_padding.x = padding_list[0]
style.node_padding.y = padding_list[1]
style.node_padding.z = padding_list[2]
style.node_padding.w = padding_list[3]
from imgui_bundle.
Hello,
node_padding is a ImVec4, thus you should use
ed.push_style_var(ed.StyleVar.node_padding, ImVec4(1, 1, 1, 1))
or
style = ed.get_style()
style.node_padding = ImVec4(8, 8, 8, 8)
from imgui_bundle.
Thanks @pthom , if ImVec4
is prefered. I would recommend update some of the imgui API (example below) from List[float]
to ImVec4
. Otherwise conversion between them is required, that would be redundant:
imgui_bundle/bindings/imgui_bundle/imgui/__init__.pyi
Lines 1429 to 1438 in f9d61bf
from imgui_bundle.
Related Issues (20)
- Screen resolution and fontsize incorrect on windows 11 HOT 15
- Ability to specify absolute path for `runner_params.ini_filename` HOT 3
- Adapting other plug-ins HOT 1
- Possibility to add imgui notification library ImGuiNotify HOT 3
- Handling system key mappings for imgui.is_key_down() HOT 1
- hello_imgui ability to modify individual window style HOT 4
- imgui-bundle with python 3.9 ? HOT 1
- glBindSampler(0, 0) is needed for OpenGL backend HOT 1
- Missing fields `ImFontConfig.GlyphRanges` in python binding HOT 1
- dock_builder API should be public HOT 2
- Required initialization for imgui_node_editor? HOT 2
- Try to build using Nuitka HOT 2
- Simulate key presses with the test engine HOT 4
- plotting python numpy data that is noncontiguous and using implot stride option don't seem to work HOT 5
- Expose some additional `implot` internal functions to allow custom plots HOT 2
- [imgui_node_editor] Can't set value for `Colors[StyleColor_*]` HOT 5
- Glfw Error 65542: WGL: The driver does not appear to support OpenGL HOT 25
- wrapping of implot BeginSubplots appears to have wrong argument type for `row_ratios` and `col_ratios` HOT 4
- test engine logging and headless HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imgui_bundle.