Migrating to v2
How to migrate to v2 (currently incomplete)
- Import paths have been changed from
goki.dev/gi). All repositories with a changed import URL that were on version 1 are now on version 2 and have a major version URL suffix (for example,
KiT_*global variables have been renamed to
TypeButton); fixing this should be a simple find and replace for
AddNew*functions and methods have been renamed to
NewButton); fixing this should be a simple find a replace for
kihas been moved into the root directory of ki, so it is now imported as just
- Support for automatic Ki field children has been removed, so you now have to manage that yourself (see https://github.com/goki/ki/issues/17)
Defaults()method removed on several widgets (slider, spinbox, scrollbar, etc); it is no longer needed and all calls of it can be deleted.
MenuButtonwidget removed; use
Buttoninstead, as you can put a menu on any button. If you want the arrow indicator again, put
button.Indicator = icons.KeyboardArrowDown
Enabled. Many node flag functions (eg,
IsActive, etc) as well as the actual enum constants must be renamed.
AddClearAction()to easily replicate the same functionality.
gi.IconNameremoved and replaced with
icons.Icon; many functions and fields have changed types that must be updated; also, previous icon names may be broken or have changed to new icons, and it is strongly recommended that you use the new icon constants instead of untyped string literals.
- Prop-based styling and configuration removed; set the
AddStyleFuncfor styling and directly set the configuration struct fields in your code for configuration.
- Prefs colors removed; use
- Color transformation functions like
Highlightnow take non-pointer receivers to support function chaining.
units.New*functions have been renamed to
units.Px); fixing this should be a simple find and replace for
units.New(although if you use
units.NewValue, which is unchanged, you will have to avoid changing that).
units.Pctand related things (replaced with
units.Ph, and related things)
- Setter functions for
units.Contextnow also take parent size.
DotsFuncfunction (you should use keyed struct literals).
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
Last modified December 1, 2023: updated deps (8f0ee62)