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();
                tipWindow = new TipWindow(txt);
                tipWindow.ShowAll();
            }
            lastTipTxt = txt;

            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);
        }
Пример #3
0
		void HideTipWindow ()
		{
			lastTipTxt = null;
			if (showTipScheduled) {
				GLib.Source.Remove (tipTimeoutId);
				showTipScheduled = false;
			}
			if (tipWindow != null) {
				tipWindow.Destroy ();
				tipWindow = null;
			}
		}
Пример #4
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 ();
				tipWindow = new TipWindow (txt);
				tipWindow.ShowAll ();
			}
			lastTipTxt = txt;
			
			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;
		}