Skip to content

Commit

Permalink
Merge pull request conformal#27 from twstrike/add_set_default
Browse files Browse the repository at this point in the history
Adds some wrappers
  • Loading branch information
andre-hub committed Oct 27, 2015
2 parents b133392 + 3003b3c commit cda24f1
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions gtk/gtk.go
Original file line number Diff line number Diff line change
Expand Up @@ -9696,6 +9696,17 @@ func (v *Widget) SetCanFocus(canFocus bool) {
C.gtk_widget_set_can_focus(v.native(), gbool(canFocus))
}

// GetCanDefault is a wrapper around gtk_widget_get_can_default().
func (v *Widget) GetCanDefault() bool {
c := C.gtk_widget_get_can_default(v.native())
return gobool(c)
}

// SetCanDefault is a wrapper around gtk_widget_set_can_default().
func (v *Widget) SetCanDefault(canDefault bool) {
C.gtk_widget_set_can_default(v.native(), gbool(canDefault))
}

// GetMapped is a wrapper around gtk_window_get_mapped().
func (v *Widget) GetMapped() bool {
c := C.gtk_widget_get_mapped(v.native())
Expand Down Expand Up @@ -10359,9 +10370,20 @@ func (v *Window) HasToplevelFocus() bool {

// TODO gtk_window_set_focus().

// TODO gtk_window_get_default_widget().
// GetDefaultWidget is a wrapper arround gtk_window_get_default_widget().
func (v *Window) GetDefaultWidget() *Widget {
c := C.gtk_window_get_default_widget(v.native())
if c == nil {
return nil
}
obj := wrapObject(unsafe.Pointer(c))
return wrapWidget(obj)
}

// TODO gtk_window_set_default().
// SetDefault is a wrapper arround gtk_window_set_default().
func (v *Window) SetDefault(widget IWidget) {
C.gtk_window_set_default(v.native(), widget.toWidget())
}

// Present is a wrapper around gtk_window_present().
func (v *Window) Present() {
Expand Down

0 comments on commit cda24f1

Please sign in to comment.