Skip to content

Commit

Permalink
A simple Stringer function for the expander widget
Browse files Browse the repository at this point in the history
Helps debugging because it makes the children render their names when
printed with '%v', instead of a hex address for the widget and then no
further descent into the hierarchy.
  • Loading branch information
gcla committed Feb 26, 2021
1 parent 3125512 commit a5f0206
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions widgets/expander/expander.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
package expander

import (
"fmt"

"github.com/gcla/gowid"
"github.com/gcla/gowid/widgets/boxadapter"
)
Expand Down Expand Up @@ -61,6 +63,10 @@ func (w *Widget) Selectable() bool {
return w.w.Selectable()
}

func (w *Widget) String() string {
return fmt.Sprintf("expander[%v]", w.w.IWidget)
}

//======================================================================
// Local Variables:
// mode: Go
Expand Down

0 comments on commit a5f0206

Please sign in to comment.