Skip to content

Commit

Permalink
Merge pull request conformal#32 from twstrike/gtk-assistant
Browse files Browse the repository at this point in the history
Add support to GtkAssistant
  • Loading branch information
andre-hub committed Nov 4, 2015
2 parents 0f0717b + e65900e commit 6c04540
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gtk/gtk.go
Original file line number Diff line number Diff line change
Expand Up @@ -1245,13 +1245,14 @@ func (v *Assistant) GetNPages() int {
}

// GetNthPage is a wrapper around gtk_assistant_get_nth_page().
func (v *Assistant) GetNthPage(pageNum int) *Widget {
func (v *Assistant) GetNthPage(pageNum int) (*Widget, error) {
c := C.gtk_assistant_get_nth_page(v.native(), C.gint(pageNum))
if c == nil {
return nil
return nil, fmt.Errorf("page %d is out of bounds", pageNum)
}

obj := wrapObject(unsafe.Pointer(c))
return wrapWidget(obj)
return wrapWidget(obj), nil
}

// PrependPage is a wrapper around gtk_assistant_prepend_page().
Expand Down Expand Up @@ -10376,6 +10377,7 @@ var WrapMap = map[string]WrapFn{
"GtkAccelGroup": wrapAccelGroup,
"GtkAccelMao": wrapAccelMap,
"GtkAdjustment": wrapAdjustment,
"GtkAssistant": wrapAssistant,
"GtkBin": wrapBin,
"GtkBox": wrapBox,
"GtkButton": wrapButton,
Expand Down

0 comments on commit 6c04540

Please sign in to comment.