本文整理汇总了C#中Gtk.Label类的典型用法代码示例。如果您正苦于以下问题:C# Gtk.Label类的具体用法?C# Gtk.Label怎么用?C# Gtk.Label使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Gtk.Label类属于命名空间,在下文中一共展示了Gtk.Label类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Build
protected virtual void Build()
{
Stetic.Gui.Initialize(this);
// Widget omvviewerlight.TexturePreview
this.Name = "omvviewerlight.TexturePreview";
this.Title = Mono.Unix.Catalog.GetString("TexturePreview");
this.WindowPosition = ((Gtk.WindowPosition)(4));
// Container child omvviewerlight.TexturePreview.Gtk.Container+ContainerChild
this.vbox1 = new Gtk.VBox();
this.vbox1.Name = "vbox1";
this.vbox1.Spacing = 6;
// Container child vbox1.Gtk.Box+BoxChild
this.label_title = new Gtk.Label();
this.label_title.Name = "label_title";
this.vbox1.Add(this.label_title);
Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.vbox1[this.label_title]));
w1.Position = 0;
w1.Expand = false;
w1.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
this.image = new Gtk.Image();
this.image.Name = "image";
this.vbox1.Add(this.image);
Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.vbox1[this.image]));
w2.Position = 1;
w2.Expand = false;
w2.Fill = false;
this.Add(this.vbox1);
if ((this.Child != null)) {
this.Child.ShowAll();
}
this.DefaultWidth = 400;
this.DefaultHeight = 300;
this.Show();
}
示例2: DoubleInputView
public DoubleInputView(DoubleInputModel model)
{
this.Build ();
for (int i = 0; i < model.Count; ++i)
{
var input = new Gtk.Entry();
var label = new Gtk.Label(model._labels[i] + ": ");
//The index i was being "captured" by referance in the anonymous function.\
//This makes a copy
int j = i;
input.Changed +=
(object sender, EventArgs e) =>
{
Double.TryParse((sender as Gtk.Entry).Text, out model._inputs[j]);
Console.WriteLine("we wrote: " + model._inputs[j] + " j: " + j);
};
MainView.Put(label, 10, 10 + i*40);
MainView.Put(input, 120, 10 + i*40);
}
buttonCancel.Clicked += (o, args) => {model._inputs = null; this.Destroy();};
buttonOk.Clicked += (o, args) => {this.Destroy();};
}
示例3: LabelBackend
public LabelBackend ()
{
Widget = new Gtk.Label ();
Label.Show ();
Label.Xalign = 0;
Label.Yalign = 0.5f;
}
示例4: Build
protected virtual void Build()
{
Stetic.Gui.Initialize(this);
// Widget ocmgtk.CleanUpPage1
Stetic.BinContainer.Attach(this);
this.Name = "ocmgtk.CleanUpPage1";
// Container child ocmgtk.CleanUpPage1.Gtk.Container+ContainerChild
this.vbox1 = new Gtk.VBox();
this.vbox1.Name = "vbox1";
this.vbox1.Spacing = 6;
// Container child vbox1.Gtk.Box+BoxChild
this.label2 = new Gtk.Label();
this.label2.Name = "label2";
this.label2.Ypad = 15;
this.label2.Xalign = 0F;
this.label2.LabelProp = Mono.Unix.Catalog.GetString("This assistant will help guide you through cleaning up your OCM database.\n\nBy reducing the number of logs per cache and compacting your database, you can greatly reduce the size of you OCM database which will improve performance. ");
this.label2.Wrap = true;
this.label2.WidthChars = 80;
this.vbox1.Add(this.label2);
Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.vbox1[this.label2]));
w1.Position = 0;
w1.Expand = false;
w1.Fill = false;
this.Add(this.vbox1);
if ((this.Child != null)) {
this.Child.ShowAll();
}
this.Hide();
}
示例5: DiffWidget
public DiffWidget (VersionControlDocumentInfo info, bool viewOnly = false)
{
this.info = info;
this.Build ();
comparisonWidget = new ComparisonWidget (viewOnly);
buttonNext = new DocumentToolButton (Gtk.Stock.GoUp, GettextCatalog.GetString ("Previous Change"));
buttonPrev = new DocumentToolButton (Gtk.Stock.GoDown, GettextCatalog.GetString ("Next Change"));
labelOverview = new Gtk.Label () { Xalign = 0 };
buttonDiff = new Gtk.Button (GettextCatalog.GetString ("Unified Diff"));
this.buttonNext.Clicked += (sender, args) => ComparisonWidget.GotoNext ();
this.buttonPrev.Clicked += (sender, args) => ComparisonWidget.GotoPrev ();
notebook1.Page = 0;
vboxComparisonView.PackStart (comparisonWidget, true, true, 0);
comparisonWidget.Show ();
comparisonWidget.DiffChanged += delegate {
labelOverview.Markup = LabelText;
SetButtonSensitivity ();
};
comparisonWidget.SetVersionControlInfo (info);
this.buttonDiff.Clicked += HandleButtonDiffhandleClicked;
diffTextEditor = new global::Mono.TextEditor.MonoTextEditor (new Mono.TextEditor.TextDocument (), CommonTextEditorOptions.Instance);
diffTextEditor.Document.MimeType = "text/x-diff";
diffTextEditor.Options.ShowFoldMargin = false;
diffTextEditor.Options.ShowIconMargin = false;
diffTextEditor.Options.DrawIndentationMarkers = PropertyService.Get ("DrawIndentationMarkers", false);
diffTextEditor.Document.ReadOnly = true;
scrolledwindow1.Child = diffTextEditor;
diffTextEditor.Show ();
SetButtonSensitivity ();
}
示例6: ActionGroupEditor
public ActionGroupEditor()
{
changedEvent = new ObjectWrapperEventHandler (OnActionChanged);
Gtk.Fixed fx = new Gtk.Fixed ();
table = new Gtk.Table (0, 0, false);
table.RowSpacing = 8;
table.ColumnSpacing = 8;
table.BorderWidth = 12;
Gtk.EventBox ebox = new Gtk.EventBox ();
ebox.ModifyBg (Gtk.StateType.Normal, this.Style.Backgrounds [0]);
headerLabel = new EditableLabel ();
headerLabel.MarkupTemplate = "<b>$TEXT</b>";
headerLabel.Changed += OnGroupNameChanged;
Gtk.VBox vbox = new Gtk.VBox ();
Gtk.Label grpLabel = new Gtk.Label ();
grpLabel.Xalign = 0;
grpLabel.Markup = "<small><i>Action Group</i></small>";
// vbox.PackStart (grpLabel, false, false, 0);
vbox.PackStart (headerLabel, false, false, 3);
vbox.BorderWidth = 12;
ebox.Add (vbox);
Gtk.VBox box = new Gtk.VBox ();
box.Spacing = 6;
box.PackStart (ebox, false, false, 0);
box.PackStart (table, false, false, 0);
fx.Put (box, 0, 0);
Add (fx);
ShowAll ();
}
示例7: Build
protected virtual void Build()
{
Stetic.Gui.Initialize(this);
// Widget ocmgtk.CleanupSummary
Stetic.BinContainer.Attach(this);
this.Name = "ocmgtk.CleanupSummary";
// Container child ocmgtk.CleanupSummary.Gtk.Container+ContainerChild
this.vbox3 = new Gtk.VBox();
this.vbox3.Name = "vbox3";
this.vbox3.Spacing = 6;
this.vbox3.BorderWidth = ((uint)(6));
// Container child vbox3.Gtk.Box+BoxChild
this.summaryText = new Gtk.Label();
this.summaryText.Name = "summaryText";
this.summaryText.Xalign = 0F;
this.summaryText.LabelProp = Mono.Unix.Catalog.GetString("Database cleanup complete");
this.vbox3.Add(this.summaryText);
Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.vbox3[this.summaryText]));
w1.Position = 0;
w1.Expand = false;
w1.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
this.hseparator2 = new Gtk.HSeparator();
this.hseparator2.Name = "hseparator2";
this.vbox3.Add(this.hseparator2);
Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.vbox3[this.hseparator2]));
w2.Position = 1;
w2.Expand = false;
w2.Fill = false;
this.Add(this.vbox3);
if ((this.Child != null)) {
this.Child.ShowAll();
}
this.Hide();
}
示例8: Fill
public void Fill (Extension ext, ITreeNavigator nav)
{
labelName.Markup = "<small>Extension</small>\n<big><b>" + GLib.Markup.EscapeText (Util.GetDisplayName (ext)) + "</b></big>";
object parent = ext.GetExtendedObject ();
if (parent is ExtensionPoint) {
ExtensionPoint ep = (ExtensionPoint) parent;
string txt = "<small>Extension Point</small>\n<b>" + GLib.Markup.EscapeText (Util.GetDisplayName (ep)) + "</b>";
if (!string.IsNullOrEmpty (ep.Description))
txt += "\n" + GLib.Markup.EscapeText (ep.Description);
Gtk.Label lab = new Gtk.Label ();
lab.Xalign = lab.Yalign = 0;
lab.Markup = txt;
lab.WidthRequest = 400;
lab.Wrap = true;
Gtk.Image img = new Gtk.Image (ImageService.GetPixbuf ("md-extension-point", Gtk.IconSize.Menu));
img.Yalign = 0;
Gtk.HBox box = new Gtk.HBox (false, 6);
box.PackStart (img, false, false, 0);
box.PackStart (lab, true, true, 0);
buttonExt.Add (box);
buttonExt.ShowAll ();
buttonExt.Clicked += delegate {
if (nav.MoveToObject (ext)) {
nav.MoveToParent (typeof(Solution));
nav.Expanded = true;
if (nav.MoveToObject (ep.ParentAddinDescription)) {
nav.Expanded = true;
if (nav.MoveToObject (ep))
nav.Selected = true;
}
}
};
}
}
示例9: Build
protected virtual void Build()
{
Stetic.Gui.Initialize(this);
// Widget PackageManager.Configuration
Stetic.BinContainer.Attach(this);
this.Name = "PackageManager.Configuration";
// Container child PackageManager.Configuration.Gtk.Container+ContainerChild
this.vbox1 = new Gtk.VBox();
this.vbox1.Name = "vbox1";
this.vbox1.Spacing = 6;
// Container child vbox1.Gtk.Box+BoxChild
this.label = new Gtk.Label();
this.label.Name = "label";
this.label.Xalign = 0F;
this.label.LabelProp = Mono.Unix.Catalog.GetString("label1");
this.vbox1.Add(this.label);
Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.vbox1[this.label]));
w1.Position = 1;
w1.Expand = false;
w1.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
this.combobox = Gtk.ComboBox.NewText();
this.combobox.Name = "combobox";
this.vbox1.Add(this.combobox);
Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.vbox1[this.combobox]));
w2.Position = 2;
w2.Expand = false;
w2.Fill = false;
this.Add(this.vbox1);
if ((this.Child != null)) {
this.Child.ShowAll();
}
this.Hide();
}
示例10: InitializeComponents
void InitializeComponents()
{
// set up this actual dialog
this.Modal = true;
// FIXME: make this a resource in the resource file
this.Title = String.Format (GettextCatalog.GetString ("{0} Code Group"), titlePrefix);
// set up the dialog fields and add them
templateExtensionsTextBox = new Gtk.Entry();
templateExtensionsTextBox.ActivatesDefault = true;
// FIXME: make this a resource in the resource file
Gtk.Label label1 = new Gtk.Label("Extensions (; seperated)");
label1.Xalign = 0;
templateExtensionsTextBox.Text = string.Join(";", codeTemplateGroup.ExtensionStrings);
// FIXME: make the labels both part of the same sizing group so they have the same left and right rows.
Gtk.HBox hBox1 = new Gtk.HBox(false, 6);
hBox1.PackStart(label1, false, false, 6);
hBox1.PackStart(templateExtensionsTextBox, false, false, 6);
this.VBox.PackStart(hBox1, false, false, 6);
// set up the buttons and add them
this.DefaultResponse = Gtk.ResponseType.Ok;
Gtk.Button cancelButton = new Gtk.Button(Gtk.Stock.Cancel);
Gtk.Button okButton = new Gtk.Button(Gtk.Stock.Ok);
okButton.Clicked += new EventHandler(AcceptEvent);
cancelButton.Clicked += new EventHandler(CancelEvent);
this.AddActionWidget (cancelButton, Gtk.ResponseType.Cancel);
this.AddActionWidget (okButton, (int) Gtk.ResponseType.Ok);
}
示例11: Fill
public void Fill (ExtensionNodeDescription node)
{
ExtensionNodeType ntype = node.GetNodeType ();
labelName.Markup = "<small>Extension Node</small>\n<big><b>" + GLib.Markup.EscapeText (ntype.NodeName) + "</b></big>";
if (!string.IsNullOrEmpty (ntype.Description))
labelDesc.Text = ntype.Description;
else
labelDesc.Text = AddinManager.CurrentLocalizer.GetString ("No additional documentation");
uint row = 0;
foreach (var att in node.Attributes) {
Gtk.Label lab = new Gtk.Label ();
lab.Markup = "<b>" + GLib.Markup.EscapeText (att.Name) + ":</b>";
lab.UseUnderline = false;
lab.Xalign = 0;
tableAtts.Attach (lab, 0, 1, row, row + 1);
Gtk.Table.TableChild ct = (Gtk.Table.TableChild) tableAtts [lab];
ct.XOptions = Gtk.AttachOptions.Fill;
lab = new Gtk.Label (att.Value);
lab.UseUnderline = false;
lab.Xalign = 0;
lab.Wrap = true;
tableAtts.Attach (lab, 1, 2, row, row + 1);
ct = (Gtk.Table.TableChild) tableAtts [lab];
ct.XOptions = Gtk.AttachOptions.Fill;
row++;
}
tableAtts.ShowAll ();
}
示例12: NewLabel
public static Gtk.Label NewLabel ()
{
Gtk.Label label = new Gtk.Label ();
label.SetAlignment (0.0f, 0.5f);
label.Selectable = true;
return label;
}
示例13: QueryWidget
public QueryWidget (PhotoQuery query, Db db, TagSelectionWidget selector)
{
tips.Enable ();
this.query = query;
query.Changed += HandleChanged;
Gtk.HSeparator sep = new Gtk.HSeparator ();
sep.Show ();
this.PackStart (sep, false, false, 0);
Gtk.HBox hbox = new Gtk.HBox ();
hbox.Show ();
this.PackStart (hbox, false, false, 0);
label = new Gtk.Label (Catalog.GetString ("Find: "));
label.Show ();
label.Ypad = 9;
hbox.PackStart (label, false, false, 0);
untagged = new Gtk.Label (Catalog.GetString ("Untagged photos"));
untagged.Visible = false;
hbox.PackStart (untagged, false, false, 0);
comma_label = new Gtk.Label (", ");
comma_label.Visible = false;
hbox.PackStart (comma_label, false, false, 0);
rollfilter = new Gtk.Label (Catalog.GetString ("Import roll"));
rollfilter.Visible = false;
hbox.PackStart (rollfilter, false, false, 0);
logic_widget = new LogicWidget (query, db.Tags, selector);
logic_widget.Show ();
hbox.PackStart (logic_widget, true, true, 0);
warning_box = new Gtk.HBox ();
warning_box.PackStart (new Gtk.Label (System.String.Empty));
Gtk.Image warning_image = new Gtk.Image ("gtk-info", Gtk.IconSize.Button);
warning_image.Show ();
warning_box.PackStart (warning_image, false, false, 0);
clear_button = new Gtk.Button ();
clear_button.Add (new Gtk.Image ("gtk-close", Gtk.IconSize.Button));
clear_button.Clicked += HandleClearButtonClicked;
clear_button.Relief = Gtk.ReliefStyle.None;
hbox.PackEnd (clear_button, false, false, 0);
tips.SetTip (clear_button, Catalog.GetString("Clear search"), null);
Gtk.Label warning = new Gtk.Label (Catalog.GetString ("No matching photos found"));
warning_box.PackStart (warning, false, false, 0);
warning_box.ShowAll ();
warning_box.Spacing = 6;
warning_box.Visible = false;
hbox.PackEnd (warning_box, false, false, 0);
warning_box.Visible = false;
}
示例14: CreateInfoWidget
private Gtk.Widget CreateInfoWidget(BasicNodeControl basicComponentControl)
{
//case 1: Component Panel
ComponentControl componentControl = basicComponentControl as ComponentControl;
if(componentControl != null)
{
ComponentInfoPanel panel = new ComponentInfoPanel();
panel.Component = componentControl;
return panel;
}
else
{
//case 2: decision panel
DecisionNodeControl decisionControl = basicComponentControl as DecisionNodeControl;
if(decisionControl != null)
{
DecisionInfoPanel panel = new DecisionInfoPanel(m_applicationContext);
panel.DecisionControl = decisionControl;
return panel;
}
}
//invalid
Gtk.Label errorLabel = new Gtk.Label("Not implemented. Panels not supported for the given component control.");
return errorLabel;
}
示例15: Build
protected virtual void Build()
{
Stetic.Gui.Initialize(this);
// Widget fileparsersharp.ViewWindow
this.Name = "fileparsersharp.ViewWindow";
this.Title = "ViewWindow";
this.WindowPosition = ((Gtk.WindowPosition)(4));
// Container child fileparsersharp.ViewWindow.Gtk.Container+ContainerChild
this.vbox2 = new Gtk.VBox();
this.vbox2.Name = "vbox2";
this.vbox2.Spacing = 6;
// Container child vbox2.Gtk.Box+BoxChild
this.label1 = new Gtk.Label();
this.label1.Name = "label1";
this.label1.LabelProp = "ViewWindow";
this.vbox2.Add(this.label1);
Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.vbox2[this.label1]));
w1.Position = 1;
w1.Expand = false;
w1.Fill = false;
this.Add(this.vbox2);
if ((this.Child != null)) {
this.Child.ShowAll();
}
this.DefaultWidth = 400;
this.DefaultHeight = 300;
this.Show();
}