Comments (2)
There's no canonical way but here's how I would do it:
bool SelectableWithHint(const char* label, const char* hint)
{
using namespace ImGui;
bool ret = Selectable(label);
SameLine();
SetCursorPosX(GetCursorPosX() + ImMax(0.0f, GetContentRegionAvail().x - CalcTextSize(hint).x));
TextDisabled("%s", hint);
return ret;
}
Usage
SelectableWithHint("/loader/loader", "MeshObjLoader");
It seems to do the job well.
I think your issue stem from using SameLine()
for offseting instead of SetCursorPosX()
from imgui.
Related Issues (20)
- Unmapped Memory Access
- Style color for active input field (feature request) HOT 2
- Frame rate control for individual windows HOT 1
- DirectX12 'ft2build.h' : No such file or directory
- SetNextWindowRefreshPolicy issues
- ListClipper jumps back when scrolls down to bottom HOT 3
- identifier "ImGui_ImplWin32_WndProcHandler" is undefined HOT 1
- Setting the Vulkan VkViewport leads to incomplete display of widgets. HOT 3
- Horizontal scrolling demo for tables is broken HOT 1
- How do I add a separator line for dragging and dropping selectables? HOT 2
- imgui_impl_sdl3 build error HOT 2
- Crash owing to improperly releasing memory. HOT 3
- ImGui window coordinate sync issue when out of main viewport (SDL3)
- Issue building the sdl2 + opengl3 example with emscripten HOT 4
- Unable to set the style correctly (right angle edge&rounded edge) with multi-viewports HOT 3
- Problem with changing the password sign. HOT 2
- Imgui not work on emulator HOT 1
- How to check if scrollbar is visible in the current window HOT 6
- Reusable code that creates a new window HOT 5
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.