@@ -208,8 +208,7 @@ func (c *Context) Text(text string) {
208208 })
209209}
210210
211- func (c * Context ) button (label string , opt option , callerPC uintptr ) (controlID , bool , error ) {
212- id := c .idFromCaller (callerPC )
211+ func (c * Context ) button (label string , opt option , id controlID ) (bool , error ) {
213212 res , err := c .control (id , opt , func (bounds image.Rectangle , wasFocused bool ) (bool , error ) {
214213 var res bool
215214 // handle click
@@ -224,9 +223,9 @@ func (c *Context) button(label string, opt option, callerPC uintptr) (controlID,
224223 return res , nil
225224 })
226225 if err != nil {
227- return emptyControlID , false , err
226+ return false , err
228227 }
229- return id , res , nil
228+ return res , nil
230229}
231230
232231// Checkbox creates a checkbox with the given boolean state and text label.
@@ -356,8 +355,7 @@ func (c *Context) sliderF(value *float64, low, high, step float64, digits int, i
356355 return res , nil
357356}
358357
359- func (c * Context ) header (label string , isTreeNode bool , opt option , callerPC uintptr , f func () error ) error {
360- id := c .idFromCaller (callerPC )
358+ func (c * Context ) header (label string , isTreeNode bool , opt option , id controlID , f func () error ) error {
361359 c .SetGridLayout (nil , nil )
362360
363361 var expanded bool
@@ -406,8 +404,8 @@ func (c *Context) header(label string, isTreeNode bool, opt option, callerPC uin
406404 return nil
407405}
408406
409- func (c * Context ) treeNode (label string , opt option , callerPC uintptr , f func ()) error {
410- if err := c .header (label , true , opt , callerPC , func () (err error ) {
407+ func (c * Context ) treeNode (label string , opt option , id controlID , f func ()) error {
408+ if err := c .header (label , true , opt , id , func () (err error ) {
411409 l , err := c .layout ()
412410 if err != nil {
413411 return err
0 commit comments