Comments (7)
It is definitely a good idea to have the extra functions and utilities that do not exist in C++ API in separate module. It will improve code organization and help in documenting it properly. We already have few of such functions e.g. font
, styled
, istyled
, vertex_buffer_*
.
Still I would not care much about developer confusion at this moment. I think that benefits of having them importable from one place instead of multiple submodules outweights the cons. This is also in spirit of the one-header libraries like ImGui itself.
My idea is to have at least two Cython modules:
core.pyx
- for everything that exists directly in core C++ APIextras.pyx
- for anything extra (python-specific helpers, context managers) that is not part of C++ API
But combine them in __init__.py
in following way:
from imgui.core import * # noqa
from imgui import core
from imgui.extras import * # noqa
from imgui import extras
That way we will help to maintain backwards compatibility, make possible for some developers to be very specific about core/extras usage, and also make possible for other developers to have very simpe one-import code.
from pyimgui.
Off-topic: Good to have you back. I was beginning to think you gave up on pyimgui.
This happens only in pyimgui? I mean, it does not occur in C++'s imgui?
from pyimgui.
Oh, I didn't gave up on this project :). I simply had a very intense period at work so had to put few open source projects on hiatus. But I'm trying to get back to them.
Regarding the issue. I'm pretty sure this happens in barre C++ ImGui too because the this is the way how most immediate-mode GUIs are implemented i.e. every widget get's it's unique and (usually) explicit identifier. In this case the labels are used as identifiers. Usually this is acceptable simplification because it isn't common to have multiple same-labelled widgets in the same context (window, modal etc.)
from pyimgui.
I like the idea of imgui.scope
, but I wonder if we should put it into a different namespace? Having the python imgui
module be a combination of imgui-cpp
methods and pyimgui
helpers might be confusing for coders?
Maybe imgui.helpers.scope
? or imgui.py_scope
? I don't know; naming is hard.
from pyimgui.
I've submitted a PR for a patch to expose PushID and PopID and a context wrapper as discussed.
It's also possible to append some unique text to a name after ##
to make ids not collide. E.g. imgui.button('foo##1')
and imgui.button('foo##2')
don't collide, but are both displayed as foo.
from pyimgui.
Closing this as we already have imgui.extra
submodule and I have added new scoped
context manager.
from pyimgui.
Feature available in 1.2.0.
from pyimgui.
Related Issues (20)
- Set unique/multiple imgui name, context
- -- deleted --
- Doesn't expose ImGuiStyle::ScaleAllSizes HOT 1
- Showing input text without a label HOT 1
- Documentation left side nav not scrollable
- Can't use it and i don't know why.
- "Game Insert"
- type stubs for pyimgui HOT 4
- None of the custom renderers change mouse cursor HOT 4
- default theme font HOT 4
- Loading SVGs as viewport/texture HOT 2
- [Bug}: When using pyimgui some users of my program have `GLError`s HOT 8
- Imgui port to pygame do not suport colaboration with programable opengl pipline
- Windows: Failed building wheel for imgui (from VsDevShell) HOT 5
- Example not working HOT 1
- pyimgui equivalent of ImGuiKey_NamedKey_END HOT 1
- Overflow error when using opengl, doublebuf and fullscreen HOT 1
- ImGui crashing when using OpenGL context 3.2+ even though GPU and driver support 4.6
- Upgrading dear imgui version beyond 1.82 HOT 6
- Anyone studied if F3D is able to render on pyimgui 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 pyimgui.