Esempio n. 1
0
        bool ShowTooltip(int xloc, int yloc)
        {
            ModifierType mask;             // ignored
            int          mxloc, myloc;

            showTipScheduled = false;

            treeview.GdkWindow.GetPointer(out mxloc, out myloc, out mask);

            Gtk.TreePath       path;
            Gtk.TreeViewColumn col;

            treeview.GetPathAtPos(xloc, yloc, out path, out col);
            if (col == null)
            {
                HideTipWindow();
                return(false);
            }

            Gtk.TreeIter iter;
            if (!store.GetIter(out iter, path))
            {
                HideTipWindow();
                return(false);
            }

            object ob  = store.GetValue(iter, ReferenceCol);
            string txt = GetTipText(iter, col.SortColumnId, ob);

            if (lastTipTxt != txt)
            {
                HideTipWindow();
                lastTipTxt = txt;
                if (string.IsNullOrEmpty(txt))
                {
                    return(false);
                }
                tipWindow = new TipWindow(txt);
                tipWindow.Child.ShowAll();
            }

            int ox, oy;

            treeview.GdkWindow.GetOrigin(out ox, out oy);
            int w = tipWindow.Child.SizeRequest().Width;

            tipWindow.Move(mxloc + ox - (w / 2), myloc + oy + 20);
            tipWindow.ShowAll();

            return(false);
        }
Esempio n. 2
0
 void HideTipWindow()
 {
     lastTipTxt = null;
     if (showTipScheduled)
     {
         GLib.Source.Remove(tipTimeoutId);
         showTipScheduled = false;
     }
     if (tipWindow != null)
     {
         tipWindow.Destroy();
         tipWindow = null;
     }
 }
        bool ShowTooltip(int xloc, int yloc)
        {
            ModifierType mask; // ignored
            int mxloc, myloc;

            showTipScheduled = false;

            treeview.GdkWindow.GetPointer (out mxloc, out myloc, out mask);

            Gtk.TreePath path;
            Gtk.TreeViewColumn col;

            treeview.GetPathAtPos (xloc, yloc, out path, out col);
            if (col == null) {
                HideTipWindow ();
                return false;
            }

            Gtk.TreeIter iter;
            if (!store.GetIter (out iter, path)) {
                HideTipWindow ();
                return false;
            }

            object ob = store.GetValue (iter, ReferenceCol);
            string txt = GetTipText (iter, col.SortColumnId, ob);
            if (lastTipTxt != txt) {
                HideTipWindow ();
                lastTipTxt = txt;
                if (string.IsNullOrEmpty (txt))
                    return false;
                tipWindow = new TipWindow (txt);
                tipWindow.Child.ShowAll ();
            }

            int ox, oy;
            treeview.GdkWindow.GetOrigin (out ox, out oy);
            int w = tipWindow.Child.SizeRequest().Width;
            tipWindow.Move (mxloc + ox - (w/2), myloc + oy + 20);
            tipWindow.ShowAll ();

            return false;
        }
 void HideTipWindow()
 {
     lastTipTxt = null;
     if (showTipScheduled) {
         GLib.Source.Remove (tipTimeoutId);
         showTipScheduled = false;
     }
     if (tipWindow != null) {
         tipWindow.Destroy ();
         tipWindow = null;
     }
 }