本文整理匯總了Golang中github.com/lazyshot/gotk3/glib.ToGObject函數的典型用法代碼示例。如果您正苦於以下問題:Golang ToGObject函數的具體用法?Golang ToGObject怎麽用?Golang ToGObject使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ToGObject函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: GetStack
// GetStack is a wrapper around gtk_stack_switcher_get_stack().
func (v *StackSwitcher) GetStack() *Stack {
c := C.gtk_stack_switcher_get_stack(v.native())
if c == nil {
return nil
}
obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
s := wrapStack(obj)
obj.RefSink()
runtime.SetFinalizer(obj, (*glib.Object).Unref)
return s
}
示例2: ColorButtonNewWithRGBA
// ColorButtonNewWithRGBA is a wrapper around gtk_color_button_new_with_rgba().
func ColorButtonNewWithRGBA(gdkColor *gdk.RGBA) (*ColorButton, error) {
c := C.gtk_color_button_new_with_rgba((*C.GdkRGBA)(unsafe.Pointer((&gdkColor.RGBA))))
if c == nil {
return nil, nilPtrErr
}
obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
tb := wrapColorButton(obj)
obj.RefSink()
runtime.SetFinalizer(obj, (*glib.Object).Unref)
return tb, nil
}
示例3: StatusIconNew
// StatusIconNew is a wrapper around gtk_status_icon_new()
func StatusIconNew() (*StatusIcon, error) {
c := C.gtk_status_icon_new()
if c == nil {
return nil, nilPtrErr
}
obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
obj.RefSink()
e := wrapStatusIcon(obj)
runtime.SetFinalizer(obj, (*glib.Object).Unref)
return e, nil
}
示例4: GetImage
// GetImage is a wrapper around gtk_message_dialog_get_image().
func (v *MessageDialog) GetImage() (*Widget, error) {
c := C.gtk_message_dialog_get_image(v.native())
if c == nil {
return nil, nilPtrErr
}
obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
w := wrapWidget(obj)
obj.RefSink()
runtime.SetFinalizer(obj, (*glib.Object).Unref)
return w, nil
}
示例5: HeaderBarNew
// HeaderBarNew is a wrapper around gtk_header_bar_new().
func HeaderBarNew() (*HeaderBar, error) {
c := C.gtk_header_bar_new()
if c == nil {
return nil, nilPtrErr
}
obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
h := wrapHeaderBar(obj)
obj.RefSink()
runtime.SetFinalizer(obj, (*glib.Object).Unref)
return h, nil
}
示例6: GetVisibleChild
// GetVisibleChild is a wrapper around gtk_stack_get_visible_child().
func (v *Stack) GetVisibleChild() *Widget {
c := C.gtk_stack_get_visible_child(v.native())
if c == nil {
return nil
}
obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
s := wrapWidget(obj)
obj.RefSink()
runtime.SetFinalizer(obj, (*glib.Object).Unref)
return s
}
示例7: GetDefaultScreen
// GetDefaultScreen() is a wrapper around gdk_display_get_default_screen().
func (v *Display) GetDefaultScreen() (*Screen, error) {
c := C.gdk_display_get_default_screen(v.native())
if c == nil {
return nil, nilPtrErr
}
obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
s := &Screen{obj}
obj.Ref()
runtime.SetFinalizer(obj, (*glib.Object).Unref)
return s, nil
}
示例8: RevealerNew
// RevealerNew is a wrapper around gtk_revealer_new()
func RevealerNew() (*Revealer, error) {
c := C.gtk_revealer_new()
if c == nil {
return nil, nilPtrErr
}
obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
r := wrapRevealer(obj)
obj.RefSink()
runtime.SetFinalizer(obj, (*glib.Object).Unref)
return r, nil
}
示例9: SearchBarNew
// SearchBarNew is a wrapper around gtk_search_bar_new()
func SearchBarNew() (*SearchBar, error) {
c := C.gtk_search_bar_new()
if c == nil {
return nil, nilPtrErr
}
obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
s := wrapSearchBar(obj)
obj.RefSink()
runtime.SetFinalizer(obj, (*glib.Object).Unref)
return s, nil
}
示例10: ListBoxRowNew
func ListBoxRowNew() (*ListBoxRow, error) {
c := C.gtk_list_box_row_new()
if c == nil {
return nil, nilPtrErr
}
obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
w := wrapListBoxRow(obj)
obj.RefSink()
runtime.SetFinalizer(obj, (*glib.Object).Unref)
return w, nil
}
示例11: GetHeader
// GetHeader is a wrapper around gtk_list_box_row_get_header().
func (v *ListBoxRow) GetHeader() *Widget {
c := C.gtk_list_box_row_get_header(v.native())
if c == nil {
return nil
}
obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
w := wrapWidget(obj)
obj.RefSink()
runtime.SetFinalizer(obj, (*glib.Object).Unref)
return w
}
示例12: GetRowAtY
// GetRowAtY is a wrapper around gtk_list_box_get_row_at_y().
func (v *ListBox) GetRowAtY(y int) *ListBoxRow {
c := C.gtk_list_box_get_row_at_y(v.native(), C.gint(y))
if c == nil {
return nil
}
obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
l := wrapListBoxRow(obj)
obj.RefSink()
runtime.SetFinalizer(obj, (*glib.Object).Unref)
return l
}
示例13: GetSelectedRow
// GetSelectedRow is a wrapper around gtk_list_box_get_selected_row().
func (v *ListBox) GetSelectedRow() *ListBoxRow {
c := C.gtk_list_box_get_selected_row(v.native())
if c == nil {
return nil
}
obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
l := wrapListBoxRow(obj)
obj.RefSink()
runtime.SetFinalizer(obj, (*glib.Object).Unref)
return l
}
示例14: GetCustomTitle
// GetCustomTitle is a wrapper around gtk_header_bar_get_custom_title().
func (v *HeaderBar) GetCustomTitle() (*Widget, error) {
c := C.gtk_header_bar_get_custom_title(v.native())
if c == nil {
return nil, nilPtrErr
}
obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
w := wrapWidget(obj)
obj.RefSink()
runtime.SetFinalizer(obj, (*glib.Object).Unref)
return w, nil
}
示例15: ColorButtonNew
// ColorButtonNew is a wrapper around gtk_color_button_new().
func ColorButtonNew() (*ColorButton, error) {
c := C.gtk_color_button_new()
if c == nil {
return nil, nilPtrErr
}
obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
tb := wrapColorButton(obj)
obj.RefSink()
runtime.SetFinalizer(obj, (*glib.Object).Unref)
return tb, nil
}