inkyblackness / imgui-go

Go wrapper library for "Dear ImGui" (https://github.com/ocornut/imgui)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SetKeyboardFocusHere()

JetSetIlly opened this issue · comments

Please can you add SetKeyboardFocusHere(). I've vendored the latest version and added it myself and it's caused no problems.

I'd issue a pull request but frankly, I don't understand the tagging system at all.

Thank-you.

Hello there!
Sure I can add it.
Though I'd also like to know what you mean with "tagging system"? Can I help you here in any way?

Thanks.

I was referring to git tags and how they relate to go modules.

OK, as you are asking for another function as well (#77) I want at least to spend some time to help you understand modules and versions as well, as I suspect you may want further functions - and not just from this library, but others perhaps as well :)

The versions work 1:1 with the tags of the library. In your go.mod file of your Gopher2600 project, You recently added the dependency to imgui-go in version 2.0.1 . So, this seems like you are using modules already and no longer need a vendored library.
Recently I released versions v2.1.0 and v2.1.1 . By changing the entry in go.mod (and running go mod download), go will update the dependencies.

Should you want to do pull requests on your own, you can do that, even including local testing as well before I merge the change. For this you can follow the following steps:

  • Fork imgui-go and clone your own fork
  • In the go.mod of your project where you want to test changes, you add a (temporary) line that overrides the "released" version to specify your local copy. You do this with an extra replace line. More details here. I also found blog entries such as this one that show examples.

    This would look like replace github.com/inkyblackness/imgui-go/v2 => /your/forked/import/path

  • Change/extend the code in your fork as you need it
  • Change/extend the code in your project to test out the extensions
  • When done, commit, push, and create a pull request for your forked imgui-go
  • When merged and released by me, you can update the version as described above.

I'll see to adding the two functions you requested, though please be aware that finding time to add functions on my own is more difficult than accepting pull requests :)

Thanks for that.

I know the principles but never used git in this way before, so I need someone to hold my hand :-) I'll perform the steps you've outlined, make the changes and issue a pull request sometime later.

Done. Easier than I thought. The replace directive was the information I really needed. I was also unsure at first how to specify the version tag in the forked repository but I figured master would work.

Great, thank you!
Are you planning further extensions, or should I release with this one?

I'm not planning on anything else. I've only been working with the library for a few days so I'm still finding my feet. I just happened to need those functions.