hello (I am French ... excuse me for my english.)
I test your gintro project
I use glade for the presentation which greatly facilitates me .... on the other hand in order not to provide the glade file to users ...
thank you
From my understanding you want to distribute your application without an associated xml file containing the GUI definition?
For gtk builder we have at least 3 choices: Load the content from external xml text file, load it from string contained in the program code, and load from resource. I assume the first option works for you already. Second option should be no problem. Do you know how you can define a multiline string in Nim? If you have manage that, you should be able to use newBuilderFromString() to load it in the same way as you did for external file. The second option, with the resource: It should work, I used it for my NEd Nim editor years ago with oldgtk3, so it should work with gintro. The trick is to pass the correct options to C compiler and linker -- I don't know much about this topic, spent many hours with it that time, without understanding it well. I will investigate that again when we really have users who needs it seriously -- for me these users should have at least some working code, not only wishes...
For the name newBuilderFromString() -- maybe you have not seen it? Well the obvious trick when one can not guess well is
$ grep -B2 gtk_builder_new_from_string ~/.nimble/pkgs/gintro-0.5.5/gintro/*
/home/stefan/.nimble/pkgs/gintro-0.5.5/gintro/gtk4.nim-proc newBuilderFromString*(string: cstring; length: int64): Builder =
/home/stefan/.nimble/pkgs/gintro-0.5.5/gintro/gtk4.nim: let gobj = gtk_builder_new_from_string(string, length)
Well, I have not tested that proc. It is auto-generated, so I just assume it works. I can really not test all these procs, there are 3k only in gtk.nim. If there are issues, let me know and we will investigate. Personally I generally do not use glade and gtkBuilder at all, as I can not see a benefit compared to creating the widgets in the Nim code directly. (For the verbose C code there may be a benefit.)
Hello, thank you for responding. I work with glade, it is a question of presentation for the user, and the conformity in a team.
I admit taking NIM in hand, and I start from an example that works in c / c ++ gtk 3.22 on linux gcc 9.1
I will test and make you a return.
actually simplicity is greatly enhanced with GINTRO ....
ps: should we have GTK4 in absolute
thank you
hello, I understood the principle to translate gtk into gtk-nim
grep -B2 gtk_builder_new_from_string ~ / .nimble / pkgs / gintro-0.5.5 / gintro / *
now I'm going a lot forward
ok thank you
is very good work
thank you