本文整理汇总了C#中Gtk.ScrolledWindow.AddWithViewport方法的典型用法代码示例。如果您正苦于以下问题:C# ScrolledWindow.AddWithViewport方法的具体用法?C# ScrolledWindow.AddWithViewport怎么用?C# ScrolledWindow.AddWithViewport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.ScrolledWindow
的用法示例。
在下文中一共展示了ScrolledWindow.AddWithViewport方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Library
// creates the library user interface
public Library()
{
// create widgets
ScrolledWindow library_scroll = new ScrolledWindow ();
VBox library_box = new VBox (false, 0);
// pack widgets
library_box.PackStart (dynamic_tree, false, false, 0);
library_box.PackStart (new HSeparator (), false, false, 0);
library_box.PackStart (folder_tree, false, false, 0);
library_box.PackStart (new HSeparator (), false, false, 0);
library_box.PackStart (playlist_tree, true, true, 0);
library_scroll.AddWithViewport (library_box);
library_scroll.ShadowType = ShadowType.In;
media_scroll.Add (media_tree);
media_scroll.ShadowType = ShadowType.In;
media_box.PackStart (media_scroll, true, true, 0);
// cover art box
VBox image_box = new VBox (false, 0);
image_box.PackStart (library_scroll, true, true, 0);
image_box.PackStart (cover_art, false, false, 0);
info_box.PackStart (media_box, true, true, 0);
info_box.PackStart (info_bar, false, false, 0);
info_splitter.Pack1 (info_box, true, true);
main_splitter.Add1 (image_box);
main_splitter.Add2 (info_splitter);
}
示例2: initGui
private void initGui()
{
//create the layout
VBox layout = new VBox();
//add the treeview
ScrolledWindow swTree = new ScrolledWindow();
swTree.AddWithViewport( tree );
layout.PackStart( swTree );
//add the add/edit/remove buttons
HBox hbox = new HBox();
hbox.PackStart ( BtnAddNode );
hbox.PackStart ( BtnEditNode );
hbox.PackStart ( BtnRemoveNode );
layout.PackStart( hbox, false, true, 0 );
//add the checkboxes
hbox = new HBox();
hbox.PackStart ( ChkNodeIconVisible );
hbox.PackStart ( ChkCheckBoxTree );
hbox.PackStart ( ChkEditableTree );
hbox.PackStart ( ChkOwnerDrawn );
hbox.PackStart ( ChkDragAndDrop );
layout.PackStart( hbox, false, true, 0 );
//add layout
this.Add( layout );
}
示例3: GetWidget
private Widget GetWidget (CustomAttributeCollection cac)
{
FontDescription fd = FontDescription.FromString ("Courier 10 Pitch 10");
VBox vbox = new VBox (false, 0);
ScrolledWindow sw = new ScrolledWindow ();
sw.AddWithViewport (vbox);
if ((cac != null) && (cac.Count > 0)) {
foreach (CustomAttribute ca in cac) {
TextView textview = new TextView ();
textview.Editable = false;
textview.Buffer.Text = Format (ca);
textview.ModifyFont (fd);
Expander expander = new Expander (ca.Constructor.DeclaringType.FullName);
expander.Add (textview);
vbox.Add (expander);
}
}
sw.ShowAll ();
return sw;
}
示例4: Main
static void Main (string [] args)
{
Application.Init ();
if (args.Length <= 0) {
Console.WriteLine ("\nUSAGE: ImageBrowser.exe <directory>\n");
return;
}
string dir = args [0];
Gtk.Window window = new Gtk.Window ("Image Browser");
Gtk.ScrolledWindow scroll = new Gtk.ScrolledWindow (new Adjustment (IntPtr.Zero), new Adjustment (IntPtr.Zero));
ArrayList images = GetItemsFromDirectory (dir);
Gtk.Table table = PopulateTable (images);
window.Title = String.Format ("{0}: {1} ({2} images)", window.Title, dir, images.Count);
window.SetDefaultSize (300, 200);
window.DeleteEvent += Window_Delete;
scroll.AddWithViewport (table);
scroll.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
window.Add (scroll);
window.ShowAll ();
Application.Run ();
}
示例5: News
// create the main news widget
public News(MainPage parent)
{
this.parent = parent;
news_viewer = new NewsViewer (parent);
// setting up the news feed tree
news_tree.Model = news_store;
news_tree.AppendColumn (null, new CellRendererText (), new TreeCellDataFunc (renderNews));
news_tree.HeadersVisible = false;
news_tree.RowSeparatorFunc = new TreeViewRowSeparatorFunc (row_separator);
// box packing
ScrolledWindow news_scroll = new ScrolledWindow ();
ScrolledWindow html_scroll = new ScrolledWindow ();
news_scroll.Add (news_tree);
html_scroll.AddWithViewport (news_viewer.HTML);
news_scroll.ShadowType = ShadowType.In;
html_scroll.ShadowType = ShadowType.In;
main_splitter.Add1 (news_scroll);
main_splitter.Add2 (html_scroll);
// events
news_tree.Selection.Changed += news_selected;
news_tree.ButtonReleaseEvent += feed_tree_button_release;
}
示例6: AddNodeDialog
public AddNodeDialog(SimulatorInterface simulatorInterface)
{
this.Build ();
this.simulatorInterface = simulatorInterface;
ScrolledWindow sw = new ScrolledWindow ();
sw.ShadowType = ShadowType.EtchedIn;
sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
sw.HeightRequest = 250;
VBox.PackStart (sw, true, true, 0);
Table table = new Table ((uint)(BasicNode.NodeLabels.Length), 2, true);
sw.AddWithViewport (table);
for (int i = 0; i < BasicNode.NodeLabels.Length; i++)
{
labels.Add (new Label (BasicNode.NodeLabels[i]));
table.Attach (labels[i], 0, 1, (uint)(i), (uint)(i) + 1);
entries.Add (new SpinButton (0, 80, 1));
entries[i].ClimbRate = 1;
entries[i].Numeric = true;
table.Attach (entries[i], 1, 2, (uint)(i), (uint)(i) + 1);
}
buttonOk.Clicked += new EventHandler (AddNode);
buttonCancel.Clicked += new EventHandler (Cancel);
this.SetDefaultSize (340, 300);
this.Modal = true;
this.ShowAll ();
}
示例7: initGui
private void initGui()
{
//create the layout
VBox layout = new VBox();
//add the list
ScrolledWindow sw = new ScrolledWindow();
sw.AddWithViewport( list );
layout.PackStart ( sw );
//add the add/edit/remove buttons
HBox hbox = new HBox();
hbox.PackStart ( BtnAdd );
hbox.PackStart ( BtnEdit );
hbox.PackStart ( BtnRemove );
hbox.PackStart ( BtnSort );
layout.PackStart( hbox, false, true, 0 );
//add the checkboxes
hbox = new HBox();
hbox.PackStart( ChkOwnerDrawned , true, true, 0 );
hbox.PackStart( ChkIsCheckBoxList, true, true, 0 );
hbox.PackStart( ChkIsEditable , true, true, 0 );
hbox.PackStart( ChkDragAndDrop , true, true, 0 );
//
layout.PackStart( hbox, false, true, 0 );
//add layout
this.Add( layout );
}
示例8: FolderView
public FolderView(ViewBase owner)
: base(owner)
{
scroller = new ScrolledWindow();
scroller.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
table = new Table(1, 1, false);
scroller.AddWithViewport(table);
_mainWidget = scroller;
}
示例9: GetWidget
public Widget GetWidget (MethodDefinition method)
{
Digraph digraph = GetIlSourceAsDot (method);
Image image = new Image (DotHelper.BuildDotImage (digraph));
ScrolledWindow sw = new ScrolledWindow ();
sw.AddWithViewport (image);
sw.ShowAll ();
return sw;
}
示例10: CreateWidget
protected override Widget CreateWidget(WindowContext context)
{
if(Child == null)
throw new Exception("Scrolled musí obsahovat widget");
ScrolledWindow sw = new ScrolledWindow();
Widget child = Child.Build(context);
if(IsNativelyScrolled(child.GetType()))
sw.Add(child);
else
sw.AddWithViewport(child);
return sw;
}
示例11: WelcomePageView
public WelcomePageView () : base ()
{
this.ContentName = GettextCatalog.GetString ("Welcome");
this.IsViewOnly = true;
scroller = new ScrolledWindow ();
widget = new WelcomePageWidget ();
scroller.AddWithViewport (widget);
scroller.ShadowType = ShadowType.None;
scroller.FocusChain = new Widget[] { widget };
scroller.Show ();
}
示例12: GetWidget
public Widget GetWidget (MethodDefinition method)
{
BackwardAnalysis (">", null, method);
Digraph digraph = BuildDotFile (method);
Image image = new Image (DotHelper.BuildDotImage (digraph));
ScrolledWindow sw = new ScrolledWindow ();
sw.AddWithViewport (image);
sw.ShowAll ();
Clear ();
return sw;
}
示例13: TextVisualizerView
public TextVisualizerView ()
{
vbox = new VBox (false, 6);
vbox.BorderWidth = 6;
TextTagTable tagTable = new TextTagTable ();
TextBuffer buffer = new TextBuffer (tagTable);
textView = new TextView (buffer);
scrolledWindow = new ScrolledWindow ();
scrolledWindow.AddWithViewport (textView);
vbox.PackStart (scrolledWindow, true, true, 0);
vbox.ShowAll ();
}
示例14: Browser
public Browser(string catalog_dir)
: base("Documentation Browser Sample")
{
DefaultSize = new Size (600, 400);
Gtk.Paned paned = new Gtk.HPaned ();
Gtk.ScrolledWindow sw = new ScrolledWindow ();
DocTree tree = new DocTree (catalog_dir);
sw.Add (tree);
paned.Add1 (sw);
sw = new ScrolledWindow ();
DocView view = new DocView (tree);
sw.AddWithViewport (view);
paned.Add2 (sw);
paned.Position = 250;
paned.ShowAll ();
Add (paned);
}
示例15: WarningWindow
// creates the exception window
public WarningWindow(Window transient, StatusBar status)
: base(transient, "Error Log")
{
this.status = status;
tree.Model = status.ErrorLog;
tree.HeadersVisible = false;
tree.AppendColumn (null, new CellRendererText (), new TreeCellDataFunc (render_error));
message.Selectable = true;
message.Xalign = 0;
message.Yalign = 0;
message.WidthChars = -1;
Label tree_title = new Label ();
Label message_title = new Label ();
tree_title.Xalign = 0;
tree_title.Markup = "<b>Error Log:</b>";
message_title.Xalign = 0;
message_title.Markup = "<b>Error Message:</b>";
VBox box = new VBox (false, 0);
Button remove_button = new Button (Stock.Remove);
ScrolledWindow tree_scroll = new ScrolledWindow ();
ScrolledWindow message_scroll = new ScrolledWindow ();
tree_scroll.Add (tree);
message_scroll.AddWithViewport (message);
tree_scroll.ShadowType = ShadowType.In;
message_scroll.ShadowType = ShadowType.In;
tree.Selection.Changed += tree_selected;
remove_button.Clicked += remove_clicked;
box.PackStart (tree_title, false, false, 5);
box.PackStart (tree_scroll, false, false, 0);
box.PackStart (message_title, false, false, 5);
box.PackStart (message_scroll, true, true, 0);
box.PackStart (remove_button, false, true, 5);
box.BorderWidth = 5;
this.Resize (600, 400);
this.Add (box);
}