本文整理汇总了C#中Gtk.ScrolledWindow.SetSizeRequest方法的典型用法代码示例。如果您正苦于以下问题:C# ScrolledWindow.SetSizeRequest方法的具体用法?C# ScrolledWindow.SetSizeRequest怎么用?C# ScrolledWindow.SetSizeRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.ScrolledWindow
的用法示例。
在下文中一共展示了ScrolledWindow.SetSizeRequest方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainWindow
public MainWindow()
: base(Gtk.WindowType.Toplevel)
{
var webView = new WebKit.WebView();
var scrolled = new ScrolledWindow();
var v = new VPaned();
scrolled.Add(webView);
v.Pack1(scrolled, true, true);
scrolled.SetSizeRequest(-1, 50);
var button = new Button("foo");
v.Pack2(button, true, true);
this.Add(v);
this.ShowAll();
webView.LoadString("<p>foo</p>", "text/html", "utf-8", null);
// This won't show up until we've returned from the constructor
// so let's do something easy that can happen after the window shows
button.Clicked += (object sender, EventArgs e) => {
var document = webView.DomDocument;
var first = document.FirstChild;
var body = document.GetElementsByTagName("body").Item(0);
var para = document.CreateElement("p");
para.AppendChild(document.CreateTextNode("this is some text"));
body.AppendChild(para);
};
}
示例2: ClockThemeSelector
public ClockThemeSelector (ClockDockItem dockItem)
{
DockItem = dockItem;
SkipTaskbarHint = true;
TypeHint = Gdk.WindowTypeHint.Dialog;
WindowPosition = Gtk.WindowPosition.Center;
KeepAbove = true;
Stick ();
Title = Catalog.GetString ("Themes");
IconName = Gtk.Stock.Preferences;
AddButton (Stock.Close, ResponseType.Close);
labelTreeView.Model = labelTreeStore;
labelTreeView.HeadersVisible = false;
labelTreeView.Selection.Changed += OnLabelSelectionChanged;
labelTreeView.AppendColumn (Catalog.GetString ("Theme"), new CellRendererText (), "text", 0);
ScrolledWindow win = new ScrolledWindow ();
win.Add (labelTreeView);
win.SetSizeRequest (200, 300);
win.Show ();
VBox.PackEnd (win);
VBox.ShowAll ();
UpdateThemeList ();
}
示例3: VersionInformationDialog
public VersionInformationDialog() : base()
{
AccelGroup accel_group = new AccelGroup();
AddAccelGroup(accel_group);
Modal = true;
Button button = new Button("gtk-close");
button.CanDefault = true;
button.UseStock = true;
button.Show();
DefaultResponse = ResponseType.Close;
button.AddAccelerator("activate", accel_group, (uint)Gdk.Key.Escape,
0, Gtk.AccelFlags.Visible);
AddActionWidget(button, ResponseType.Close);
Title = Catalog.GetString("Assembly Version Information");
BorderWidth = 10;
version_tree = new TreeView();
version_tree.RulesHint = true;
version_tree.AppendColumn(Catalog.GetString("Assembly Name"),
new CellRendererText(), "text", 0);
version_tree.AppendColumn(Catalog.GetString("Version"),
new CellRendererText(), "text", 1);
version_tree.Model = FillStore();
version_tree.CursorChanged += OnCursorChanged;
ScrolledWindow scroll = new ScrolledWindow();
scroll.Add(version_tree);
scroll.ShadowType = ShadowType.In;
scroll.SetSizeRequest(420, 200);
VBox.PackStart(scroll, true, true, 0);
VBox.Spacing = 5;
path_label = new Label();
path_label.Ellipsize = Pango.EllipsizeMode.End;
path_label.Hide();
path_label.Xalign = 0.0f;
path_label.Yalign = 1.0f;
VBox.PackStart(path_label, false, true, 0);
scroll.ShowAll();
}
示例4: SourceTreeViewController
public SourceTreeViewController(FilteredTrackListViewController filteredTrackListViewController, Collection collection)
{
_filteredTrackListViewController = filteredTrackListViewController;
_sourceTreeView = new SourceTreeView();
_sourceTreeView.Model = CreateSourceTreeStore(collection);
SourceTreeViewColumn sourceColumn = new SourceTreeViewColumn();
SourceCellRenderer sourceCellRenderer = new SourceCellRenderer();
sourceColumn.PackStart(sourceCellRenderer, true);
sourceColumn.SetCellDataFunc(sourceCellRenderer,
(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) =>
{
SourceTreeStoreValue value = (SourceTreeStoreValue)model.GetValue(iter, 0);
((CellRendererText)cell).Text = value.DisplayString;
});
_sourceTreeView.AppendColumn(sourceColumn);
_sourceTreeView.Selection.Changed += SelectionOnChanged;
View = new ScrolledWindow {_sourceTreeView};
View.SetSizeRequest(200, -1);
}
示例5: AddHelpPage
private void AddHelpPage (Notebook notebook, string title, string text)
{
VBox box = new VBox ();
TextView tv = new TextView ();
tv.Editable = false;
tv.CursorVisible = false;
TextBuffer tb = new TextBuffer (new TextTagTable ());
tb.Text = AddinManager.CurrentLocalizer.GetString (text);
tv.Buffer = tb;
tv.WrapMode = WrapMode.Word;
ScrolledWindow sw = new ScrolledWindow ();
sw.AddWithViewport (tv);
sw.SetSizeRequest (520, 380);
box.PackStart (sw, true, true, 5);
notebook.AppendPage (box, new Label (AddinManager.CurrentLocalizer.GetString (title)));
}
示例6: SyncDialog
// TODO: Possible to make Tomboy not crash if quit while dialog is up?
public SyncDialog ()
: base (string.Empty,
null,
Gtk.DialogFlags.DestroyWithParent)
{
progressBarTimeoutId = 0;
SetSizeRequest (400, -1);
HasSeparator = false;
// Outer box. Surrounds all of our content.
VBox outerVBox = new VBox (false, 12);
outerVBox.BorderWidth = 6;
outerVBox.Show ();
VBox.PackStart (outerVBox, true, true, 0);
// Top image and label
HBox hbox = new HBox (false, 12);
hbox.Show ();
outerVBox.PackStart (hbox, false, false, 0);
image = new Image (GuiUtils.GetIcon ("tomboy", 48));
image.Xalign = 0;
image.Yalign = 0;
image.Show ();
hbox.PackStart (image, false, false, 0);
// Label header and message
VBox vbox = new VBox (false, 6);
vbox.Show ();
hbox.PackStart (vbox, true, true, 0);
headerLabel = new Label ();
headerLabel.UseMarkup = true;
headerLabel.Xalign = 0;
headerLabel.UseUnderline = false;
headerLabel.LineWrap = true;
headerLabel.Show ();
vbox.PackStart (headerLabel, false, false, 0);
messageLabel = new Label ();
messageLabel.Xalign = 0;
messageLabel.UseUnderline = false;
messageLabel.LineWrap = true;
messageLabel.SetSizeRequest (250, -1);
messageLabel.Show ();
vbox.PackStart (messageLabel, false, false, 0);
progressBar = new Gtk.ProgressBar ();
progressBar.Orientation = Gtk.ProgressBarOrientation.LeftToRight;
progressBar.BarStyle = ProgressBarStyle.Continuous;
progressBar.ActivityBlocks = 30;
progressBar.Show ();
outerVBox.PackStart (progressBar, false, false, 0);
progressLabel = new Label ();
progressLabel.UseMarkup = true;
progressLabel.Xalign = 0;
progressLabel.UseUnderline = false;
progressLabel.LineWrap = true;
progressLabel.Wrap = true;
progressLabel.Show ();
outerVBox.PackStart (progressLabel, false, false, 0);
// Expander containing TreeView
expander = new Gtk.Expander (Catalog.GetString ("Details"));
expander.Spacing = 6;
expander.Activated += OnExpanderActivated;
expander.Show ();
outerVBox.PackStart (expander, true, true, 0);
// Contents of expander
Gtk.VBox expandVBox = new Gtk.VBox ();
expandVBox.Show ();
expander.Add (expandVBox);
// Scrolled window around TreeView
Gtk.ScrolledWindow scrolledWindow = new Gtk.ScrolledWindow ();
scrolledWindow.ShadowType = Gtk.ShadowType.In;
scrolledWindow.SetSizeRequest (-1, 200);
scrolledWindow.Show ();
expandVBox.PackStart (scrolledWindow, true, true, 0);
// Create model for TreeView
model = new Gtk.TreeStore (typeof (string), typeof (string));
// Create TreeView, attach model
Gtk.TreeView treeView = new Gtk.TreeView ();
treeView.Model = model;
treeView.RowActivated += OnRowActivated;
treeView.Show ();
scrolledWindow.Add (treeView);
// Set up TreeViewColumns
Gtk.TreeViewColumn column = new Gtk.TreeViewColumn (
Catalog.GetString ("Note Title"),
new Gtk.CellRendererText (), "text", 0);
column.SortColumnId = 0;
column.Resizable = true;
//.........这里部分代码省略.........
示例7: ExceptionDialog
public ExceptionDialog(Exception e) : base()
{
debugInfo = BuildExceptionMessage(e);
HasSeparator = false;
BorderWidth = 5;
Resizable = false;
Title = Catalog.GetString("F-Spot Encountered a Fatal Error");
VBox.Spacing = 12;
ActionArea.Layout = ButtonBoxStyle.End;
accel_group = new AccelGroup();
AddAccelGroup(accel_group);
HBox hbox = new HBox(false, 12);
hbox.BorderWidth = 5;
VBox.PackStart(hbox, false, false, 0);
Image image = new Image(Stock.DialogError, IconSize.Dialog);
image.Yalign = 0.0f;
hbox.PackStart(image, true, true, 0);
VBox label_vbox = new VBox(false, 0);
label_vbox.Spacing = 12;
hbox.PackStart(label_vbox, false, false, 0);
Label label = new Label(String.Format("<b><big>{0}</big></b>", GLib.Markup.EscapeText(Title)));
label.UseMarkup = true;
label.Justify = Justification.Left;
label.LineWrap = true;
label.SetAlignment(0.0f, 0.5f);
label_vbox.PackStart(label, false, false, 0);
label = new Label(e.Message);
label.UseMarkup = true;
label.Justify = Gtk.Justification.Left;
label.LineWrap = true;
label.SetAlignment(0.0f, 0.5f);
label_vbox.PackStart(label, false, false, 0);
Label details_label = new Label(String.Format("<b>{0}</b>",
GLib.Markup.EscapeText(Catalog.GetString("Error Details"))));
details_label.UseMarkup = true;
Expander details_expander = new Expander("Details");
details_expander.LabelWidget = details_label;
label_vbox.PackStart(details_expander, true, true, 0);
ScrolledWindow scroll = new ScrolledWindow();
TextView view = new TextView();
scroll.HscrollbarPolicy = PolicyType.Automatic;
scroll.VscrollbarPolicy = PolicyType.Automatic;
scroll.AddWithViewport(view);
scroll.SetSizeRequest(450, 250);
view.Editable = false;
view.Buffer.Text = debugInfo;
details_expander.Add(scroll);
hbox.ShowAll();
AddButton(Stock.Close, ResponseType.Close, true);
}
示例8: initialize
void initialize()
{
this.piecesStore = new ListStore(typeof(string),typeof(ConstructorInfo),typeof(Gdk.Pixbuf));
this.piecesView = new IconView();
this.piecesView.Model = this.piecesStore;
this.piecesView.TextColumn = 0x00;
this.piecesView.PixbufColumn = 0x02;
this.piecesView.SelectionChanged += pieces_selection_changed;
this.sketchpad = new SketchPad();
this.sketchpad.RootPiece = new RunPiece();
this.sketchpad.Tool = SketchPadTool.CreateNew;
this.invokePieces(Assembly.GetExecutingAssembly());
ScrolledWindow sw = new ScrolledWindow();
ScrolledWindow sw2 = new ScrolledWindow();
sw.Add(this.piecesView);
sw.SetPolicy(PolicyType.Never,PolicyType.Always);
sw.SetSizeRequest(1920,100);
sw2.AddWithViewport(this.sketchpad);
sw2.SetPolicy(PolicyType.Always,PolicyType.Always);
sw2.SetSizeRequest(700,500);
this.vbox1.PackStart(sw,false,false,0x00);
this.vbox1.PackStart(sw2,true,true,0x00);
this.Maximize();
this.ShowAll();
}
示例9: Populate
protected void Populate()
{
this.SetDefaultSize(1024,768);
Window pingpong = new Window(Gtk.WindowType.Toplevel);
pingpong.SetDefaultSize(500,50);
pingpong.SetPosition(Gtk.WindowPosition.CenterOnParent);
pingpong.Title = "Loading...";
_pulseBar = new ProgressBar();
pingpong.Add(_pulseBar);
pingpong.ShowAll();
pingpong.Show();
while (_currentStrs == null)
{
Application.Invoke( delegate {
_pulseBar.Pulse();
});
Thread.Sleep(100);
}
Application.Invoke( delegate {
pingpong.Destroy();
this.Remove(_vbox);
_vbox = new VBox(false, 10);
MenuBar bar = new MenuBar ();
Menu fileMenu = new Menu ();
MenuItem fileMenuItem = new MenuItem ("File");
fileMenuItem.Submenu = fileMenu;
MenuItem exit = new MenuItem ("Exit");
exit.Activated += delegate(object sender, EventArgs e) {
Application.Quit ();
};
MenuItem openFile = new MenuItem ("Open file...");
openFile.Activated += OpenFile;
fileMenu.Append (openFile);
fileMenu.Append (exit);
bar.Append (fileMenuItem);
_vbox.PackStart(bar, false, false, 0);
_regxTitle = ComboBox.NewText();
_regxTitle.Changed += HandleChanged;
foreach (KeyValuePair<string, string> pair in _regexes)
_regxTitle.AppendText(pair.Key);
_regx = new Entry();
_regx.IsEditable = false;
_regx.CanFocus = false;
HBox comboRegexBox = new HBox(true, 10);
comboRegexBox.SetSizeRequest(768, 50);
comboRegexBox.PackStart(_regxTitle, false,false, 0);
comboRegexBox.PackStart(_regx, true, true, 0);
Button search = new Button("Search!");
search.Clicked += HandleClicked;
comboRegexBox.PackStart(search, false, false, 20);
_vbox.PackStart(comboRegexBox, true, true, 10);
ScrolledWindow sw = new ScrolledWindow();
_tv = new TreeView();
sw.Add(_tv);
CellRendererText tsText = new CellRendererText();
TreeViewColumn match = new TreeViewColumn();
match.Title = "Match";
match.PackStart(tsText, true);
match.AddAttribute(tsText, "text", 0);
_tv.AppendColumn(match);
TreeStore store = new TreeStore(typeof(string));
foreach (string str in _currentStrs)
store.AppendValues(str);
_tv.Model = store;
sw.SetSizeRequest(768,600);
_vbox.PackStart(sw, false, false, 0);
this.Add(_vbox);
this.ShowAll();
});
}
示例10: CreatePreview
Widget CreatePreview(Drawable drawable, SliceData sliceData)
{
var window = new ScrolledWindow();
window.SetSizeRequest(600, 400);
var alignment = new Alignment(0.5f, 0.5f, 0, 0);
Preview = new Preview(drawable, sliceData)
{WidthRequest = drawable.Width, HeightRequest = drawable.Height};
alignment.Add(Preview);
window.AddWithViewport(alignment);
return window;
}
示例11: AddFeedTreeView
private void AddFeedTreeView()
{
store = new ListStore(typeof(bool), typeof(string), typeof(string), typeof(Gdk.Pixbuf));
crt = new CellRendererToggle();
crt.Activatable = true;
crt.Toggled += new ToggledHandler(OnCrtToggled);
CellRendererText trender = new CellRendererText();
trender.Ellipsize = Pango.EllipsizeMode.End;
treeview = new TreeView();
treeview.Model = store;
ScrolledWindow treeview_swin = new ScrolledWindow(new Adjustment(0, 0, 0, 0, 0, 0), new Adjustment(0, 0, 0, 0, 0, 0));
treeview_swin.Add(treeview);
treeview_swin.SetSizeRequest(200, 300);
treeview_swin.ShadowType = ShadowType.In;
treeview_swin.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
TreeViewColumn column_Use = new TreeViewColumn("Use", crt, "active", 0);
treeview.AppendColumn(column_Use);
TreeViewColumn column_Icon = new TreeViewColumn("Icon", new CellRendererPixbuf(), "pixbuf", 3);
treeview.AppendColumn(column_Icon);
TreeViewColumn column_Name = new TreeViewColumn("Title", trender, "text", 1);
treeview.AppendColumn(column_Name);
table.Attach(treeview_swin, 0, 1, 1, 2);
}
示例12: addMainPanel
/**
* Method will be responsible for creating all main visual information used in this tool.
* Achieved with numerous helper methods.
* **/
private void addMainPanel()
{
//holds graph + mem row size info
graphContainer = new VBox ();
EventBox rowSizeLabelContainer = new EventBox ();
Label rowSizeLabel = new Label ("Row size: " + FileParser.FileParser.MemRowSize);
rowSizeLabel.Style = subHeaderLabelStyle.Copy ();
rowSizeLabel.SetSizeRequest(Constants.Constants.GRAPH_SIDE, 50);
rowSizeLabelContainer.Add (rowSizeLabel);
graphContainer.PackStart (rowSizeLabelContainer, false, false, 10);
populateGraph ();
//create grid layout that will hold block information and visual representation of memory
HBox graphHBox = new HBox ();
graphHBox.PackStart (graph, true, true, 40);
graphContainer.PackStart (graphHBox, false, false, 50);
//give border to legend container
graphFrame = new Frame ();
graphFrame.SetSizeRequest (Constants.Constants.GRAPH_CONTAINER_SIDE, Constants.Constants.LINK_PANEL_HEIGHT + 100);
Viewport graphViewPort = new Viewport ();
graphViewPort.SetSizeRequest (Constants.Constants.GRAPH_CONTAINER_SIDE, Constants.Constants.LINK_PANEL_HEIGHT);
graphViewPort.Add (graphContainer);
//add the window for the graph frame
graphWindow = new ScrolledWindow ();
graphWindow.SetSizeRequest (Constants.Constants.GRAPH_SIDE, Constants.Constants.LINK_PANEL_HEIGHT);
graphWindow.Add (graphViewPort);
graphFrame.Add (graphWindow);
}
示例13: InitializeComponent
private void InitializeComponent()
{
this.plotView = new OxyPlot.GtkSharp.PlotView();
this.plotView.SetSizeRequest(300, 300);
this.treeView = new TreeView();
this.treeView.Visible = true;
var treeModel = new TreeStore(typeof(string), typeof(string));
var iter = new TreeIter();
string last = null;
foreach (var ex in this.Examples)
{
if (last == null || last != ex.Category)
{
iter = treeModel.AppendValues(ex.Category);
last = ex.Category;
}
treeModel.AppendValues(iter, ex.Title, ex.Category);
}
this.treeView.Model = treeModel;
var exampleNameColumn = new TreeViewColumn { Title = "Example" };
var exampleNameCell = new CellRendererText();
exampleNameColumn.PackStart(exampleNameCell, true);
this.treeView.AppendColumn(exampleNameColumn);
exampleNameColumn.AddAttribute(exampleNameCell, "text", 0);
this.treeView.Selection.Changed += (s, e) =>
{
TreeIter selectedNode;
TreeModel selectedModel;
if (treeView.Selection.GetSelected(out selectedModel, out selectedNode))
{
string val1 = (string)selectedModel.GetValue(selectedNode, 0);
string val2 = (string)selectedModel.GetValue(selectedNode, 1);
this.SelectedExample = this.Examples.FirstOrDefault(ex => ex.Category == val2 && ex.Title == val1);
}
};
var scrollwin = new ScrolledWindow ();
scrollwin.Add (this.treeView);
scrollwin.SetSizeRequest(250, 300);
var txtSearch = new Entry ();
treeView.SearchEntry = txtSearch;
var treeVbox = new VBox (false, 0);
treeVbox.BorderWidth = 6;
treeVbox.PackStart (txtSearch, false, true, 0);
treeVbox.PackStart (scrollwin, true, true, 0);
this.paned = new HPaned ();
this.paned.Pack1 (treeVbox, false, false);
this.paned.Pack2 (this.plotView, true, false);
this.paned.Position = 300;
this.Add(this.paned);
//this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
//this.AutoScaleMode = Gtk.AutoScaleMode.Font;
//this.ClientSize = new System.Drawing.Size(943, 554);
this.Title = "OxyPlot.GtkSharp Example Browser";
this.DeleteEvent += (s, a) =>
{
Application.Quit();
a.RetVal = true;
};
}