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


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

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


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

示例1: 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

示例2: 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

示例3: GetVisualizerWidget

		public override Gtk.Widget GetVisualizerWidget (ObjectValue val)
		{
			var ops = DebuggingService.DebuggerSession.EvaluationOptions.Clone ();
			string file = Path.GetTempFileName ();
			Gdk.Pixbuf pixbuf;

			ops.AllowTargetInvoke = true;

			try {
				var pix = (RawValue) val.GetRawValue (ops);
				pix.CallMethod ("Save", file, "png");
				pixbuf = new Gdk.Pixbuf (file);
			} finally {
				File.Delete (file);
			}

			var sc = new Gtk.ScrolledWindow ();
			sc.ShadowType = Gtk.ShadowType.In;
			sc.HscrollbarPolicy = Gtk.PolicyType.Automatic;
			sc.VscrollbarPolicy = Gtk.PolicyType.Automatic;
			var image = new Gtk.Image (pixbuf);
			sc.AddWithViewport (image);
			sc.ShowAll ();
			return sc;
		}
开发者ID:neXyon,项目名称:monodevelop,代码行数:25,代码来源:PixbufVisualizer.cs

示例4: Initialize

        public override void Initialize(IPadWindow window)
        {
            base.Initialize(window);

            // Call ctors
            inputEditor = new TextEditor() { Name = "input", Events = Gdk.EventMask.AllEventsMask, HeightRequest = 80 };
            editor = new TextEditor() { Name = "output", Events = Gdk.EventMask.AllEventsMask };
            vpaned = new Gtk.VPaned();
            var scr1 = new Gtk.ScrolledWindow();
            var scr2 = new Gtk.ScrolledWindow();

            // Init layout
            scr1.ShadowType = Gtk.ShadowType.In;
            scr1.Child = inputEditor;
            vpaned.Add1(scr1);
            scr1.ShowAll();
            inputEditor.ShowAll();

            scr2.ShadowType = Gtk.ShadowType.In;
            scr2.Child = editor;
            vpaned.Add2(scr2);
            scr2.ShowAll();
            editor.ShowAll();

            vpaned.ShowAll();

            // Init editors
            var o = editor.Options;
            inputEditor.Options = o;
            o.ShowLineNumberMargin = false;
            o.ShowFoldMargin = false;
            o.ShowIconMargin = false;

            editor.Document.ReadOnly = true;
            inputEditor.Text = PropertyService.Get(lastInputStringPropId, string.Empty);
            editor.Text = string.Empty;
            editor.Document.SyntaxMode = new Highlighting.DSyntaxMode();
            inputEditor.Document.SyntaxMode = new Highlighting.DSyntaxMode();
            editor.Document.MimeType = Formatting.DCodeFormatter.MimeType;
            inputEditor.Document.MimeType = Formatting.DCodeFormatter.MimeType;

            // Init toolbar
            var tb = window.GetToolbar(Gtk.PositionType.Top);

            executeButton = new Gtk.Button();
            executeButton.Image = new Gtk.Image(Gtk.Stock.Execute, Gtk.IconSize.Menu);
            executeButton.TooltipText = "Evaluates the expression typed in the upper input editor.";
            executeButton.Clicked += Execute;
            tb.Add(executeButton);

            abortButton = new Gtk.Button();
            abortButton.Sensitive = false;
            abortButton.Image = new Gtk.Image(Gtk.Stock.Stop, Gtk.IconSize.Menu);
            abortButton.TooltipText = "Stops the evaluation.";
            abortButton.Clicked += (object sender, EventArgs e) => AbortExecution();
            tb.Add(abortButton);

            tb.ShowAll();
        }
开发者ID:simendsjo,项目名称:Mono-D,代码行数:59,代码来源:ExpressionEvaluationWidget.cs

