本文整理汇总了C#中Gtk.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# Gtk.Remove方法的具体用法?C# Gtk.Remove怎么用?C# Gtk.Remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk
的用法示例。
在下文中一共展示了Gtk.Remove方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Replace
public void Replace (Gtk.Bin parent)
{
Gtk.Widget c = parent.Child;
parent.Remove (c);
Add (c);
parent.Add (this);
}
示例2: CreateMainMenu
public void CreateMainMenu(Gtk.Menu menu)
{
menu.Remove (menu.Children[1]);
menu.Append (Website.CreateMenuItem ());
menu.Append (Bugs.CreateMenuItem ());
menu.AppendSeparator ();
menu.Append (About.CreateMenuItem ());
}
示例3: Update
/// <summary>
/// Use a list of modifications to update Gtk.TreeStore
/// </summary>
public static void Update(RemoteTreeStore remoteStore, Gtk.TreeStore gtkStore)
{
RemoteTreeModification[] modifications = remoteStore.GetModifications();
if (modifications.Length > 0) {
Console.WriteLine(String.Format("Received {0} modifications from {1}", modifications.Length, remoteStore));
}
foreach(RemoteTreeModification mod in modifications) {
Console.WriteLine(mod);
if (mod is RemoteTreeModification.InsertNode) {
RemoteTreeModification.InsertNode insertMod = (RemoteTreeModification.InsertNode)mod;
if (insertMod.ParentNodePath.Indices.Length == 0) {
// Insert to the top level
gtkStore.InsertNode(insertMod.NodeIndex);
} else {
TreeIter it;
gtkStore.GetIter(out it, new TreePath(insertMod.ParentNodePath.Indices));
gtkStore.InsertNode(it, insertMod.NodeIndex);
}
}
if (mod is RemoteTreeModification.RemoveNode) {
RemoteTreeModification.RemoveNode removeMod = (RemoteTreeModification.RemoveNode)mod;
TreeIter it;
gtkStore.GetIter(out it, new TreePath(removeMod.NodePath.Indices));
gtkStore.Remove(ref it);
}
if (mod is RemoteTreeModification.UpdateNode) {
RemoteTreeModification.UpdateNode updateMod = (RemoteTreeModification.UpdateNode)mod;
// Igonre the root node
if (updateMod.NodePath.IsRoot) {
continue;
}
TreeIter it;
gtkStore.GetIter(out it, new TreePath(updateMod.NodePath.Indices));
object value = updateMod.Value;
// If it is image, dereference it
if (value is PixmapRef) {
value = ((PixmapRef)value).GetPixbuf();
}
gtkStore.SetValue(it, updateMod.ColumnIndex, value);
}
}
}
示例4: CreateMainMenu
public void CreateMainMenu(Gtk.Menu menu)
{
menu.Remove (menu.Children[1]);
menu.Append (Undo.CreateAcceleratedMenuItem (Gdk.Key.Z, Gdk.ModifierType.ControlMask));
menu.Append (Redo.CreateAcceleratedMenuItem (Gdk.Key.Y, Gdk.ModifierType.ControlMask));
menu.AppendSeparator ();
menu.Append (Cut.CreateAcceleratedMenuItem (Gdk.Key.X, Gdk.ModifierType.ControlMask));
menu.Append (Copy.CreateAcceleratedMenuItem (Gdk.Key.C, Gdk.ModifierType.ControlMask));
menu.Append (Paste.CreateAcceleratedMenuItem (Gdk.Key.V, Gdk.ModifierType.ControlMask));
menu.Append (PasteIntoNewLayer.CreateAcceleratedMenuItem (Gdk.Key.V, Gdk.ModifierType.ShiftMask));
//menu.Append (PasteIntoNewImage.CreateAcceleratedMenuItem (Gdk.Key.V, Gdk.ModifierType.Mod1Mask));
menu.AppendSeparator ();
menu.Append (EraseSelection.CreateAcceleratedMenuItem (Gdk.Key.Delete, Gdk.ModifierType.None));
menu.Append (FillSelection.CreateAcceleratedMenuItem (Gdk.Key.BackSpace, Gdk.ModifierType.None));
//menu.Append (InvertSelection.CreateAcceleratedMenuItem (Gdk.Key.I, Gdk.ModifierType.ControlMask));
menu.Append (SelectAll.CreateAcceleratedMenuItem (Gdk.Key.A, Gdk.ModifierType.ControlMask));
menu.Append (Deselect.CreateAcceleratedMenuItem (Gdk.Key.D, Gdk.ModifierType.ControlMask));
}
示例5: CreateMainMenu
public void CreateMainMenu(Gtk.Menu menu)
{
MenuItem show_pad = (MenuItem)menu.Children[0];
menu.Remove (show_pad);
menu.Append (ToolBar.CreateMenuItem ());
menu.Append (PixelGrid.CreateMenuItem ());
menu.Append (Rulers.CreateMenuItem ());
menu.AppendSeparator ();
ImageMenuItem zoomin = ZoomIn.CreateAcceleratedMenuItem (Gdk.Key.plus, Gdk.ModifierType.ControlMask);
zoomin.AddAccelerator ("activate", PintaCore.Actions.AccelGroup, new AccelKey (Gdk.Key.equal, Gdk.ModifierType.ControlMask, AccelFlags.Visible));
zoomin.AddAccelerator ("activate", PintaCore.Actions.AccelGroup, new AccelKey (Gdk.Key.KP_Add, Gdk.ModifierType.ControlMask, AccelFlags.Visible));
menu.Append (zoomin);
ImageMenuItem zoomout = ZoomOut.CreateAcceleratedMenuItem (Gdk.Key.minus, Gdk.ModifierType.ControlMask);
zoomout.AddAccelerator ("activate", PintaCore.Actions.AccelGroup, new AccelKey (Gdk.Key.underscore, Gdk.ModifierType.ControlMask, AccelFlags.Visible));
zoomout.AddAccelerator ("activate", PintaCore.Actions.AccelGroup, new AccelKey (Gdk.Key.KP_Subtract, Gdk.ModifierType.ControlMask, AccelFlags.Visible));
menu.Append (zoomout);
ImageMenuItem actualsize = ActualSize.CreateAcceleratedMenuItem (Gdk.Key.Key_0, Gdk.ModifierType.ControlMask);
actualsize.AddAccelerator ("activate", PintaCore.Actions.AccelGroup, new AccelKey (Gdk.Key.A, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask, AccelFlags.Visible));
menu.Append (actualsize);
menu.Append (ZoomToWindow.CreateAcceleratedMenuItem (Gdk.Key.B, Gdk.ModifierType.ControlMask));
//menu.Append (ZoomToSelection.CreateAcceleratedMenuItem (Gdk.Key.B, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
menu.Append (Fullscreen.CreateAcceleratedMenuItem (Gdk.Key.F11, Gdk.ModifierType.None));
menu.AppendSeparator ();
Gtk.Action unit_action = new Gtk.Action ("RulerUnits", Mono.Unix.Catalog.GetString ("Ruler Units"), null, null);
Menu unit_menu = (Menu)menu.AppendItem (unit_action.CreateSubMenuItem ()).Submenu;
unit_menu.Append (Pixels.CreateMenuItem ());
unit_menu.Append (Inches.CreateMenuItem ());
unit_menu.Append (Centimeters.CreateMenuItem ());
menu.AppendSeparator ();
menu.Append (show_pad);
}
示例6: CreateMainMenu
public void CreateMainMenu(Gtk.Menu menu)
{
menu.Remove (menu.Children[1]);
menu.Append (CropToSelection.CreateAcceleratedMenuItem (Gdk.Key.X, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
menu.Append (Resize.CreateAcceleratedMenuItem (Gdk.Key.R, Gdk.ModifierType.ControlMask));
menu.Append (CanvasSize.CreateAcceleratedMenuItem (Gdk.Key.R, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
menu.AppendSeparator ();
menu.Append (FlipHorizontal.CreateMenuItem ());
menu.Append (FlipVertical.CreateMenuItem ());
menu.AppendSeparator ();
menu.Append (RotateCW.CreateAcceleratedMenuItem (Gdk.Key.H, Gdk.ModifierType.ControlMask));
menu.Append (RotateCCW.CreateAcceleratedMenuItem (Gdk.Key.G, Gdk.ModifierType.ControlMask));
menu.Append (Rotate180.CreateAcceleratedMenuItem (Gdk.Key.J, Gdk.ModifierType.ControlMask));
menu.AppendSeparator ();
menu.Append (Flatten.CreateAcceleratedMenuItem (Gdk.Key.F, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
}
示例7: RemoveRow
public static Gtk.TreeStore RemoveRow(Gtk.TreeView tv, Gtk.TreeStore store)
{
TreeModel model;
TreeIter iter1;
if (tv.Selection.GetSelected (out model, out iter1)) {
store.Remove(ref iter1);
}
return store;
}
示例8: CreateMainMenu
public void CreateMainMenu(Gtk.Menu menu)
{
menu.Remove (menu.Children[1]);
menu.Append (New.CreateAcceleratedMenuItem (Gdk.Key.N, Gdk.ModifierType.ControlMask));
menu.Append (Open.CreateAcceleratedMenuItem (Gdk.Key.O, Gdk.ModifierType.ControlMask));
menu.Append (OpenRecent.CreateMenuItem ());
//menu.Append (Close.CreateAcceleratedMenuItem (Gdk.Key.W, Gdk.ModifierType.ControlMask));
menu.AppendSeparator ();
menu.Append (Save.CreateAcceleratedMenuItem (Gdk.Key.S, Gdk.ModifierType.ControlMask));
menu.Append (SaveAs.CreateAcceleratedMenuItem (Gdk.Key.S, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
menu.AppendSeparator ();
//menu.Append (Print.CreateAcceleratedMenuItem (Gdk.Key.P, Gdk.ModifierType.ControlMask));
//menu.AppendSeparator ();
menu.Append (Exit.CreateAcceleratedMenuItem (Gdk.Key.Q, Gdk.ModifierType.ControlMask));
}
示例9: removeSelectedElementInTreeview
/*
* Returns the value of the removed element, or null- if no element removed
*/
private String removeSelectedElementInTreeview(Gtk.TreeView target, Gtk.ListStore model)
{
Gtk.TreeIter iter;
Gtk.TreePath[] selectedRows= target.Selection.GetSelectedRows();
if(selectedRows.Length >0 )
{
model.GetIter(out iter, selectedRows[0]);
string value = (string)model.GetValue(iter, 0);
if(model.Remove(ref iter))
return value;
else
return null;
}
return null;
}
示例10: CreateMainMenu
public void CreateMainMenu(Gtk.Menu menu)
{
menu.Remove (menu.Children[1]);
menu.Append (AddNewLayer.CreateAcceleratedMenuItem (Gdk.Key.N, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
menu.Append (DeleteLayer.CreateAcceleratedMenuItem (Gdk.Key.Delete, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
menu.Append (DuplicateLayer.CreateAcceleratedMenuItem (Gdk.Key.D, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
menu.Append (MergeLayerDown.CreateAcceleratedMenuItem (Gdk.Key.M, Gdk.ModifierType.ControlMask));
menu.Append (ImportFromFile.CreateMenuItem ());
menu.AppendSeparator ();
menu.Append (FlipHorizontal.CreateMenuItem ());
menu.Append (FlipVertical.CreateMenuItem ());
//menu.Append (RotateZoom.CreateAcceleratedMenuItem (Gdk.Key.Z, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
menu.AppendSeparator ();
menu.Append (Properties.CreateAcceleratedMenuItem (Gdk.Key.F4, Gdk.ModifierType.None));
}
示例11: CreateMainMenu
public void CreateMainMenu(Gtk.Menu menu)
{
menu.Remove (menu.Children[1]);
menu.Append (AutoLevel.CreateAcceleratedMenuItem (Gdk.Key.L, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
menu.Append (BlackAndWhite.CreateAcceleratedMenuItem (Gdk.Key.G, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
menu.Append (BrightnessContrast.CreateAcceleratedMenuItem (Gdk.Key.C, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
menu.Append (Curves.CreateAcceleratedMenuItem (Gdk.Key.M, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
menu.Append (HueSaturation.CreateAcceleratedMenuItem (Gdk.Key.U, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
menu.Append (InvertColors.CreateAcceleratedMenuItem (Gdk.Key.I, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
//menu.Append (Levels.CreateAcceleratedMenuItem (Gdk.Key.L, Gdk.ModifierType.ControlMask));
menu.Append (Posterize.CreateAcceleratedMenuItem (Gdk.Key.P, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
menu.Append (Sepia.CreateAcceleratedMenuItem (Gdk.Key.E, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
}
示例12: RemoveMenuItems
private void RemoveMenuItems (Gtk.Menu menu)
{
#if MAC
menu.HideAll ();
#endif
foreach (Gtk.MenuItem child in menu.Children) {
menu.Remove (child);
}
}
示例13: CreateMainMenu
public void CreateMainMenu(Gtk.Menu menu)
{
menu.Remove (menu.Children[1]);
// Create Submenus
Menu artistic_sub_menu = (Menu)menu.AppendItem (Artistic.CreateSubMenuItem ()).Submenu;
Menu blur_sub_menu = (Menu)menu.AppendItem (Blurs.CreateSubMenuItem ()).Submenu;
Menu distort_sub_menu = (Menu)menu.AppendItem (Distort.CreateSubMenuItem ()).Submenu;
Menu noise_sub_menu = (Menu)menu.AppendItem (Noise.CreateSubMenuItem ()).Submenu;
Menu photo_sub_menu = (Menu)menu.AppendItem (Photo.CreateSubMenuItem ()).Submenu;
Menu render_sub_menu = (Menu)menu.AppendItem (Render.CreateSubMenuItem ()).Submenu;
Menu stylize_sub_menu = (Menu)menu.AppendItem (Stylize.CreateSubMenuItem ()).Submenu;
// Create menu items
artistic_sub_menu.Append (InkSketch.CreateMenuItem ());
artistic_sub_menu.Append (OilPainting.CreateMenuItem ());
artistic_sub_menu.Append (PencilSketch.CreateMenuItem ());
blur_sub_menu.Append (GaussianBlur.CreateMenuItem ());
photo_sub_menu.Append (Glow.CreateMenuItem ());
}
示例14: HandleBuildToolBar
public override void HandleBuildToolBar(Gtk.Toolbar tb)
{
base.HandleBuildToolBar(tb);
#region Show Arrows
//Arrow separator.
if (arrowSep == null)
{
arrowSep = new Gtk.SeparatorToolItem();
showOtherArrowOptions = false;
}
tb.AppendItem(arrowSep);
if (arrowLabel == null)
{
arrowLabel = new ToolBarLabel(string.Format(" {0}: ", Catalog.GetString("Arrow")));
}
tb.AppendItem(arrowLabel);
//Show arrow 1.
showArrowOneBox = new Gtk.CheckButton("1");
showArrowOneBox.Active = previousSettings1.Show;
showArrowOneBox.Toggled += (o, e) =>
{
//Determine whether to change the visibility of Arrow options in the toolbar based on the updated Arrow showing/hiding.
if (!showArrowOneBox.Active && !showArrowTwoBox.Active)
{
if (showOtherArrowOptions)
{
tb.Remove(arrowSizeLabel);
tb.Remove(arrowSizeMinus);
tb.Remove(arrowSize);
tb.Remove(arrowSizePlus);
tb.Remove(arrowAngleOffsetLabel);
tb.Remove(arrowAngleOffsetMinus);
tb.Remove(arrowAngleOffset);
tb.Remove(arrowAngleOffsetPlus);
tb.Remove(arrowLengthOffsetLabel);
tb.Remove(arrowLengthOffsetMinus);
tb.Remove(arrowLengthOffset);
tb.Remove(arrowLengthOffsetPlus);
showOtherArrowOptions = false;
}
}
else
{
if (!showOtherArrowOptions)
{
tb.Add(arrowSizeLabel);
tb.Add(arrowSizeMinus);
tb.Add(arrowSize);
tb.Add(arrowSizePlus);
tb.Add(arrowAngleOffsetLabel);
tb.Add(arrowAngleOffsetMinus);
tb.Add(arrowAngleOffset);
tb.Add(arrowAngleOffsetPlus);
tb.Add(arrowLengthOffsetLabel);
tb.Add(arrowLengthOffsetMinus);
tb.Add(arrowLengthOffset);
tb.Add(arrowLengthOffsetPlus);
showOtherArrowOptions = true;
}
}
LineCurveSeriesEngine activeEngine = (LineCurveSeriesEngine)ActiveShapeEngine;
if (activeEngine != null)
{
activeEngine.Arrow1.Show = showArrowOneBox.Active;
DrawActiveShape(false, false, true, false, false);
StorePreviousSettings();
}
};
tb.AddWidgetItem(showArrowOneBox);
//Show arrow 2.
showArrowTwoBox = new Gtk.CheckButton("2");
showArrowTwoBox.Active = previousSettings2.Show;
showArrowTwoBox.Toggled += (o, e) =>
{
//Determine whether to change the visibility of Arrow options in the toolbar based on the updated Arrow showing/hiding.
if (!showArrowOneBox.Active && !showArrowTwoBox.Active)
//.........这里部分代码省略.........
示例15: RemoveAllChildren
private static void RemoveAllChildren(Gtk.TreeStore model, TreeIter ti)
{
TreeIter child;
if (model.IterChildren(out child, ti)) {
int depth = model.IterDepth(ti);
while (model.Remove(ref child) && model.IterDepth(child) > depth)
;
}
}