当前位置: 首页>>代码示例>>C#>>正文


C# Gtk类代码示例

本文整理汇总了C#中Gtk的典型用法代码示例。如果您正苦于以下问题:C# Gtk类的具体用法?C# Gtk怎么用?C# Gtk使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Gtk类属于命名空间,在下文中一共展示了Gtk类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TransactedTreeBuilder

			public TransactedTreeBuilder (ExtensibleTreeView tree, TransactedNodeStore tstore, Gtk.TreeIter it)
			{
				this.tree = tree;
				this.tstore = tstore;
				navigator = new TreeNodeNavigator (tree, it);
				CheckNode ();
			}
开发者ID:KseniaVensko,项目名称:gap-develop,代码行数:7,代码来源:TransactedTreeBuilder.cs

示例2: AppChooserDialog

		public AppChooserDialog (Gtk.Window parent, Gtk.DialogFlags flags, GLib.IFile file) : base (IntPtr.Zero)
		{
			if (GetType () != typeof (AppChooserDialog)) {
				throw new InvalidOperationException ("Can't override this constructor.");
			}
			Raw = gtk_app_chooser_dialog_new(parent == null ? IntPtr.Zero : parent.Handle, (int) flags, file == null ? IntPtr.Zero : ((file is GLib.Object) ? (file as GLib.Object).Handle : (file as GLib.FileAdapter).Handle));
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:7,代码来源:AppChooserDialog.cs

示例3: BankNumber_Edited

        private void BankNumber_Edited(object o, Gtk.EditedArgs args)
        {
            // Set and Get data
            Gtk.TreeIter iter;
            Gtk.TreePath treepath = new Gtk.TreePath (args.Path);
            Gtk.CellRendererText nextCell = (Gtk.CellRendererText)checktableview.columnList [(int)ColumnType.BRANCH_NUMBER].Cell;
            Gtk.TreeViewColumn nextColumn = checktableview.columnList [(int)ColumnType.BRANCH_NUMBER].Column;
            string text = args.NewText;

            checkPropsList.GetIter (out iter, treepath);

            BL.CheckClass check = (BL.CheckClass)checkPropsList.GetValue (iter, 0);
            String formattedNumber = BL.Formatter.ZeroPad (text, BL.Constants.LENGTH_NUM_BANK);

            if (formattedNumber != null) {
                check.BankNumber = formattedNumber;
                // Move to next cell
                checktableview.SetCursorOnCell (treepath, nextColumn, nextCell, true);
            } else if (!text.Equals ("")) {
                Gtk.MessageDialog dialog = InvalidEntryDialog ("Número de banco inválido!");
                Gtk.ResponseType result = (Gtk.ResponseType)dialog.Run ();
                if (result == Gtk.ResponseType.Ok)
                    dialog.Destroy ();
            }
        }
开发者ID:reneoctavio,项目名称:Cheque,代码行数:25,代码来源:AddCheckTable.cs

示例4: ReplaceChild

		protected override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild)
		{
			if (oldChild == expander.LabelWidget)
				expander.LabelWidget = newChild;
			else
				base.ReplaceChild (oldChild, newChild);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:Expander.cs

示例5: Initialize

 internal static void Initialize(Gtk.Widget iconRenderer)
 {
     if ((Stetic.Gui.initialized == false)) {
         Stetic.Gui.initialized = true;
         global::Gtk.IconFactory w1 = new global::Gtk.IconFactory ();
         global::Gtk.IconSet w2 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("DCPPacker.resources.page_white_add.png"));
         w1.Add ("page-white-add", w2);
         global::Gtk.IconSet w3 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("DCPPacker.resources.folder_add.png"));
         w1.Add ("folder-add", w3);
         global::Gtk.IconSet w4 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("DCPPacker.resources.page_white_delete.png"));
         w1.Add ("page-white-delete", w4);
         global::Gtk.IconSet w5 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("DCPPacker.resources.page_white_copy.png"));
         w1.Add ("page-white-copy", w5);
         global::Gtk.IconSet w6 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("DCPPacker.resources.folder_delete.png"));
         w1.Add ("folder-delete", w6);
         global::Gtk.IconSet w7 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("DCPPacker.resources.page_white_zip.png"));
         w1.Add ("page-white-zip", w7);
         global::Gtk.IconSet w8 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("DCPPacker.resources.page_white_stack.png"));
         w1.Add ("page-white-stack", w8);
         global::Gtk.IconSet w9 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("DCPPacker.resources.package.png"));
         w1.Add ("package", w9);
         global::Gtk.IconSet w10 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("DCPPacker.resources.package_add.png"));
         w1.Add ("package-add", w10);
         global::Gtk.IconSet w11 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("DCPPacker.resources.package_delete.png"));
         w1.Add ("package-delete", w11);
         global::Gtk.IconSet w12 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("DCPPacker.resources.folder.png"));
         w1.Add ("folder", w12);
         global::Gtk.IconSet w13 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("DCPPacker.resources.disk.png"));
         w1.Add ("disk", w13);
         w1.AddDefault ();
     }
 }
