Migrating to v2
How to migrate to v2 (currently incomplete)
Breaking Changes
Goki-wide
- Import paths have been changed from
github.com/goki/*
togoki.dev/*
(for example,github.com/goki/gi
changed togoki.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,goki.dev/gi/v2
) KiT_*
global variables have been renamed toType*
(for example,KiT_Button
changed toTypeButton
); fixing this should be a simple find and replace forKiT_
=>Type
AddNew*
functions and methods have been renamed toNew*
(for example,AddNewButton
changed toNewButton
); fixing this should be a simple find a replace forAddNew
=>New
goki/ki
- Package
ki
has been moved into the root directory of ki, so it is now imported as justgoki.dev/ki/v2
- 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)
goki/gi/gi
Defaults()
method removed on several widgets (slider, spinbox, scrollbar, etc); it is no longer needed and all calls of it can be deleted.MenuButton
widget removed; useButton
instead, as you can put a menu on any button. If you want the arrow indicator again, putbutton.Indicator = icons.KeyboardArrowDown
Action
andButtonBase
removed; useButton
instead.Inactive
renamed toDisabled
andActive
toEnabled
. Many node flag functions (eg,SetInactive
,IsActive
, etc) as well as the actual enum constants must be renamed.ClearAct
field onTextField
converted toLeadingIcon
andTrailingIcon
; useAddClearAction()
to easily replicate the same functionality.gi.IconName
removed and replaced withicons.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
Style
field usingAddStyleFunc
for styling and directly set the configuration struct fields in your code for configuration. - Prefs colors removed; use
gi.ColorScheme
instead.
goki/gi/gist
- Color transformation functions like
Highlight
now take non-pointer receivers to support function chaining.
goki/gi/units
units.New*
functions have been renamed tounits.*
(for example,units.NewPx
changed tounits.Px
); fixing this should be a simple find and replace forunits.New
(although if you useunits.NewValue
, which is unchanged, you will have to avoid changing that).- Renamed
(units.Context).ToDotsFactor
to(units.Context).Dots
- Removed
units.Pct
and related things (replaced withunits.Ew
,units.Eh
,units.Pw
,units.Ph
, and related things) - Renamed
units.Context
fieldsElW
,ElH
,VpW
, andVpH
toEw
,Eh
,Vw
, andVh
respectively. - Setter functions for
units.Context
now also take parent size. units.Value
contains aDotsFunc
function (you should use keyed struct literals).
Feedback
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 January 22, 2024: removed old deps from go mod (0b4edcc)