示例5: Initialize

		public override void Initialize(IPadWindow pad)
		{
			base.Initialize(pad);

			// Init editor
			outputEditor = new TextEditor();
			outputEditor.Events = Gdk.EventMask.AllEventsMask;
			outputEditor.Name = "outputEditor";
			outputEditor.TabsToSpaces = false;
			
			scrolledWindow = new Gtk.ScrolledWindow();
			scrolledWindow.Child = outputEditor;
			scrolledWindow.ShadowType = Gtk.ShadowType.In;
			scrolledWindow.ShowAll();
			outputEditor.ShowAll();

			var o = outputEditor.Options;
			outputEditor.Document.MimeType = Formatting.DCodeFormatter.MimeType;
			o.ShowLineNumberMargin = false;
			o.ShowFoldMargin = false;
			o.ShowIconMargin = false;
			outputEditor.Document.ReadOnly = true;


			// Init toolbar
			var tb = pad.GetToolbar(Gtk.PositionType.Top);

			var ch = new Gtk.ToggleButton();
			ch.Image = new Gtk.Image(Gtk.Stock.Refresh, Gtk.IconSize.Menu);
			ch.Active = EnableCaretTracking;
			ch.TooltipText = "Toggle automatic update after the caret has been moved.";
			ch.Toggled += (object s, EventArgs ea) => EnableCaretTracking = ch.Active;
			tb.Add(ch);

			abortButton = new Gtk.Button();
			abortButton.Sensitive = false;
			abortButton.Image = new Gtk.Image(Gtk.Stock.Stop, Gtk.IconSize.Menu);
			abortButton.TooltipText = "Stops the evaluation.";
			abortButton.Clicked += (object sender, EventArgs e) => AbortExecution();
			tb.Add(abortButton);

			tb.ShowAll();
			Instance = this;
		}
开发者ID:DinrusGroup,项目名称:Mono-D,代码行数:44,代码来源:MixinInsightPad.cs

示例6: 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

示例7: GetVisualizerWidget

		public override Gtk.Widget GetVisualizerWidget (ObjectValue val)
		{
			Gdk.Pixbuf pixbuf;
			string file = Path.GetTempFileName ();
			try {
				RawValue pix = (RawValue) val.GetRawValue ();
				pix.CallMethod ("Save", file, "png");
				pixbuf = new Gdk.Pixbuf (file);
			} finally {
				File.Delete (file);
			}
			Gtk.ScrolledWindow sc = new Gtk.ScrolledWindow ();
			sc.ShadowType = Gtk.ShadowType.In;
			sc.HscrollbarPolicy = Gtk.PolicyType.Automatic;
			sc.VscrollbarPolicy = Gtk.PolicyType.Automatic;
			Gtk.Image image = new Gtk.Image (pixbuf);
			sc.AddWithViewport (image);
			sc.ShowAll ();
			return sc;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:20,代码来源:PixbufVisualizer.cs

示例8: CueSheetsView

        public CueSheetsView(CueSheetsSource ms)
        {
            MySource=ms;

            basedir=MySource.getCueSheetDir ();

            store = new CS_TrackListModel();
            view  = new CS_TrackListView(this);

            {
                ColumnController colc=view.ColumnController;
                int i,N;
                for(i=0,N=colc.Count;i<N;i++) {
                    CS_Column col=(CS_Column) colc[i];
                    col.WidthChanged+=delegate(object sender,EventArgs args) {
                        Hyena.Log.Information ("set-column-sizes="+_set_column_sizes);
                        if (_set_column_sizes<=0) {
                            _set_column_sizes=0;
                            MySource.setColumnWidth (col.id(),MySource.getSheet ().id (),col.Width);
                        } else {
                            _set_column_sizes-=1;
                        }
                    };
                }
            }

            view.SetModel(store);
            this.setColumnSizes(null);

            Hyena.Log.Information("New albumlist");
            aview=new CS_AlbumListView(this);
            aaview=new CS_ArtistListView();
            ccview=new CS_ComposerListView();
            gview=new CS_GenreListView();
            try {
            plsview=new CS_PlayListsView(this);
            } catch (System.Exception ex) {
                Hyena.Log.Error (ex.ToString ());
            }

            Hyena.Log.Information("init models");
            aview.SetModel (MySource.getAlbumModel ());
            aaview.SetModel (MySource.getArtistModel ());
            gview.SetModel (MySource.getGenreModel ());
            ccview.SetModel (MySource.getComposerModel());
            plsview.SetModel(MySource.getPlayListsModel());

            plsadmin=new CS_PlayListAdmin(plsview,MySource.getPlayListsModel(),MySource.getPlayListCollection());

            MySource.getGenreModel();
            Hyena.Log.Information("model albumlist");
            Hyena.Log.Information("albumlist initialized");

            aview.RowActivated+=new Hyena.Data.Gui.RowActivatedHandler<AlbumInfo>(EvtRowActivated);
            aview.Selection.Changed += HandleAviewSelectionChanged;
            gview.RowActivated+=new Hyena.Data.Gui.RowActivatedHandler<CS_GenreInfo>(EvtGenreActivated);
            aaview.RowActivated+=new Hyena.Data.Gui.RowActivatedHandler<ArtistInfo>(EvtArtistActivated);
            ccview.RowActivated+=new Hyena.Data.Gui.RowActivatedHandler<CS_ComposerInfo>(EvtComposerActivated);
            plsview.RowActivated+=new Hyena.Data.Gui.RowActivatedHandler<CS_PlayList>(EvtPlayListActivated);
            view.RowActivated+=new RowActivatedHandler<CueSheetEntry>(EvtTrackRowActivated);

            bar=new Gtk.Toolbar();
            if (basedir==null) {
                Hyena.Log.Information("basedir="+basedir);
                Gtk.Label lbl=new Gtk.Label();
                lbl.Markup="<b>You need to configure the CueSheets music directory first, using the right mouse button on the extension</b>";
                bar.Add (lbl);
            }
            filling=new Gtk.Label();
            bar.Add (filling);

            ascroll=new Gtk.ScrolledWindow();
            ascroll.Add (aview);
            aascroll=new Gtk.ScrolledWindow();
            aascroll.Add (aaview);
            tscroll=new Gtk.ScrolledWindow();
            tscroll.Add (view);
            gscroll=new Gtk.ScrolledWindow();
            gscroll.Add (gview);
            ccscroll=new Gtk.ScrolledWindow();
            ccscroll.Add(ccview);

            bool view_artist=true;
            Gtk.VBox vac=new Gtk.VBox();
            Gtk.Button vab=new Gtk.Button("Artists");
            vab.Clicked+=delegate(object sender,EventArgs args) {
                if (view_artist) {
                    view_artist=false;
                    vab.Label="Composers";
                    vac.Remove (aascroll);
                    vac.PackEnd (ccscroll);
                    ccscroll.ShowAll ();
                } else {
                    view_artist=true;
                    vab.Label="Artists";
                    vac.Remove (ccscroll);
                    vac.PackEnd (aascroll);
                    aascroll.ShowAll ();
                }
            };
//.........这里部分代码省略.........
开发者ID:nailyk,项目名称:banshee-community-extensions,代码行数:101,代码来源:CueSheetsView.cs

示例9: GroupChatView

        public GroupChatView(GroupChatModel groupChat)
            : base(groupChat)
        {
            Trace.Call(groupChat);

            _GroupChatModel = groupChat;

            // person list
            Participants = new List<PersonModel>();
            _OutputHPaned = new Gtk.HPaned();

            Gtk.TreeView tv = new Gtk.TreeView();
            _PersonTreeView = tv;
            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            PersonScrolledWindow = sw;
            sw.ShadowType = Gtk.ShadowType.None;
            sw.HscrollbarPolicy = Gtk.PolicyType.Never;

            //tv.CanFocus = false;
            tv.BorderWidth = 0;
            tv.Selection.Mode = Gtk.SelectionMode.Multiple;
            sw.Add(tv);

            Gtk.TreeViewColumn column;
            var cellr = new Gtk.CellRendererText() {
                Ellipsize = Pango.EllipsizeMode.End
            };
            IdentityNameCellRenderer = cellr;
            column = new Gtk.TreeViewColumn(String.Empty, cellr);
            column.SortColumnId = 0;
            column.Spacing = 0;
            column.SortIndicator = false;
            column.Expand = true;
            column.Sizing = Gtk.TreeViewColumnSizing.Autosize;
            // FIXME: this callback leaks memory
            column.SetCellDataFunc(cellr, new Gtk.TreeCellDataFunc(RenderPersonIdentityName));
            tv.AppendColumn(column);
            _IdentityNameColumn = column;

            Gtk.ListStore liststore = new Gtk.ListStore(typeof(PersonModel));
            liststore.SetSortColumnId(0, Gtk.SortType.Ascending);
            liststore.SetSortFunc(0, new Gtk.TreeIterCompareFunc(SortPersonListStore));
            _PersonListStore = liststore;

            tv.Model = liststore;
            tv.SearchColumn = 0;
            tv.SearchEqualFunc = (model, col, key, iter) => {
                var person = (PersonModel) model.GetValue(iter, col);
                // Ladies and gentlemen welcome to C
                // 0 means it matched but 0 as bool is false. So if it matches
                // we have to return false. Still not clear? true is false and
                // false is true, weirdo! If you think this is retarded,
                // yes it is.
                return !person.IdentityName.StartsWith(key, StringComparison.InvariantCultureIgnoreCase);
            };
            tv.EnableSearch = true;
            tv.HeadersVisible = false;
            tv.RowActivated += new Gtk.RowActivatedHandler(OnPersonsRowActivated);
            tv.FocusOutEvent += OnPersonTreeViewFocusOutEvent;

            // popup menu
            _PersonMenu = new Gtk.Menu();
            // don't loose the focus else we lose the selection too!
            // see OnPersonTreeViewFocusOutEvent()
            _PersonMenu.TakeFocus = false;
            _PersonMenu.Shown += OnPersonMenuShown;

            _PersonTreeView.ButtonPressEvent += _OnPersonTreeViewButtonPressEvent;
            _PersonTreeView.KeyPressEvent += OnPersonTreeViewKeyPressEvent;
            // frame needed for events when selecting something in the treeview
            _PersonTreeViewFrame = new Gtk.Frame() {
                ShadowType = Gtk.ShadowType.In
            };
            _PersonTreeViewFrame.ButtonReleaseEvent += new Gtk.ButtonReleaseEventHandler(_OnUserListButtonReleaseEvent);
            _PersonTreeViewFrame.Add(sw);

            // topic
            // don't worry, ApplyConfig() will add us to the OutputVBox!
            _OutputVBox = new Gtk.VBox() {
                Spacing = 1
            };

            _TopicTextView = new MessageTextView();
            _TopicTextView.Editable = false;
            _TopicTextView.WrapMode = Gtk.WrapMode.WordChar;
            _TopicScrolledWindow = new Gtk.ScrolledWindow();
            _TopicScrolledWindow.ShadowType = Gtk.ShadowType.In;
            _TopicScrolledWindow.HscrollbarPolicy = Gtk.PolicyType.Never;
            _TopicScrolledWindow.Add(_TopicTextView);
            // make sure the topic is invisible and remains by default and
            // visible when a topic gets set
            _TopicScrolledWindow.ShowAll();
            _TopicScrolledWindow.Visible = false;
            _TopicScrolledWindow.NoShowAll = true;
            _TopicScrolledWindow.SizeRequested += delegate(object o, Gtk.SizeRequestedArgs args) {
                // predict and set useful topic heigth
                int lineWidth, lineHeight;
                using (var layout = _TopicTextView.CreatePangoLayout("Test Topic")) {
                    layout.GetPixelSize(out lineWidth, out lineHeight);
                }
//.........这里部分代码省略.........
开发者ID:pacificIT,项目名称:smuxi,代码行数:101,代码来源:GroupChatView.cs

示例10: GroupChatView

        public GroupChatView(GroupChatModel groupChat)
            : base(groupChat)
        {
            Trace.Call(groupChat);

            _GroupChatModel = groupChat;

            // person list
            _OutputHPaned = new Gtk.HPaned();

            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            _PersonScrolledWindow = sw;
            //sw.WidthRequest = 150;
            sw.HscrollbarPolicy = Gtk.PolicyType.Never;

            Gtk.TreeView tv = new Gtk.TreeView();
            _PersonTreeView = tv;
            //tv.CanFocus = false;
            tv.BorderWidth = 0;
            tv.Selection.Mode = Gtk.SelectionMode.Multiple;
            sw.Add(tv);

            Gtk.TreeViewColumn column;
            Gtk.CellRendererText cellr = new Gtk.CellRendererText();
            cellr.WidthChars = 12;
            column = new Gtk.TreeViewColumn(String.Empty, cellr);
            column.SortColumnId = 0;
            column.Spacing = 0;
            column.SortIndicator = false;
            column.Sizing = Gtk.TreeViewColumnSizing.Autosize;
            column.SetCellDataFunc(cellr, new Gtk.TreeCellDataFunc(RenderPersonIdentityName));
            tv.AppendColumn(column);
            _IdentityNameColumn = column;

            Gtk.ListStore liststore = new Gtk.ListStore(typeof(PersonModel));
            liststore.SetSortColumnId(0, Gtk.SortType.Ascending);
            liststore.SetSortFunc(0, new Gtk.TreeIterCompareFunc(SortPersonListStore));
            _PersonListStore = liststore;

            tv.Model = liststore;
            tv.RowActivated += new Gtk.RowActivatedHandler(OnPersonsRowActivated);
            tv.FocusOutEvent += OnPersonTreeViewFocusOutEvent;

            // popup menu
            _PersonMenu = new Gtk.Menu();
            // don't loose the focus else we lose the selection too!
            // see OnPersonTreeViewFocusOutEvent()
            _PersonMenu.TakeFocus = false;
            _PersonMenu.Shown += OnPersonMenuShown;

            _PersonTreeView.ButtonPressEvent += _OnPersonTreeViewButtonPressEvent;
            _PersonTreeView.KeyPressEvent += OnPersonTreeViewKeyPressEvent;
            // frame needed for events when selecting something in the treeview
            _PersonTreeViewFrame = new Gtk.Frame();
            _PersonTreeViewFrame.ButtonReleaseEvent += new Gtk.ButtonReleaseEventHandler(_OnUserListButtonReleaseEvent);
            _PersonTreeViewFrame.Add(sw);

            // topic
            // don't worry, ApplyConfig() will add us to the OutputVBox!
            _OutputVBox = new Gtk.VBox();

            _TopicTextView = new MessageTextView();
            _TopicTextView.Editable = false;
            _TopicTextView.WrapMode = Gtk.WrapMode.WordChar;
            _TopicScrolledWindow = new Gtk.ScrolledWindow();
            _TopicScrolledWindow.ShadowType = Gtk.ShadowType.In;
            // when using PolicyType.Never, it will try to grow but never shrinks!
            _TopicScrolledWindow.HscrollbarPolicy = Gtk.PolicyType.Automatic;
            _TopicScrolledWindow.VscrollbarPolicy = Gtk.PolicyType.Automatic;
            _TopicScrolledWindow.Add(_TopicTextView);
            // make sure the topic is invisible and remains by default and
            // visible when a topic gets set
            _TopicScrolledWindow.ShowAll();
            _TopicScrolledWindow.Visible = false;
            _TopicScrolledWindow.NoShowAll = true;
            _TopicScrolledWindow.SizeRequested += delegate(object o, Gtk.SizeRequestedArgs args) {
                // predict and set useful topic heigth
                Pango.Layout layout = _TopicTextView.CreatePangoLayout("Test Topic");
                int lineWidth, lineHeigth;
                layout.GetPixelSize(out lineWidth, out lineHeigth);
                var lineSpacing = _TopicTextView.PixelsAboveLines +
                                  _TopicTextView.PixelsBelowLines;
                var text = Topic != null ? Topic.ToString() : String.Empty;
                // hardcoded to 2 lines for now
                var newLines = text.Length > 0 ? 2 : 0;
                var bestSize = new Gtk.Requisition() {
                    Height = ((lineHeigth + lineSpacing) * newLines) + 2
                };
                args.Requisition = bestSize;
            };

            Add(_OutputHPaned);

            //ApplyConfig(Frontend.UserConfig);

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

示例11: GroupChatView

        public GroupChatView(GroupChatModel groupChat)
            : base(groupChat)
        {
            Trace.Call(groupChat);

            _GroupChatModel = groupChat;

            // person list
            _OutputHPaned = new Gtk.HPaned();

            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            _PersonScrolledWindow = sw;
            //sw.WidthRequest = 150;
            sw.HscrollbarPolicy = Gtk.PolicyType.Never;

            Gtk.TreeView tv = new Gtk.TreeView();
            _PersonTreeView = tv;
            //tv.CanFocus = false;
            tv.BorderWidth = 0;
            tv.Selection.Mode = Gtk.SelectionMode.Multiple;
            sw.Add(tv);

            Gtk.TreeViewColumn column;
            Gtk.CellRendererText cellr = new Gtk.CellRendererText();
            cellr.WidthChars = 12;
            column = new Gtk.TreeViewColumn(String.Empty, cellr);
            column.SortColumnId = 0;
            column.Spacing = 0;
            column.SortIndicator = false;
            column.Sizing = Gtk.TreeViewColumnSizing.Autosize;
            column.SetCellDataFunc(cellr, new Gtk.TreeCellDataFunc(RenderPersonIdentityName));
            tv.AppendColumn(column);
            _IdentityNameColumn = column;

            Gtk.ListStore liststore = new Gtk.ListStore(typeof(PersonModel));
            liststore.SetSortColumnId(0, Gtk.SortType.Ascending);
            liststore.SetSortFunc(0, new Gtk.TreeIterCompareFunc(SortPersonListStore));
            _PersonListStore = liststore;

            tv.Model = liststore;
            tv.RowActivated += new Gtk.RowActivatedHandler(OnPersonsRowActivated);
            tv.FocusOutEvent += OnPersonTreeViewFocusOutEvent;

            // popup menu
            _PersonMenu = new Gtk.Menu();
            // don't loose the focus else we lose the selection too!
            // see OnPersonTreeViewFocusOutEvent()
            _PersonMenu.TakeFocus = false;
            _PersonMenu.Shown += OnPersonMenuShown;

            _PersonTreeView.ButtonPressEvent += _OnPersonTreeViewButtonPressEvent;
            _PersonTreeView.KeyPressEvent += OnPersonTreeViewKeyPressEvent;
            // frame needed for events when selecting something in the treeview
            _PersonTreeViewFrame = new Gtk.Frame();
            _PersonTreeViewFrame.ButtonReleaseEvent += new Gtk.ButtonReleaseEventHandler(_OnUserListButtonReleaseEvent);
            _PersonTreeViewFrame.Add(sw);

            // topic
            // don't worry, ApplyConfig() will add us to the OutputVBox!
            _OutputVBox = new Gtk.VBox();

            _TopicTextView = new MessageTextView();
            _TopicTextView.Editable = false;
            _TopicTextView.WrapMode = Gtk.WrapMode.WordChar;
            _TopicScrolledWindow = new Gtk.ScrolledWindow();
            _TopicScrolledWindow.ShadowType = Gtk.ShadowType.In;
            // when using PolicyType.Never, it will try to grow but never shrinks!
            _TopicScrolledWindow.HscrollbarPolicy = Gtk.PolicyType.Automatic;
            _TopicScrolledWindow.VscrollbarPolicy = Gtk.PolicyType.Automatic;
            _TopicScrolledWindow.Add(_TopicTextView);
            // make sure the topic is invisible and remains by default and
            // visible when a topic gets set
            _TopicScrolledWindow.ShowAll();
            _TopicScrolledWindow.Visible = false;
            _TopicScrolledWindow.NoShowAll = true;

            Add(_OutputHPaned);

            //ApplyConfig(Frontend.UserConfig);

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

示例12: typeof

        Gtk.Widget IOutlinedDocument.GetOutlineWidget()
        {
            if (outlineTreeView != null)
                return outlineTreeView;

            outlineTreeStore = new Gtk.TreeStore (typeof(string), typeof (Gdk.Color), typeof (Mono.TextTemplating.ISegment));
            outlineTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView (outlineTreeStore);
            outlineTreeView.Realized += delegate { RefillOutlineStore (); };

            outlineTreeView.TextRenderer.Xpad = 0;
            outlineTreeView.TextRenderer.Ypad = 0;
            outlineTreeView.AppendColumn ("Node", outlineTreeView.TextRenderer, "text", 0, "foreground-gdk", 1);

            outlineTreeView.HeadersVisible = false;

            outlineTreeView.Selection.Changed += delegate {
                Gtk.TreeIter iter;
                if (!outlineTreeView.Selection.GetSelected (out iter))
                    return;
                SelectSegment ((Mono.TextTemplating.ISegment )outlineTreeStore.GetValue (iter, 2));
            };

            RefillOutlineStore ();

            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow ();
            sw.Add (outlineTreeView);
            sw.ShowAll ();
            return sw;
        }
开发者ID:olivierdagenais,项目名称:softwareninjas,代码行数:29,代码来源:T4EditorExtension.cs


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