本文整理汇总了C#中Gtk.ScrolledWindow.SetPolicy方法的典型用法代码示例。如果您正苦于以下问题:C# ScrolledWindow.SetPolicy方法的具体用法?C# ScrolledWindow.SetPolicy怎么用?C# ScrolledWindow.SetPolicy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.ScrolledWindow
的用法示例。
在下文中一共展示了ScrolledWindow.SetPolicy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DemoApplicationWindow
public DemoApplicationWindow () : base ("Application Window")
{
SetDefaultSize (200, 200);
vbox = new VBox (false, 0);
Add (vbox);
AddActions ();
statusbar = new Statusbar ();
UpdateStatus ();
vbox.PackEnd (statusbar, false, false, 0);
ScrolledWindow sw = new ScrolledWindow ();
sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
sw.ShadowType = ShadowType.In;
vbox.PackEnd (sw, true, true, 0);
TextView textview = new TextView ();
textview.Buffer.MarkSet += new MarkSetHandler (MarkSet);
sw.Add (textview);
textview.GrabFocus ();
ShowAll ();
}
示例2: DemoTreeStore
public DemoTreeStore () : base ("Card planning sheet")
{
VBox vbox = new VBox (false, 8);
vbox.BorderWidth = 8;
Add (vbox);
vbox.PackStart (new Label ("Jonathan's Holiday Card Planning Sheet"),
false, false, 0);
ScrolledWindow sw = new ScrolledWindow ();
sw.ShadowType = ShadowType.EtchedIn;
sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
vbox.PackStart (sw, true, true, 0);
// create model
CreateModel ();
// create tree view
TreeView treeView = new TreeView (store);
treeView.RulesHint = true;
treeView.Selection.Mode = SelectionMode.Multiple;
AddColumns (treeView);
sw.Add (treeView);
// expand all rows after the treeview widget has been realized
treeView.Realized += new EventHandler (ExpandRows);
SetDefaultSize (650, 400);
ShowAll ();
}
示例3: DemoListStore
public DemoListStore () : base ("ListStore Demo")
{
BorderWidth = 8;
VBox vbox = new VBox (false, 8);
Add (vbox);
Label label = new Label ("This is the bug list (note: not based on real data, it would be nice to have a nice ODBC interface to bugzilla or so, though).");
vbox.PackStart (label, false, false, 0);
ScrolledWindow sw = new ScrolledWindow ();
sw.ShadowType = ShadowType.EtchedIn;
sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
vbox.PackStart (sw, true, true, 0);
// create model
store = CreateModel ();
// create tree view
TreeView treeView = new TreeView (store);
treeView.RulesHint = true;
treeView.SearchColumn = (int) Column.Description;
sw.Add (treeView);
AddColumns (treeView);
// finish & show
SetDefaultSize (280, 250);
ShowAll ();
}
示例4: 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 ();
}
示例5: 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 ();
}
示例6: CreateText
private ScrolledWindow CreateText(TextBuffer buffer, bool IsSource)
{
ScrolledWindow scrolledWindow = new ScrolledWindow ();
scrolledWindow.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
scrolledWindow.ShadowType = ShadowType.In;
TextView textView = new TextView (buffer);
textView.Editable = false;
textView.CursorVisible = false;
scrolledWindow.Add (textView);
if (IsSource) {
FontDescription fontDescription = FontDescription.FromString ("monospace");
textView.OverrideFont (fontDescription);
textView.WrapMode = Gtk.WrapMode.None;
} else {
// Make it a bit nicer for text
textView.WrapMode = Gtk.WrapMode.Word;
textView.PixelsAboveLines = 2;
textView.PixelsBelowLines = 2;
}
return scrolledWindow;
}
示例7: DemoTextView
public DemoTextView () : base ("TextView")
{
SetDefaultSize (450,450);
BorderWidth = 0;
VPaned vpaned = new VPaned ();
vpaned.BorderWidth = 5;
Add (vpaned);
// For convenience, we just use the autocreated buffer from
// the first text view; you could also create the buffer
// by itself, then later create a view widget.
view1 = new TextView ();
TextBuffer buffer = view1.Buffer;
view2 = new TextView (buffer);
ScrolledWindow sw = new ScrolledWindow ();
sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
vpaned.Add1 (sw);
sw.Add (view1);
sw = new ScrolledWindow ();
sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
vpaned.Add2 (sw);
sw.Add (view2);
CreateTags (buffer);
InsertText (buffer);
AttachWidgets (view1);
AttachWidgets (view2);
ShowAll ();
}
示例8: DemoStockBrowser
public DemoStockBrowser () : base ("Stock Icons and Items")
{
SetDefaultSize (-1, 500);
BorderWidth = 8;
HBox hbox = new HBox (false, 8);
Add (hbox);
ScrolledWindow sw = new ScrolledWindow ();
sw.SetPolicy (PolicyType.Never, PolicyType.Automatic);
hbox.PackStart (sw, false, false, 0);
ListStore model = CreateModel ();
TreeView treeview = new TreeView (model);
sw.Add (treeview);
TreeViewColumn column = new TreeViewColumn ();
column.Title = "Name";
CellRenderer renderer = new CellRendererPixbuf ();
column.PackStart (renderer, false);
column.SetAttributes (renderer, "stock_id", Column.Id);
renderer = new CellRendererText ();
column.PackStart (renderer, true);
column.SetAttributes (renderer, "text", Column.Name);
treeview.AppendColumn (column);
treeview.AppendColumn ("Label", new CellRendererText (), "text", Column.Label);
treeview.AppendColumn ("Accel", new CellRendererText (), "text", Column.Accel);
treeview.AppendColumn ("ID", new CellRendererText (), "text", Column.Id);
Alignment align = new Alignment (0.5f, 0.0f, 0.0f, 0.0f);
hbox.PackEnd (align, false, false, 0);
Frame frame = new Frame ("Selected Item");
align.Add (frame);
VBox vbox = new VBox (false, 8);
vbox.BorderWidth = 8;
frame.Add (vbox);
typeLabel = new Label ();
vbox.PackStart (typeLabel, false, false, 0);
iconImage = new Gtk.Image ();
vbox.PackStart (iconImage, false, false, 0);
accelLabel = new Label ();
vbox.PackStart (accelLabel, false, false, 0);
nameLabel = new Label ();
vbox.PackStart (nameLabel, false, false, 0);
idLabel = new Label ();
vbox.PackStart (idLabel, false, false, 0);
treeview.Selection.Mode = Gtk.SelectionMode.Single;
treeview.Selection.Changed += new EventHandler (SelectionChanged);
ShowAll ();
}
示例9: 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;
}
示例10: DemoIconView
public DemoIconView () : base ("Gtk.IconView demo")
{
SetDefaultSize (650, 400);
DeleteEvent += new DeleteEventHandler (OnWinDelete);
VBox vbox = new VBox (false, 0);
Add (vbox);
Toolbar toolbar = new Toolbar ();
vbox.PackStart (toolbar, false, false, 0);
upButton = new ToolButton (Stock.GoUp);
upButton.IsImportant = true;
upButton.Sensitive = false;
toolbar.Insert (upButton, -1);
ToolButton homeButton = new ToolButton (Stock.Home);
homeButton.IsImportant = true;
toolbar.Insert (homeButton, -1);
fileIcon = GetIcon (Stock.File);
dirIcon = GetIcon (Stock.Open);
ScrolledWindow sw = new ScrolledWindow ();
sw.ShadowType = ShadowType.EtchedIn;
sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
vbox.PackStart (sw, true, true, 0);
// Create the store and fill it with the contents of '/'
store = CreateStore ();
FillStore ();
IconView iconView = new IconView (store);
iconView.SelectionMode = SelectionMode.Multiple;
upButton.Clicked += new EventHandler (OnUpClicked);
homeButton.Clicked += new EventHandler (OnHomeClicked);
iconView.TextColumn = COL_DISPLAY_NAME;
iconView.PixbufColumn = COL_PIXBUF;
iconView.ItemActivated += new ItemActivatedHandler (OnItemActivated);
sw.Add (iconView);
iconView.GrabFocus ();
ShowAll ();
}
示例11: MainWindow
public MainWindow(InvoiceDirectory idir_)
: base(WindowType.Toplevel)
{
idir = idir_;
SetSizeRequest(500, 500);
Title = "Fakturering 2.6";
maingroup = new HBox(false, 0);
buttons = new VButtonBox();
scrolledhd = new ScrolledWindow();
create = Button.NewWithLabel("Skapa ny faktura");
edit = Button.NewWithLabel("Redigera faktura");
delete = Button.NewWithLabel("Radera faktura");
showbut = Button.NewWithLabel("Visa faktura");
printbut = Button.NewWithLabel("Skriv ut faktura");
CreateListView();
Add(maingroup);
maingroup.PackStart(scrolledhd, true, true, 0);
maingroup.PackStart(buttons, false, false, 0);
buttons.Layout = ButtonBoxStyle.Start;
buttons.PackStart(create, false, false, 0);
buttons.PackStart(edit, false, false, 0);
buttons.PackStart(showbut, false, false, 0);
buttons.PackStart(printbut, false, false, 0);
buttons.PackStart(delete, false, false, 0);
scrolledhd.AddWithViewport(listview);
scrolledhd.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
UpdateHDList();
create.Clicked += new EventHandler(Create);
edit.Clicked += new EventHandler(Edit);
delete.Clicked += new EventHandler(DeleteInvoice);
showbut.Clicked += new EventHandler(ShowInvoice);
printbut.Clicked += new EventHandler(PrintInvoice);
maingroup.ShowAll();
//Den här måste vara här då storleken inte är känd innan
ScrollToEnd(scrolledhd);
DeleteEvent += new Gtk.DeleteEventHandler(DeleteWindow);
}
示例12: ConsoleLog
public ConsoleLog(Settings set)
{
settings = set;
textView = new TextView();
textView.Editable = false;
textView.CursorVisible = false;
scroller = new ScrolledWindow();
scroller.SetPolicy(PolicyType.Automatic, PolicyType.Always);
scroller.Add(textView);
InitTags();
settings.RefreshFont += OnRefreshFont;
OnRefreshFont(this, null);
}
示例13: DemoEditableCells
public DemoEditableCells () : base ("Shopping list")
{
SetDefaultSize (320, 200);
BorderWidth = 5;
VBox vbox = new VBox (false, 5);
Add (vbox);
vbox.PackStart (new Label ("Shopping list (you can edit the cells!)"), false, false, 0);
ScrolledWindow scrolledWindow = new ScrolledWindow ();
scrolledWindow.ShadowType = ShadowType.EtchedIn;
scrolledWindow.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
vbox.PackStart (scrolledWindow, true, true, 0);
// create model
store = CreateModel ();
// create tree view
treeView = new TreeView (store);
treeView.RulesHint = true;
treeView.Selection.Mode = SelectionMode.Single;
AddColumns ();
scrolledWindow.Add (treeView);
// some buttons
HBox hbox = new HBox (true, 4);
vbox.PackStart (hbox, false, false, 0);
Button button = new Button ("Add item");
button.Clicked += new EventHandler (AddItem);
hbox.PackStart (button, true, true, 0);
button = new Button ("Remove item");
button.Clicked += new EventHandler (RemoveItem);
hbox.PackStart (button, true, true, 0);
ShowAll ();
}
示例14: DemoHyperText
public DemoHyperText () : base ("HyperText")
{
handCursor = new Gdk.Cursor (Gdk.CursorType.Hand2);
regularCursor = new Gdk.Cursor (Gdk.CursorType.Xterm);
SetDefaultSize (450, 450);
TextView view = new TextView ();
view.WrapMode = WrapMode.Word;
view.KeyPressEvent += new KeyPressEventHandler (KeyPress);
view.WidgetEventAfter += new WidgetEventAfterHandler (EventAfter);
view.MotionNotifyEvent += new MotionNotifyEventHandler (MotionNotify);
view.VisibilityNotifyEvent += new VisibilityNotifyEventHandler (VisibilityNotify);
ScrolledWindow sw = new ScrolledWindow ();
sw.SetPolicy (Gtk.PolicyType.Automatic, Gtk.PolicyType.Automatic);
Add (sw);
sw.Add (view);
ShowPage (view.Buffer, 1);
ShowAll ();
}
示例15: MainWindow_Pango
public MainWindow_Pango()
: base("pango + unicode + font")
{
SetPosition(WindowPosition.Center);
DeleteEvent += delegate
{
Application.Quit();
};
ScrolledWindow sw = new ScrolledWindow();
sw.ShadowType = ShadowType.EtchedIn;
sw.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
Context context = this.CreatePangoContext();
_fonts = context.Families;
_store = CreateModel();
TreeView view = new TreeView();
view.RulesHint = true;
sw.Add(view);
CreateColumn(view);
string text = @"하늘과 바람과 별과 시 - 윤동주\n1821 года в Москве.Был вторым из 7 детей. Отец, Михаил Андреевич";
_label = new Label(text);
Pango.FontDescription fontDesc = Pango.FontDescription.FromString("SignPainter 20");
_label.ModifyFont(fontDesc);
Fixed fix = new Fixed();
fix.Put(_label, 5, 5);
Add(fix);
//Add(sw);
ShowAll();
}