开发者ID:AuthenticEshkinKot,项目名称:DGLE,代码行数:32,代码来源:generated.cs

示例6: Shake

        public static void Shake(Gtk.Window window, int times)
        {
            int winX, winY;

            Gtk.Application.Invoke(delegate {
                window.GetPosition(out winX, out winY);

                for (int i=10; i > 0; i--) {
                    for (int j=times; j > 0; j--) {
                        MoveBy(window, 0, i);
                        TimeUtils.Sleep(5);

                        MoveBy(window, i, 0);
                        TimeUtils.Sleep(5);

                        MoveBy(window, 0, -i);
                        TimeUtils.Sleep(5);

                        MoveBy(window, -i, 0);
                        TimeUtils.Sleep(5);
                    }
                }

                window.Move(winX, winY);
            });
        }
开发者ID:BackupTheBerlios,项目名称:niry-sharp-svn,代码行数:26,代码来源:WindowUtils.cs

示例7: GetValue

		public object GetValue (Gtk.TreeIter iter, int column) {
			GLib.Value val = GLib.Value.Empty;
			GetValue (iter, column, ref val);
			object ret = val.Val;
			val.Dispose ();
			return ret;
		}
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:7,代码来源:TreeModelAdapter.cs

示例8: StatType

    //comes from gui/stats.cs
    public StatType(string statisticType, string statisticSubType, string statisticApplyTo, Gtk.TreeView treeview_stats,
			ArrayList sendSelectedSessions, bool sex_active, int statsJumpsType, int limit, 
			ArrayList markedRows, int evolution_mark_consecutives, GraphROptions gRO,
			bool graph, bool toReport, Preferences preferences)
    {
        //some of this will disappear when we use myStatTypeStruct in all classes:
        this.statisticType = statisticType;
        this.statisticSubType = statisticSubType;
        this.statisticApplyTo = statisticApplyTo;
        this.treeview_stats = treeview_stats ;

        this.markedRows = markedRows;

        this.evolution_mark_consecutives = evolution_mark_consecutives;

        this.graph = graph;
        this.toReport = toReport;

        myStatTypeStruct = new StatTypeStruct (
                statisticApplyTo,
                sendSelectedSessions, sex_active,
                statsJumpsType, limit,
                markedRows, gRO,
                toReport, preferences);

        myStat = new Stat(); //create an instance of myStat

        fakeButtonRowCheckedUnchecked = new Gtk.Button();
        fakeButtonRowsSelected = new Gtk.Button();
        fakeButtonNoRowsSelected = new Gtk.Button();
    }
开发者ID:GNOME,项目名称:chronojump,代码行数:32,代码来源:statType.cs

示例9: on_new_key_release

        protected void on_new_key_release(System.Object sender, Gtk.KeyReleaseEventArgs e)
        {
            VoidFunction<Widget> on_element_found = null;

            if (e.Event.Key == Gdk.Key.Escape) // cancel
            {
                on_element_found = delegate(Widget w) { w.Destroy(); };
            }
            else if (e.Event.Key == Gdk.Key.Return || e.Event.Key == Gdk.Key.KP_Enter) // ok
            {
                on_element_found = delegate(Widget w) {
                    if (w.Name == "new_label") {
                        string text = ((Gtk.Entry)w).Text;

                        if (category.exists(text))
                            return;

                        category.add_label(text);
                    }
                };
            }

            if (on_element_found != null) // do it
                foreach (Gtk.Widget w in representation)
                    if (w.Name == "new_label") {
                        on_element_found(w);
                        break;
                    }
        }
开发者ID:GNOME,项目名称:nemo,代码行数:29,代码来源:CategoryDrawer.cs

示例10: MainWindow

		public MainWindow(Gtk.NodeStore noteStore)
			: base(Gtk.WindowType.Toplevel)
		{
			Build();
			this.noteStore = noteStore;
			SetupUi();
		}
开发者ID:cgt,项目名称:Notes,代码行数:7,代码来源:MainWindow.cs

