-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grid widget #428
Comments
Here is my code, it is far to be perfect, so any suggestion is welcomed: I still see some important improvements to do :
void Browser::DrawTemplates(TemplateCategory* category)
} |
I'm closing this as there isn't really a single answer forward. The code above may be good as a suggestion to new ImGui users and perhaps we can provide more examples in the demo. but otherwise there's nothing really special or reusable about that code. It's however a really good example case. Right now using BeginChild() may make it easier and more natural to create independent boxes with their own clipping, but children windows have a bit of an overhead that could be reduced. BeginGroup+PushClipRect may also provide similar result with less overhead. Ideally we'd want to go toward lowering the overhead of BeginChild or clarifying exactly what it means, or providing lower-level primitives that say, combine column locking (like BeginGroup) + clipping rectangle (like PushClipRect), with an additional way to either merge draw calls when output hasn't extended past its clipping bounds (need to maintain bounding box of output), or add CPU-side clipping to all non-text primitives. Those features will be essential to add more natural layout features with generalised clipping without overhead. Sorry I am just thinking aloud there! (for my own reference) Loosely relate to #404. |
Hi,
I try to create a "grid" widget that will contains a set of selectable item.
Each item is composed of a text and an image.
So, I'm not sure it is the best way to start, but I'm trying to use the ImageButton... the problem is that:
The text was updated successfully, but these errors were encountered: