当前位置: 首页>>代码示例>>C#>>正文


C# Gtk.ScrolledWindow.Add方法代码示例

本文整理汇总了C#中Gtk.ScrolledWindow.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Gtk.ScrolledWindow.Add方法的具体用法?C# Gtk.ScrolledWindow.Add怎么用?C# Gtk.ScrolledWindow.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gtk.ScrolledWindow的用法示例。


在下文中一共展示了Gtk.ScrolledWindow.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WindowView

        public WindowView(Main _view, Controller.Window _ctl)
        {
            View = _view;
            Window = _ctl;
            Homogeneous = false;
            Spacing = 0;
            BorderWidth = 0;
            var topLevelBox = new Gtk.VBox();
            topLevelBox.Homogeneous = false;
            topLevelBox.Spacing = 0;
            topLevelBox.BorderWidth = 0;
            textView = new WindowTextView(Window);
            scroll = new Gtk.ScrolledWindow {
                HscrollbarPolicy = Gtk.PolicyType.Automatic,
                VscrollbarPolicy = Gtk.PolicyType.Automatic
            };
            scroll.Add(textView);
            Window.CursorMovedByCommand.Add(i =>
            {
                textView.ScrollToIter(i.GtkIter, 0, false, 0, 0);
            });
            topLevelBox.PackStart(scroll, true, true, 0);
            status = new Gtk.Statusbar();
            status.HasResizeGrip = false;
            status.Push(StatusbarMode, Window.CurrentMode.GetName());
            Window.CurrentMode.Event.Changed += m =>
            {
                status.Pop(StatusbarMode);
                status.Push(StatusbarMode, Window.CurrentMode.GetName());
            };
            Window.Model.Changed += m =>
            {
                textView.Buffer = m;
            };
            topLevelBox.PackStart(status, false, false, 0);

            // Wrap the topLevelBox with borders on the left and right
            var hlBox = new Gtk.DrawingArea();
            NormalColor = hlBox.Style.Background(Gtk.StateType.Normal);
            hlBox.WidthRequest = 10;
            var borderBox = new Gtk.HBox();
            borderBox.Homogeneous = false;
            borderBox.Spacing = 0;
            borderBox.BorderWidth = 0;
            borderBox.PackStart(hlBox, false, false, 0);
            borderBox.PackStart(topLevelBox, true, true, 0);

            textView.FocusInEvent += (object o, Gtk.FocusInEventArgs args) =>
            {
                Window.Controller.FocusedWindow.Value = Window;
                hlBox.ModifyBg(Gtk.StateType.Normal, HighlightColor);
            };

            textView.FocusOutEvent += (object o, Gtk.FocusOutEventArgs args) =>
            {
                hlBox.ModifyBg(Gtk.StateType.Normal, NormalColor);
            };

            Add(borderBox);
        }
开发者ID:cpdean,项目名称:di,代码行数:60,代码来源:WindowView.cs

示例2: DisassemblyView

		public DisassemblyView ()
		{
			UntitledName = GettextCatalog.GetString ("Disassembly");
			sw = new Gtk.ScrolledWindow ();
			editor = new Mono.TextEditor.TextEditor ();
			editor.Document.ReadOnly = true;
			
			TextEditorOptions options = new TextEditorOptions ();
			options.CopyFrom (TextEditorOptions.DefaultOptions);
			options.ShowEolMarkers = false;
			options.ShowInvalidLines = false;
			options.ShowLineNumberMargin = false;
			editor.Options = options;
			
			sw.Add (editor);
			sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
			sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;
			sw.ShowAll ();
			sw.Vadjustment.ValueChanged += OnScrollEditor;
			sw.VScrollbar.ButtonPressEvent += OnPress;
			sw.VScrollbar.ButtonReleaseEvent += OnRelease;
			sw.VScrollbar.Events |= Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask;
			sw.ShadowType = Gtk.ShadowType.In;
			
			sw.Sensitive = false;
			
			currentDebugLineMarker = new CurrentDebugLineTextMarker (editor);
			DebuggingService.StoppedEvent += OnStop;
		}
开发者ID:raufbutt,项目名称:monodevelop-old,代码行数:29,代码来源:DisassemblyView.cs

示例3: DisassemblyView

		public DisassemblyView ()
		{
			ContentName = GettextCatalog.GetString ("Disassembly");
			sw = new Gtk.ScrolledWindow ();
			editor = new TextEditor ();
			editor.Document.ReadOnly = true;
			
			editor.Options = new CommonTextEditorOptions {
				ShowLineNumberMargin = false,
			};
			
			sw.Add (editor);
			sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
			sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;
			sw.ShowAll ();
			sw.Vadjustment.ValueChanged += OnScrollEditor;
			sw.VScrollbar.ButtonPressEvent += OnPress;
			sw.VScrollbar.ButtonReleaseEvent += OnRelease;
			sw.VScrollbar.Events |= Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask;
			sw.ShadowType = Gtk.ShadowType.In;
			
			sw.Sensitive = false;
			
			currentDebugLineMarker = new CurrentDebugLineTextMarker (editor);
			DebuggingService.StoppedEvent += OnStop;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:26,代码来源:DisassemblyView.cs

示例4: CompareWindow

        /// <summary>
        /// Initializes a new instance of the <see cref="Trilogic.CompareWindow"/> class.
        /// </summary>
        /// <param name="parent">The parent window.</param>
        /// <param name="compareName">Compare name.</param>
        /// <param name="fileSide">File side.</param>
        /// <param name="databaseSide">Database side.</param>
        public CompareWindow(MainWindow parent, string compareName, SchemaData fileSide, SchemaData databaseSide)
            : base(Gtk.WindowType.Toplevel)
        {
            this.Build();
            this.parent = parent;

            this.docLocal = new TextDocument();
            this.docDB = new TextDocument();

            this.editorLocal = new TextEditor(this.docLocal);
            this.editorDB = new TextEditor(this.docDB);

            Gtk.ScrolledWindow scrollLocal = new Gtk.ScrolledWindow();
            Gtk.ScrolledWindow scrollDB = new Gtk.ScrolledWindow();
            scrollLocal.Add(this.editorLocal);
            scrollDB.Add(this.editorDB);

            this.hbox1.Add(scrollDB);
            this.hbox1.Add(scrollLocal);

            Gtk.Box.BoxChild childLocal = (Gtk.Box.BoxChild)this.hbox1[scrollLocal];
            childLocal.Position = 2;

            Gtk.Box.BoxChild childDB = (Gtk.Box.BoxChild)this.hbox1[scrollDB];
            childDB.Position = 0;

            this.ShowAll();

            this.Title += " - " + compareName;

            this.fileSide = fileSide;
            this.databaseSide = databaseSide;

            this.ShowSchema();
        }
开发者ID:Etersoul,项目名称:trilogic-data,代码行数:42,代码来源:CompareWindow.cs

示例5: FileScout

		public FileScout()
		{
			string path = IdeApp.ProjectOperations.ProjectsDefaultPath;

			if (Directory.Exists(path))
			{
				fb.CurrentDir = path;
			}

			fb.DirectoryChangedEvent += new DirectoryChangedEventHandler (OnDirChanged);
			filelister.RowActivated += new Gtk.RowActivatedHandler (FileSelected);
			IdeApp.Workspace.FirstWorkspaceItemOpened += OnCombineOpened;
			IdeApp.Workspace.LastWorkspaceItemClosed += OnCombineClosed;

			Gtk.ScrolledWindow listsw = new Gtk.ScrolledWindow ();
			listsw.Add (filelister);
			
			fontChanger = new PadFontChanger (listsw, delegate (Pango.FontDescription desc) {
				filelister.SetCustomFont (desc);
				fb.SetCustomFont (desc);
			}, delegate () {
				filelister.ColumnsAutosize ();
				fb.ColumnsAutosize ();
			});
			
			this.Pack1 (fb, true, true);
			this.Pack2 (listsw, true, true);

			fb.SelectFirst ();
			
			OnDirChanged (fb.CurrentDir);
			this.ShowAll ();
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:33,代码来源:FileScout.cs

示例6: WindowView

        public WindowView(Main _view, Controller.Window _ctl)
        {
            View = _view;
            Window = _ctl;
            Homogeneous = false;
            Spacing = 0;
            BorderWidth = 0;
            var topLevelBox = new Gtk.VBox();
            topLevelBox.Homogeneous = false;
            topLevelBox.Spacing = 0;
            topLevelBox.BorderWidth = 0;
            textView = new WindowTextView(Window);
            scroll = new Gtk.ScrolledWindow {
                HscrollbarPolicy = Gtk.PolicyType.Automatic,
                VscrollbarPolicy = Gtk.PolicyType.Automatic
            };
            scroll.Add(textView);
            Window.CursorMovedByCommand.Add(i =>
            {
                textView.ScrollToIter(i.GtkIter, 0, false, 0, 0);
            });
            topLevelBox.PackStart(scroll, true, true, 0);

            status = new MultiStatusbar();
            status.Add(StatusbarItem.Create(100, () => Window.CurrentMode.GetName(), Window.CurrentMode.Changed));
            status.Add(StatusbarItem.Create(50, Window.Model.Value.HasUnsavedChanges, b => b ? "" : "Saved"));
            status.AddLast(StatusbarItem.Create(400, Window.Model.Value.File.ProjectRelativeFullName()));
            topLevelBox.PackStart(status, false, false, 0);

            Window.Model.Changed += m =>
            {
                textView.Buffer = m;
            };

            // Wrap the topLevelBox with borders on the left and right
            var hlBox = new Gtk.DrawingArea();
            NormalColor = hlBox.Style.Background(Gtk.StateType.Normal);
            hlBox.WidthRequest = 10;
            var borderBox = new Gtk.HBox();
            borderBox.Homogeneous = false;
            borderBox.Spacing = 0;
            borderBox.BorderWidth = 0;
            borderBox.PackStart(hlBox, false, false, 0);
            borderBox.PackStart(topLevelBox, true, true, 0);

            textView.FocusInEvent += (object o, Gtk.FocusInEventArgs args) =>
            {
                Window.Controller.Windows.Current = Window;
                hlBox.ModifyBg(Gtk.StateType.Normal, HighlightColor);
            };

            textView.FocusOutEvent += (object o, Gtk.FocusOutEventArgs args) =>
            {
                hlBox.ModifyBg(Gtk.StateType.Normal, NormalColor);
            };

            Add(borderBox);
        }
开发者ID:ktvoelker,项目名称:di,代码行数:58,代码来源:WindowView.cs

示例7: InfoDialog

		public InfoDialog (Gtk.Window parent) : base (Catalog.GetString ("Metadata Browser"),
											    parent,
											    Gtk.DialogFlags.NoSeparator | Gtk.DialogFlags.DestroyWithParent)
		{
			info_display = new InfoDisplay ();
			SetDefaultSize (400, 400);
			Gtk.ScrolledWindow scrolled = new Gtk.ScrolledWindow ();
			VBox.PackStart (scrolled);
			scrolled.Add (info_display);
		}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:10,代码来源:InfoDisplay.cs

示例8: CrashDialog

        public CrashDialog(Gtk.Window parent, Exception e)
            : base()
        {
            SetDefaultSize(640, 480);
            Title = "smuxi - " + _("Oops, I did it again...");
            Parent = parent;

            Gtk.HBox hbox = new Gtk.HBox();

            Gtk.Image image = new Gtk.Image(Gtk.Stock.DialogError, Gtk.IconSize.Dialog);
            hbox.PackStart(image, false, false, 2);

            Gtk.VBox label_vbox = new Gtk.VBox();
            Gtk.Label label1 = new Gtk.Label();
            Gtk.Label label2 = new Gtk.Label();
            label1.Markup = "<b>" +
                            _("smuxi crashed because an unhandled exception was thrown!") +
                            "</b>";
            label2.Markup = _("Here is the stacktrace, please report this bug!");
            label_vbox.PackStart(label1, false, false, 0);
            label_vbox.PackStart(new Gtk.Fixed(), true, true, 0);
            label_vbox.PackStart(label2, false, false, 0);
            hbox.PackStart(label_vbox, true, true, 0);

            Gtk.VBox vbox = new Gtk.VBox();
            vbox.PackStart(hbox, false, false, 2);

            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            sw.ShadowType = Gtk.ShadowType.In;
            Gtk.TextView tv = new Gtk.TextView();
            tv.Editable = false;
            tv.CursorVisible = false;
            sw.Add(tv);
            vbox.PackStart(sw, true, true, 2);

            // add to the dialog
            VBox.PackStart(vbox, true, true, 2);
            AddButton(Gtk.Stock.Quit, 0);

            string message = String.Empty;
            if (e.InnerException != null) {
                message = "Inner-Exception Type:\n"+e.InnerException.GetType()+"\n\n"+
                          "Inner-Exception Message:\n"+e.InnerException.Message+"\n\n"+
                          "Inner-Exception StackTrace:\n"+e.InnerException.StackTrace+"\n";
            }
            message += "Exception Type:\n"+e.GetType()+"\n\n"+
                       "Exception Message:\n"+e.Message+"\n\n"+
                       "Exception StackTrace:\n"+e.StackTrace;
            tv.Buffer.Text = message;

            ShowAll();
        }
开发者ID:RoninBG,项目名称:smuxi,代码行数:52,代码来源:CrashDialog.cs

示例9: TextEditorDialog

		public TextEditorDialog ()
		{
			Gtk.ScrolledWindow sc = new Gtk.ScrolledWindow ();
			sc.HscrollbarPolicy = Gtk.PolicyType.Automatic;
			sc.VscrollbarPolicy = Gtk.PolicyType.Automatic;
			sc.ShadowType = Gtk.ShadowType.In;
			sc.BorderWidth = 6;
			
			textview = new Gtk.TextView ();
			sc.Add (textview);
			
			dialog = new Gtk.Dialog ();
			dialog.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel);
			dialog.AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok);
			dialog.VBox.Add (sc);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:16,代码来源:TextEditorDialog.cs

示例10: LogWindow

		public LogWindow() : base("Log Model")
		{
			this.Move(0,0);

			this.SetSizeRequest(600, 500);

			Gtk.TreeView treeviewLog = new Gtk.TreeView();

			Gtk.TreeViewColumn idColumn = new Gtk.TreeViewColumn ();
			idColumn.Title = "Id";

			Gtk.TreeViewColumn typeColumn = new Gtk.TreeViewColumn ();
			typeColumn.Title = "Type";

			Gtk.TreeViewColumn descriptionColumn = new Gtk.TreeViewColumn ();
			descriptionColumn.Title = "Description";

			logListStore = new Gtk.ListStore (typeof (string), typeof (string), typeof (string));

			treeviewLog.AppendColumn(idColumn);
			treeviewLog.AppendColumn(typeColumn);
			treeviewLog.AppendColumn(descriptionColumn);

			treeviewLog.Model = logListStore;




			Gtk.CellRendererText idCell = new Gtk.CellRendererText ();
			idColumn.PackStart(idCell, true);

			Gtk.CellRendererText typeCell = new Gtk.CellRendererText ();
			typeColumn.PackStart(typeCell, true);

			Gtk.CellRendererText descriptionCell = new Gtk.CellRendererText ();
			descriptionColumn.PackStart(descriptionCell, true);

			idColumn.AddAttribute(idCell, "text", 0);
			typeColumn.AddAttribute(typeCell, "text", 1);
			descriptionColumn.AddAttribute(descriptionCell, "text", 2);

			Gtk.ScrolledWindow scWindow = new Gtk.ScrolledWindow();
			scWindow.Add(treeviewLog);

			this.Add(scWindow);

		}
开发者ID:yuraklb,项目名称:AISModel,代码行数:47,代码来源:LogWindow.cs

示例11: FlagsSelectorDialog

		public FlagsSelectorDialog (Gtk.Window parent, Type enumDesc, ulong flags, string title)
		{
			this.flags = flags;
			this.parent = parent;

			Gtk.ScrolledWindow sc = new Gtk.ScrolledWindow ();
			sc.HscrollbarPolicy = Gtk.PolicyType.Automatic;
			sc.VscrollbarPolicy = Gtk.PolicyType.Automatic;
			sc.ShadowType = Gtk.ShadowType.In;
			sc.BorderWidth = 6;
			
			treeView = new Gtk.TreeView ();
			sc.Add (treeView);
			
			dialog = new Gtk.Dialog ();
			IdeTheme.ApplyTheme (dialog);
			dialog.VBox.Add (sc);
			dialog.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel);
			dialog.AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok);
			
			store = new Gtk.ListStore (typeof(bool), typeof(string), typeof(ulong));
			treeView.Model = store;
			treeView.HeadersVisible = false;
			
			Gtk.TreeViewColumn col = new Gtk.TreeViewColumn ();
			
			Gtk.CellRendererToggle tog = new Gtk.CellRendererToggle ();
			tog.Toggled += new Gtk.ToggledHandler (OnToggled);
			col.PackStart (tog, false);
			col.AddAttribute (tog, "active", 0);
			
			Gtk.CellRendererText crt = new Gtk.CellRendererText ();
			col.PackStart (crt, true);
			col.AddAttribute (crt, "text", 1);
			
			treeView.AppendColumn (col);

			values = System.Enum.GetValues (enumDesc);
			foreach (object value in values) {
				ulong val = Convert.ToUInt64 (value);
				store.AppendValues ((flags == 0 && val == 0) || ((flags & val) != 0), value.ToString (), val);
			}
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:43,代码来源:FlagsSelectorDialog.cs

示例12: RunModalDialog

 private static void RunModalDialog(string title, string format, params object [] args)
 {
     Gtk.Dialog dlg = new Gtk.Dialog ("Tomboy.InsertImage - " + Catalog.GetString(title), null,
                                      Gtk.DialogFlags.Modal | Gtk.DialogFlags.DestroyWithParent);
     var text = new Gtk.TextView ();
     text.WrapMode = Gtk.WrapMode.Word;
     text.Editable = false;
     if (args.Length > 0)
         format = string.Format (format, args);
     text.Buffer.Text = format;
     var scroll = new Gtk.ScrolledWindow ();
     scroll.Add (text);
     dlg.AddButton (Catalog.GetString("Close"), Gtk.ResponseType.Close);
     dlg.VBox.PackStart (scroll, true, true, 0);
     dlg.SetSizeRequest (300, 240);
     scroll.ShowAll ();
     dlg.Run ();
     dlg.Destroy ();
 }
开发者ID:binarytemple,项目名称:tomboy-image,代码行数:19,代码来源:Message.cs

示例13: FileScout

        public FileScout()
        {
            fb.DirectoryChangedEvent += new DirectoryChangedEventHandler (OnDirChanged);
            filelister.RowActivated += new Gtk.RowActivatedHandler (FileSelected);
            Runtime.ProjectService.CombineOpened += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler(OnCombineOpened));
            Runtime.ProjectService.CombineClosed += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler(OnCombineClosed));

            Gtk.Frame treef  = new Gtk.Frame ();
            treef.Add (fb);

            Gtk.ScrolledWindow listsw = new Gtk.ScrolledWindow ();
            listsw.ShadowType = Gtk.ShadowType.In;
            listsw.Add (filelister);

            this.Pack1 (treef, true, true);
            this.Pack2 (listsw, true, true);

            fb.SelectFirst ();

            OnDirChanged (fb.CurrentDir);
            this.ShowAll ();
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:22,代码来源:FileScout.cs

示例14: ElementChooserDialog

 public ElementChooserDialog(Type requestedType, string title)
 {
     base.Modal = true;
     base.HeightRequest = 400;
     base.WidthRequest = 250;
     //TODO: i18n
     base.Title = title;
     base.AddButton (GettextCatalog.GetString ("_Cancel"), Gtk.ResponseType.Cancel);
     base.AddButton (GettextCatalog.GetString ("_Accept"), Gtk.ResponseType.Accept);
     base.Response += new Gtk.ResponseHandler(OnResponse);
     base.SetResponseSensitive(Gtk.ResponseType.Accept, false);
     _requestedType = requestedType;
     Tree tree = new Tree();
     tree.IsReadOnly = true;
     tree.Draw(_elementList);
     tree.Show();
     _tree = tree;
     _tree.SetBroadcaster(this);
     Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
     sw.Add(tree);
     base.VBox.Add(sw);
     sw.Show();
 }
开发者ID:MonoBrasil,项目名称:historico,代码行数:23,代码来源:ElementChooserDialog.cs

示例15: Build

 protected virtual void Build()
 {
     Name = "GtkSharpTest.Database";
     // Container child GtkSharpTest.Database.Gtk.Container+ContainerChild
     vbox5 = new Gtk.VBox();
     vbox5.Name = "vbox5";
     vbox5.Spacing = 6;
     // Container child vbox5.Gtk.Box+BoxChild
     CurrentPath = new Gtk.Label();
     CurrentPath.Name = "CurrentPath";
     CurrentPath.Xalign = 0F;
     CurrentPath.LabelProp = Mono.Unix.Catalog.GetString("label11");
     vbox5.Add(CurrentPath);
     Gtk.Box.BoxChild w1 = (Gtk.Box.BoxChild) vbox5[CurrentPath];
     w1.Position = 0;
     w1.Expand = false;
     w1.Fill = false;
     // Container child vbox5.Gtk.Box+BoxChild
     GtkScrolledWindow = new Gtk.ScrolledWindow();
     GtkScrolledWindow.Name = "GtkScrolledWindow";
     GtkScrolledWindow.ShadowType = (Gtk.ShadowType) 1;
     // Container child GtkScrolledWindow.Gtk.Container+ContainerChild
     Contents = new Gtk.IconView();
     Contents.CanFocus = true;
     Contents.Name = "Contents";
     GtkScrolledWindow.Add(Contents);
     vbox5.Add(GtkScrolledWindow);
     Gtk.Box.BoxChild w3 = (Gtk.Box.BoxChild) vbox5[GtkScrolledWindow];
     w3.Position = 1;
     Add(vbox5);
     /*if ((this.Child != null))
     {
         this.Child.ShowAll();
     }*/
     Hide();
 }
开发者ID:killwort,项目名称:touchmpc,代码行数:36,代码来源:Database.cs


注:本文中的Gtk.ScrolledWindow.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。