コード例 #1
0
        // Links can also be activated by clicking.
        void EventAfter(object sender, WidgetEventAfterArgs args)
        {
            if (args.Event.Type != Gdk.EventType.ButtonRelease)
                return;

            Gdk.EventButton evt = (Gdk.EventButton)args.Event;

            if (evt.Button != 1)
                return;

            TextView view = sender as TextView;
            TextIter start, end, iter;
            int x, y;

            // we shouldn't follow a link if the user has selected something
            view.Buffer.GetSelectionBounds (out start, out end);
            if (start.Offset != end.Offset)
                return;

            view.WindowToBufferCoords (TextWindowType.Widget, (int) evt.X, (int) evt.Y, out x, out y);
            iter = view.GetIterAtLocation (x, y);

            FollowIfLink (view, iter);
        }
コード例 #2
0
ファイル: VolumeButton.cs プロジェクト: mono-soc-2011/banshee
        private void OnWidgetEventAfter(object o, WidgetEventAfterArgs args)
        {
            if(args.Event.Type != Gdk.EventType.Scroll) {
                return;
            }

            try {
                g_signal_stop_emission_by_name(Handle, "event-after");
            } catch(DllNotFoundException) {
                WarnGObjectMap();
                g_signal_stop_emission_by_name_fallback(Handle, "event-after");
            }
        }
コード例 #3
0
			void OnWidgetEvent (object o, WidgetEventAfterArgs args)
			{
				if (args.Event.Type == Gdk.EventType.Expose &&
				    o is TextView &&
				    args.Event.Window == view.GetWindow (TextWindowType.Text))
				{
					int x, y;
					view.WindowToBufferCoords (TextWindowType.Text,
					                           args.Event.Window.ClipRegion.Clipbox.X,
					                           args.Event.Window.ClipRegion.Clipbox.Y,
					                           out x, out y);

					TextIter start, end;
					int topLine;
					view.GetLineAtY (out start, y, out topLine);
					view.GetLineAtY (out end, y + args.Event.Window.ClipRegion.Clipbox.Height, out topLine);
					end.ForwardToLineEnd ();
					Draw (args.Event.Window, view, start, end);
				}
			}