示例11: Initialize

		internal static void Initialize (Gtk.Widget iconRenderer)
		{
			if ((Stetic.Gui.initialized == false)) {
				Stetic.Gui.initialized = true;
				global::Gtk.IconFactory w1 = new global::Gtk.IconFactory ();
				global::Gtk.IconSet w2 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("MyNesGTK.resources.MyNes.ico"));
				w1.Add ("MyNesIcon", w2);
				global::Gtk.IconSet w3 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("MyNesGTK.resources.monitor.png"));
				w1.Add ("VideoSettings", w3);
				global::Gtk.IconSet w4 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("MyNesGTK.resources.sound.png"));
				w1.Add ("Audio", w4);
				global::Gtk.IconSet w5 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("MyNesGTK.resources.folder_wrench.png"));
				w1.Add ("Paths", w5);
				global::Gtk.IconSet w6 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("MyNesGTK.resources.wrench.png"));
				w1.Add ("Preferences", w6);
				global::Gtk.IconSet w7 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("MyNesGTK.resources.color_wheel.png"));
				w1.Add ("Palette", w7);
				global::Gtk.IconSet w8 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("MyNesGTK.resources.controller.png"));
				w1.Add ("Input", w8);
				global::Gtk.IconSet w9 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("MyNesGTK.resources.control_play.png"));
				w1.Add ("Play", w9);
				global::Gtk.IconSet w10 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("MyNesGTK.resources.control_eject.png"));
				w1.Add ("Stop", w10);
				w1.AddDefault ();
			}
		}
开发者ID:ywjno,项目名称:mynes-code,代码行数:26,代码来源:generated.cs

示例12: ReplaceChild

        public static void ReplaceChild(Gtk.Widget oldWidget, Gtk.Widget newWidget)
        {
            Gtk.Container cont = oldWidget.Parent as Gtk.Container;
            if (cont == null)
                return;

            if (cont is IGtkContainer) {
                ((IGtkContainer)cont).ReplaceChild (oldWidget, newWidget);
            }
            else if (cont is Gtk.Notebook) {
                Gtk.Notebook notebook = (Gtk.Notebook) cont;
                Gtk.Notebook.NotebookChild nc = (Gtk.Notebook.NotebookChild) notebook[oldWidget];
                var detachable = nc.Detachable;
                var pos = nc.Position;
                var reorderable = nc.Reorderable;
                var tabExpand = nc.TabExpand;
                var tabFill = nc.TabFill;
                var label = notebook.GetTabLabel (oldWidget);
                notebook.Remove (oldWidget);
                notebook.InsertPage (newWidget, label, pos);

                nc = (Gtk.Notebook.NotebookChild) notebook[newWidget];
                nc.Detachable = detachable;
                nc.Reorderable = reorderable;
                nc.TabExpand = tabExpand;
                nc.TabFill = tabFill;
            }
            else if (cont is Gtk.Bin) {
                ((Gtk.Bin)cont).Remove (oldWidget);
                ((Gtk.Bin)cont).Child  = newWidget;
            }
        }
开发者ID:samclarke,项目名称:xwt,代码行数:32,代码来源:GtkEngine.cs

示例13: Replace

 public void Replace(Gtk.Bin parent)
 {
     Gtk.Widget c = parent.Child;
     parent.Remove (c);
     Add (c);
     parent.Add (this);
 }
开发者ID:JamesChan,项目名称:mono-addins,代码行数:7,代码来源:HeaderBox.cs

示例14: Put

 public void Put(Gtk.Widget widget, int x, int y)
 {
     children.Add (new LayoutChild (widget, x, y));
     if (IsRealized)
         widget.ParentWindow = GdkWindow;
     widget.Parent = this;
 }
开发者ID:nathansamson,项目名称:F-Spot-Album-Exporter,代码行数:7,代码来源:ImageView_Container.cs

示例15: RatingFilterDialog

        public RatingFilterDialog(FSpot.PhotoQuery query, Gtk.Window parent_window)
            : base("RatingFilterDialog.ui", "rating_filter_dialog")
        {
            this.query = query;
            this.parent_window = parent_window;
            TransientFor = parent_window;
            DefaultResponse = ResponseType.Ok;
            ok_button.GrabFocus ();

            if (query.RatingRange != null) {
                minrating_value = (int) query.RatingRange.MinRating;
                maxrating_value = (int) query.RatingRange.MaxRating;
            }
            minrating = new Rating (minrating_value);
            maxrating = new Rating (maxrating_value);
            minrating_hbox.PackStart (minrating, false, false, 0);
            maxrating_hbox.PackStart (maxrating, false, false, 0);

            ResponseType response = (ResponseType) Run ();

            if (response == ResponseType.Ok) {
                query.RatingRange = new RatingRange ((uint) minrating.Value, (uint) maxrating.Value);
            }

            Destroy ();
        }
开发者ID:iainlane,项目名称:f-spot,代码行数:26,代码来源:RatingFilterDialog.cs


注:本文中的Gtk类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。