cimgui-go: Cannot call imgui.CurrentIO().SetIniFilename

SetIniFilename is a method of *IO, while CurrentIO() returns IO. This is not true for IniFileName, which is a method of IO even if it has almost the same signature.

ImGuiIO_SetIniFilename(ImGuiIO *ImGuiIOPtr, const char* v)
ImGuiIO_GetIniFilename(ImGuiIO *self)

become:

func (self *IO) SetIniFilename(v string)
func (self IO) IniFilename() string 

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 23 (5 by maintainers)

Commits related to this issue

Most upvoted comments

@gucio321 Unfortunately the problem still remains by default the ini file name is empty when using imgui.CurrentIO().SetIniFilename the name changes constantly and if it saves it is a garbage name from memory. image

So, I think you should allocate a string for IniFilename in the wrapper, call cimgui SetIniFilename just once, than go SetIniFilename should modify that single string you allocated (or reallocate and call cimgui SetIniFilename if allocation size does not suffice).

Take a look at #91, there’s an explaination of what the problem is

Dirty workaround until generation will be fixed:

	ioRaw := imgui.CurrentIO()
	io := &ioRaw
	io.SetIniFilename()