Skip to content

Instantly share code, notes, and snippets.

@khchen
Created December 21, 2020 18:02
Show Gist options
  • Select an option

  • Save khchen/101aa8c0783ff821216bc7d1608e3896 to your computer and use it in GitHub Desktop.

Select an option

Save khchen/101aa8c0783ff821216bc7d1608e3896 to your computer and use it in GitHub Desktop.
Steps to create minified winim code by winimx, take winim/clr as example.
  1. Create a new directory and copy following file from winim.
winim/com.nim
winim/clr.nim
examples/clr/simple_gui.nim
  1. Create keyword.txt.
IID_IObject
IID_IType
  1. Run this command to create miniwinim.nim.
%USERPROFILE%\.nimble\bin\winimx.cmd -s:windef com.nim clr.nim keywords.txt > miniwinim.nim
  1. Modify com.nim and run nim r com.nim to test.
import strutils, macros
import inc/winimbase, utils, winstr, core, shell, ole
export winimbase, utils, winstr, core, shell, ole
To
import strutils, macros
import winim/inc/[winimbase, windef], winim/[utils, winstr], miniwinim
export winimbase, windef, utils, winstr, miniwinim
  1. Modify clr.nim.
import ole, com
import strutils, macros
import strformat except `&`
export com
To
import miniwinim, com
import strutils, macros
import strformat except `&`
export com
  1. Modify simple_gui.nim.
import winim/clr
To
import clr
  1. Run nim r simple_gui.nim to test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment