本文整理汇总了C#中Gtk.ShowAll方法的典型用法代码示例。如果您正苦于以下问题:C# Gtk.ShowAll方法的具体用法?C# Gtk.ShowAll怎么用?C# Gtk.ShowAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk
的用法示例。
在下文中一共展示了Gtk.ShowAll方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowTooltipWindow
public virtual Gtk.Window ShowTooltipWindow (MonoTextEditor editor, Gtk.Window tipWindow, int offset, Gdk.ModifierType modifierState, int mouseX, int mouseY, TooltipItem item)
{
int ox = 0, oy = 0;
if (editor.GdkWindow != null)
editor.GdkWindow.GetOrigin (out ox, out oy);
int w;
double xalign;
GetRequiredPosition (editor, tipWindow, out w, out xalign);
w += 10;
int x = mouseX + ox + editor.Allocation.X;
int y = mouseY + oy + editor.Allocation.Y;
Gdk.Rectangle geometry = editor.Screen.GetUsableMonitorGeometry (editor.Screen.GetMonitorAtPoint (x, y));
x -= (int) ((double) w * xalign);
y += 10;
if (x + w >= geometry.X + geometry.Width)
x = geometry.X + geometry.Width - w;
if (x < geometry.Left)
x = geometry.Left;
int h = tipWindow.SizeRequest ().Height;
if (y + h >= geometry.Y + geometry.Height)
y = geometry.Y + geometry.Height - h;
if (y < geometry.Top)
y = geometry.Top;
tipWindow.Move (x, y);
tipWindow.ShowAll ();
return tipWindow;
}
示例2: AddCustomWidget
protected void AddCustomWidget (Gtk.Widget w)
{
w.ShowAll ();
book.AppendPage (w, null);
book.Page = book.NPages - 1;
if (initialized) {
Gtk.Widget cw = book.GetNthPage (0);
book.RemovePage (0);
cw.Destroy ();
}
else
initialized = true;
}
示例3: ComboPackShowAndSensitive
public static void ComboPackShowAndSensitive(Gtk.Box box, Gtk.ComboBox combo)
{
box.PackStart(combo, true, true, 0);
box.ShowAll();
combo.Sensitive = true;
}
示例4: UpdateButton
void UpdateButton(DialogButton btn, Gtk.Button b)
{
if (!string.IsNullOrEmpty (btn.Label) && btn.Image == null) {
b.Label = btn.Label;
} else if (string.IsNullOrEmpty (btn.Label) && btn.Image != null) {
var pix = btn.Image.ToImageDescription ();
b.Image = new ImageBox (ApplicationContext, pix);
} else if (!string.IsNullOrEmpty (btn.Label)) {
Gtk.Box box = new Gtk.HBox (false, 3);
var pix = btn.Image.ToImageDescription ();
box.PackStart (new ImageBox (ApplicationContext, pix), false, false, 0);
box.PackStart (new Gtk.Label (btn.Label), true, true, 0);
b.Image = box;
}
if (btn.Visible)
b.ShowAll ();
else
b.Hide ();
b.Sensitive = btn.Sensitive;
UpdateActionAreaVisibility ();
}
示例5: UpdateButton
void UpdateButton(DialogButton btn, Gtk.Button b)
{
if (!string.IsNullOrEmpty (btn.Label) && btn.Image == null) {
b.Label = btn.Label;
} else if (string.IsNullOrEmpty (btn.Label) && btn.Image != null) {
var pix = (Gdk.Pixbuf) Toolkit.GetBackend (btn.Image);
b.Image = new Gtk.Image (pix);
} else if (!string.IsNullOrEmpty (btn.Label)) {
Gtk.Box box = new Gtk.HBox (false, 3);
var pix = (Gdk.Pixbuf) Toolkit.GetBackend (btn.Image);
box.PackStart (new Gtk.Image (pix), false, false, 0);
box.PackStart (new Gtk.Label (btn.Label), true, true, 0);
b.Image = box;
}
if (btn.Visible)
b.ShowAll ();
else
b.Hide ();
b.Sensitive = btn.Sensitive;
UpdateActionAreaVisibility ();
}
示例6: InitWebKit
public void InitWebKit(Gtk.Box w)
{
wb = new WebKit.WebView();
scrollWindow.Add(wb);
// Hack to work around webkit bug; webkit will crash the app if a size is not provided
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=466360 for a related bug report
wb.SetSizeRequest(2, 2);
w.PackStart(scrollWindow, true, true, 0);
w.ShowAll();
}
示例7: AddButton
protected ToggleToolButton AddButton (string label, Gtk.Widget page)
{
CheckCreateSubViewToolbar ();
updating = true;
ToggleToolButton button = new ToggleToolButton ();
button.Label = label;
button.IsImportant = true;
button.Clicked += new EventHandler (OnButtonToggled);
button.ShowAll ();
subViewToolbar.Insert (button, -1);
subViewNotebook.AppendPage (page, new Gtk.Label ());
page.ShowAll ();
EnsureToolbarBoxSeparator ();
updating = false;
return button;
}
示例8: PopupContextMenuAtLocation
void PopupContextMenuAtLocation (Gtk.Menu menu, int x, int y)
{
menu.ShowAll ();
Gtk.MenuPositionFunc pos_menu_func = null;
// Set up the funtion to position the context menu
// if we were called by the keyboard Gdk.Key.Menu.
if (x == 0 && y == 0)
pos_menu_func = PositionContextMenu;
try {
menu.Popup (null, null,
pos_menu_func,
0,
Gtk.Global.CurrentEventTime);
} catch {
Logger.Debug ("Menu popup failed with custom MenuPositionFunc; trying again without");
menu.Popup (null, null,
null,
0,
Gtk.Global.CurrentEventTime);
}
}
示例9: Rebuild
//.........这里部分代码省略.........
ymax = (uint)Math.Max(ymax, y + h);
x = positions[i][2][0] + 1;
y = positions[i][2][1] + 1;
w = 1;
h = positions[i][2][2];
line = new Gtk.DrawingArea();
line.ExposeEvent += Line_Expose;
rela = false;
if (famLink != null && (famLink.Pedigree == PedegreeLinkageType.Birth || famLink.Pedigree == PedegreeLinkageType.Unknown))
{
line.AddEvents((int)Gdk.EventMask.ButtonPressMask);
rela = true;
}
lineData = new Pair<int,bool>();
lineData.First = i * 2 + 2;
lineData.Second = rela;
_lines[line] = lineData;
table.Attach(line, x, x + w, y, y + h, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);
xmax = (uint)Math.Max(xmax, x + w);
ymax = (uint)Math.Max(ymax, y + h);
}
// marriage data
if (_showMarriageData && positions[i].Length > 3)
{
string text = string.Empty;
if (famLink != null && (famLink.Pedigree == PedegreeLinkageType.Birth || famLink.Pedigree == PedegreeLinkageType.Unknown))
{
text = "foo";
}
Gtk.Label label = new Gtk.Label(text);
label.Justify = Gtk.Justification.Left;
label.LineWrap = true;
label.SetAlignment(0.1F, 0.5F);
x = positions[i][3][0] + 1;
y = positions[i][3][1] + 1;
w = positions[i][3][2];
h = positions[i][3][3];
table.Attach(label, x, x + w, y, y + h, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);
}
}
// nav arrows
if (lst[0] != null)
{
Gtk.Button arrowButton = new Gtk.Button();
arrowButton.Add(new Gtk.Arrow(Gtk.ArrowType.Left, Gtk.ShadowType.In));
arrowButton.Sensitive = (_dummyFam.Children.Count > 0);
arrowButton.Clicked += ArrowButton_Click;
if (arrowButton.Sensitive)
{
arrowButton.TooltipText = "Jump to child...";
}
uint ymid = (uint)Math.Floor(ymax / 2.0F);
table.Attach(arrowButton, 0, 1, ymid, ymid + 1, 0, 0, 0, 0);
// father
arrowButton = new Gtk.Button();
arrowButton.Add(new Gtk.Arrow(Gtk.ArrowType.Right, Gtk.ShadowType.In));
arrowButton.Sensitive = (lst[1] != null);
arrowButton.Clicked += FatherButton_Click;
if (arrowButton.Sensitive)
{
arrowButton.TooltipText = "Jump to father";
}
ymid = (uint)Math.Floor(ymax / 4.0F);
table.Attach(arrowButton, xmax, xmax + 1, ymid - 1, ymid + 2, 0, 0, 0, 0);
// mother
arrowButton = new Gtk.Button();
arrowButton.Add(new Gtk.Arrow(Gtk.ArrowType.Right, Gtk.ShadowType.In));
arrowButton.Sensitive = (lst[2] != null);
arrowButton.Clicked += MotherButton_Click;
if (arrowButton.Sensitive)
{
arrowButton.TooltipText = "Jump to mother";
}
ymid = (uint)Math.Floor(ymax / 4.0F * 3);
table.Attach(arrowButton, xmax, xmax + 1, ymid - 1, ymid + 2, 0, 0, 0, 0);
// dummy widgets to allow pedigree to be centred
Gtk.Label l = new Gtk.Label(string.Empty);
table.Attach(l, 0, 1, 0, 1, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, 0);
l = new Gtk.Label(string.Empty);
table.Attach(l, xmax, xmax + 1, ymax, ymax + 1, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, 0);
table.ShowAll();
}
}
示例10: ShowControlBox
public void ShowControlBox( Gtk.VBox labels, Gtk.VBox widgets )
{
Label label = new Label( "Target height:" );
heightscale = new HScale( minheight, maxheight, (maxheight - minheight) / 20 );
heightscale.Value = lastheight;
heightscale.ValueChanged += new EventHandler( heightscale_ValueChanged );
labels.PackEnd( label );
widgets.PackEnd( heightscale );
labels.ShowAll();
widgets.ShowAll();
}
示例11: AddMenuItems
private void AddMenuItems (Gtk.Menu menu)
{
RemoveMenuItems (menu);
NotebookNewNoteMenuItem item;
Gtk.TreeModel model = NotebookManager.Notebooks;
Gtk.TreeIter iter;
// Add in the "New Notebook..." menu item
Gtk.ImageMenuItem newNotebookMenuItem =
new Gtk.ImageMenuItem (Catalog.GetString ("New Note_book..."));
newNotebookMenuItem.Image = new Gtk.Image (NewNotebookIcon);
newNotebookMenuItem.Activated += OnNewNotebookMenuItem;
newNotebookMenuItem.ShowAll ();
menu.Append (newNotebookMenuItem);
if (model.IterNChildren () > 0) {
Gtk.SeparatorMenuItem separator = new Gtk.SeparatorMenuItem ();
separator.ShowAll ();
menu.Append (separator);
if (model.GetIterFirst (out iter) == true) {
do {
Notebook notebook = model.GetValue (iter, 0) as Notebook;
item = new NotebookNewNoteMenuItem (notebook);
item.ShowAll ();
menu.Append (item);
} while (model.IterNext (ref iter) == true);
}
}
#if MAC
menu.ShowAll ();
#endif
}
示例12: ShowControlBox
public void ShowControlBox( Gtk.VBox labels, Gtk.VBox widgets )
{
Tooltips tooltips = new Tooltips();
coresize = new HScale( 0, 100, 5 );
coresize.Value = coresizevalue;
coresize.ValueChanged += new EventHandler( coresize_ValueChanged );
tooltips.SetTip( coresize, "Radius of core. Core has no fall-off", "Radius of core. Inside core, brush has full effect; outside of core, brush effect falls off towards the edge." );
tooltips.Enable();
labels.PackEnd( new Label( "Brush core radius:" ) );
widgets.PackEnd( coresize );
labels.ShowAll();
widgets.ShowAll();
}
示例13: FillVbox
public void FillVbox(Gtk.VBox vbox, IList people) {
foreach (Person p in people)
{
vbox.PackStart (new PersonAndJobRow(p, null));
}
vbox.ShowAll ();
}