I'm guessing it all hinges on the fact if it's possible to detect on which part of the note text a click happens and being able to regexp-tract the text to determine if it's a textlink?
essentially yes, but abstraction makes it much harder, basically impossible, for me to implement it on my side. you see making an interface is difficult because you need to keep track of so many things: spacing, position, sizing, offsets, font sizes, colors, scrolling, overlays, and then just think about correlating all those factors to the inputs you get from a mouse and a keyboard! thats why we use toolkits to do this stuff. i can just say:
Python:
changed, game.notes = imgui.input_text_multiline(
"game_notes_widget",
value=game.notes,
width=imgui.get_content_region_available_width(),
height=450
)
if changed:
db.save_game_details(game, "notes")
now, this is a bit simplified, but thats essentially what happens in the info popup in the notes tab. ask imgui to show an input text widget, which has multiple lines support, give it a width (in this case the maximum available width) and a height for the text box, a value for the current notes text and receive back the new notest text plus a "changed" boolean for whether the user has modified the notes text. then if they were changed, go ahead and save those changes to the database. in reality the actual code is a bit more complex because i had to add in the right click support, but the main functionality is just like that. now, i have no clue where the user clicked. yeah i could use the mouse position and relate that to the draw cursor position to get the relative mouse offset inside the textbox, but the textbox has scrolling... and still, id have to account for returns (as in going to next line in the text), line height and still i dont know where the textbox was scrolled to. thats because all those implementation details are handled by imgui, which is the one getting the hands dirty handling all the difficult stuff and letting me have an easier life just saying "yeah sure show a textbox here, i dont care too much about it". if i wanted to implement this id have to change imgui itself and implement it there, and that becomes a problem because, as we established, imgui is a very complex piece of software (just think about it being 50k lines of code, and thats of C++ code, not kids languages like the python im using) that make others lives easier... and while finding where the logic for it would go in imgui itself is not that hard, just a simple ripgrep in the source code, actually implementing it would be difficult in C++, and even then id have to find a decent way to communicate the newfound information back to the user-level imgui code (the imgui.input_text_multiline()) because the widget is a text box, designed to allow editing text, nothing to do with urls.