r/C_Programming • • Oct 22 '26

Framework for building an app?

I would like to recreate Obsidian notes in c for fun.

I know that I can use the x11 api, or the win api, but that is a little too low level for what I am doing.

It's also not cross platform. Do you guys have any suggestions for what I am trying to do?

14 Upvotes

7 comments sorted by

5

u/ignorantpisswalker Oct 22 '26

https://www.reddit.com/r/C_Programming/s/QH56J8zXMl

This was discussed a few years ago. Look into the recommendations on that post.

2

u/Ok-Machine4940 Oct 22 '26

Thanks! I will check it out!

12

u/Commercial-Job-9441 Oct 22 '26

for a notes app in pure c, gtk4 is the path of least resistance: cross platform, and it gives you real text widgets for free. gtktextview already handles editing, selection, and undo, which is the hard 90% of an editor. for the markdown side, parse with cmark or md4c (both small c libraries) and push the styled output into the textview. that's basically the whole app: load file, parse markdown, render, save. if you want something more playful, sdl2 + nuklear (single header immediate mode gui, pure c) is tiny and fun, but you write your own text editing from scratch. for a learning project maybe that's the point, but i'd still start with gtk.

5

u/Still_Explorer Oct 22 '26

I am a big fan of ImGui [in this case cimgui bindings] because architecturally by the MVC pattern, lets you keep your application runtime model intact (the model) and only use the UI library for rendering the contents (the view).

While with any other GUI library, there would be the tendency having to replicate (copy-paste) values from the runtime model to the UI elements (ie: you are duplicating the same data for no reason), or even so at times to deal with event callbacks and juggle updates-synchronizations.

With immediate mode guis, truth is that you will have to deal a bit with the "drawing logic" of the UI and it will feel very verbose and low level, but at least is a very explicit and direct process. You write it once and it will work forever, your runtime data stay as they are and the UI only renders.

Check SDL3 integration for maximum cross platform support and only one SDL3 dependency.

https://github.com/cimgui/cimgui/blob/docking_inter/backend_test/example_sdlgpu3/main.c

2

u/internet_safari_ Oct 25 '26

I have a UI app in progress using SDL3 and it's been my favorite choice for this ever since. I have another using Tcl/Tk which has its own beauty

1

u/Still_Explorer Oct 25 '26

That's awesome. Very good idea to work with anything that suits the needs of a project.

l

1

u/internet_safari_ Oct 25 '26

I'm doing something similar in Tcl/Tk with good results. As #includes in a C file.