Ejemplo n.º 1
0
Archivo: icon.go Proyecto: sqp/godock
func (o *dockIcon) SubDockIsVisible() bool {
	dock := o.GetSubDock()
	if dock == nil {
		return false
	}
	cont := dock.ToContainer()
	if cont == nil {
		return false
	}
	return gobool(C.gtk_widget_get_visible(cont.Ptr.pWidget))
}
Ejemplo n.º 2
0
func (s *sysData) center() {
	ret := make(chan struct{})
	defer close(ret)
	uitask <- func() {
		if C.gtk_widget_get_visible(s.widget) == C.FALSE {
			// hint to the WM to make it centered when it is shown again
			// thanks to Jasper in irc.gimp.net/#gtk+
			C.gtk_window_set_position(togtkwindow(s.widget), C.GTK_WIN_POS_CENTER)
		} else {
			var width, height C.gint

			s.resetposition()
			//we should be able to use gravity to simplify this, but it doesn't take effect immediately, and adding show calls does nothing (thanks Jasper in irc.gimp.net/#gtk+)
			C.gtk_window_get_size(togtkwindow(s.widget), &width, &height)
			C.gtk_window_move(togtkwindow(s.widget),
				(C.gdk_screen_width()/2)-(width/2),
				(C.gdk_screen_height()/2)-(width/2))
		}
		ret <- struct{}{}
	}
	<-ret
}
Ejemplo n.º 3
0
// GetVisible is a wrapper around gtk_widget_get_visible().
func (v *Widget) GetVisible() bool {
	c := C.gtk_widget_get_visible(v.native())
	return gobool(c)
}