Hi,

I rebuilt my gui in glade and automatically connecting to signals. Therefore I 
need to use the lowlevel objects (with 00 suffix). Now I have the problem that 
i need to access the event parameter. Is there any better solution, to work 
with the gintro highlevel objects?

I've solved it like this: 
    
    
    type
      GdkEventButton = object
        `type`: ptr gdk.EventType
    
    proc onSelectableMapsButtonPressEvent(self: TreeView00, e: GdkEventButton) 
{.signal.} =
      if e.`type`[] == doubleButtonPress:
        echo "Double clicked"
    
    
    Run

* * *

And another question. I've implemented multilingualism into my app. Works fine 
on linux, but i do not get it working on Windows (I know it's tricky with 
gettext on windows, but I've no idea anymore). Currently I solved this problem 
by creating a launcher that starts my gui application after setting the `LANG` 
environment variable.

My approach: 
    
    
    when defined(windows):
      proc setlocale(category: int, other: cstring): cstring {.header: 
"<locale.h>", importc.}
      var LC_ALL {.header: "<locale.h>", importc.}: int
      proc bindtextdomain(domainname: cstring, dirname: cstring): cstring 
{.dynlib: "libintl-8.dll", importc.}
    else:
      proc bindtextdomain(domainname: cstring, dirname: cstring): cstring 
{.header: "<libintl.h>", importc.}
    
    discard bindtextdomain("gui", os.getCurrentDir() / "locale")
    disableSetlocale()
    discard setlocale(LC_ALL, myLocaleIWantToSet) # Tried this with de_DE.utf8 
and German_Germany.1252
    
    [...]
    
    let builder = newBuilder()
    builder.translationDomain = "gui" #
    
    
    Run

Reply via email to