Exemplo n.º 1
0
        private static void UpdateNativeTooltipText(object sender, EventArgs e)
        {
            if (sender is GtkWidget)
            {
                var         widget = (GtkWidget)sender;
                TooltipData tData;
                if (!widget.IsRealized || !nativeTooltips.TryGetValue(widget, out tData))
                {
                    return;
                }

                var nsv = GtkQuartz.GetView(widget);

                if (tData.TooltipId != null)
                {
                    nsv.RemoveToolTip(tData.TooltipId.Value);
                    tData.TooltipId = null;
                }

                if (string.IsNullOrEmpty(tData.Tooltip))
                {
                    return;
                }
                int x, y;
                widget.TranslateCoordinates(widget.Toplevel, 0, 0, out x, out y);
                var id = nsv.AddToolTip(new CGRect(x, y, widget.Allocation.Width, widget.Allocation.Height), tData.Tooltip, IntPtr.Zero);

                // update the cache
                tData.View.SetTarget(nsv);
                tData.TooltipId = id;
            }
        }
Exemplo n.º 2
0
        static void RemoveShadow(object sender, EventArgs e)
        {
            var popover = sender as GTK.Window;

            if (popover != null)
            {
                var window = GtkQuartz.GetWindow(popover);
                window.HasShadow = false;
            }
        }