native: Add a set_tooltip method
This lets us associate a tooltip window with the native, so we can allocate it when necessary, without having to rely on the ::size-allocate signal.
This commit is contained in:
@@ -60,12 +60,19 @@ gtk_native_default_check_resize (GtkNative *self)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_native_default_set_tooltip (GtkNative *self,
|
||||
GtkNative *tooltip)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_native_default_init (GtkNativeInterface *iface)
|
||||
{
|
||||
iface->get_renderer = gtk_native_default_get_renderer;
|
||||
iface->get_surface_transform = gtk_native_default_get_surface_transform;
|
||||
iface->check_resize = gtk_native_default_check_resize;
|
||||
iface->set_tooltip = gtk_native_default_set_tooltip;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -149,3 +156,14 @@ gtk_native_get_for_surface (GdkSurface *surface)
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_native_set_tooltip (GtkNative *self,
|
||||
GtkNative *tooltip)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_NATIVE (self));
|
||||
g_return_if_fail (tooltip == NULL || GTK_IS_NATIVE (tooltip));
|
||||
|
||||
GTK_NATIVE_GET_IFACE (self)->set_tooltip (self, tooltip);
|
||||
|
||||
}
|
||||
|
||||
@@ -53,6 +53,9 @@ struct _GtkNativeInterface
|
||||
int *y);
|
||||
|
||||
void (* check_resize) (GtkNative *self);
|
||||
|
||||
void (* set_tooltip) (GtkNative *self,
|
||||
GtkNative *tooltip);
|
||||
};
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
@@ -67,6 +70,10 @@ GdkSurface *gtk_native_get_surface (GtkNative *self);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GskRenderer *gtk_native_get_renderer (GtkNative *self);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_native_set_tooltip (GtkNative *self,
|
||||
GtkNative *tooltip);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_NATIVE_H__ */
|
||||
|
||||
Reference in New Issue
Block a user