>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/*
    
    
    Run
    
    
    /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)
    
    
    
    Run

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.) 

Reply via email to