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


C# ListStore.GetPath方法代码示例

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


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

示例1: PrepareTree

        void PrepareTree()
        {
            themes_tree.AppendColumn (Catalog.GetString ("Name"), new CellRendererText (), "text", COL_DISPLAY_NAME);
            // Name, object
            themes_tree.Model = store = new ListStore (typeof (string), typeof (Theme));

            TreePath path;
            TreeIter iter;

            foreach (Theme theme in ThemeManager.List)
                store.AppendValues (theme.Name, theme);

            store.GetIterFirst (out iter);
            path = store.GetPath (iter);

            themes_tree.CursorChanged += OnCursorChanged;
            themes_tree.SetCursor (path, themes_tree.Columns[0], false);
        }
开发者ID:GNOME,项目名称:mistelix,代码行数:18,代码来源:ThemeSelectionDialog.cs

示例2: EditModsDialog

        public EditModsDialog(Window parent, Instance inst)
            : base("Edit Mods", parent)
        {
            this.inst = inst;

            XML gxml = new XML(null, "MultiMC.GTKGUI.EditModsDialog.glade",
                "vboxEditMods", null);
            gxml.Autoconnect(this);

            this.VBox.PackStart(vboxEditMods);

            this.AddButton("_Cancel", ResponseType.Cancel);
            this.AddButton("_OK", ResponseType.Ok);

            WidthRequest = 600;
            HeightRequest = 500;
            // the Jar page is active by default. FIXME: determine dynamically!
            currentMode = Mode.Jar;

            modStore = new ListStore(typeof(string), typeof(Mod));
            jarModList.Model = modStore;
            jarModList.AppendColumn("Mod Name", new CellRendererText(), "text", 0);

            mlModStore = new ListStore(typeof(string), typeof(Mod));
            mlModList.Model = mlModStore;
            mlModList.AppendColumn("Mod Name", new CellRendererText(), "text", 0);

            //mlModList.Selection.Mode = SelectionMode.Multiple;

            inst.InstMods.ModFileChanged += (o, args) => LoadModList();

            // Listen for key presses
            jarModList.KeyPressEvent += new KeyPressEventHandler(jarModList_KeyPressEvent);
            mlModList.KeyPressEvent += new KeyPressEventHandler(mlModList_KeyPressEvent);

            // set up drag & drop
            jarModList.EnableModelDragDest(targetEntries,Gdk.DragAction.Default);
            jarModList.EnableModelDragSource(Gdk.ModifierType.Button1Mask,srcEntries,Gdk.DragAction.Move);
            jarModList.DragDataReceived += OnDragDataReceived;
            jarModList.DragDataGet += (object o, DragDataGetArgs args) =>
            {
                TreeIter iter;
                TreeModel model;
                if(!jarModList.Selection.GetSelected (out iter))
                    return;
                Gdk.Atom[] targets = args.Context.Targets;
                TreePath tp = modStore.GetPath(iter);
                int idx = tp.Indices[0];

                args.SelectionData.Set(targets[0],0,System.Text.Encoding.UTF8.GetBytes( idx.ToString() ));
            };

            Drag.DestSet(mlModList, DestDefaults.All, targetEntries, Gdk.DragAction.Default);
            mlModList.DragDataReceived += OnDragDataReceived;
            mlModList.EnableModelDragDest(targetEntries,Gdk.DragAction.Default);
        }
开发者ID:Glought,项目名称:MultiMC,代码行数:56,代码来源:EditModsDialog.cs

示例3: Fen_Menu

        public Fen_Menu()
            : base(Gtk.WindowType.Toplevel)
        {
            this.Build ();
            //graphical debug
            if ( Debug.ModeDebug && Debug.ModeDebugGraphique)
            {
                Debug.winDebug = new FEN_Debug();
                Debug.winDebug.Show();
            }
            ListStore ListMenu = new Gtk.ListStore (typeof (Gdk.Pixbuf),typeof (string));
            TREE_Menu.Model=ListMenu;
            TREE_Menu.AppendColumn ("", new Gtk.CellRendererPixbuf (), "pixbuf", 0);
            // Create a column for the package name
            Gtk.TreeViewColumn ListColumn = new Gtk.TreeViewColumn ();
            ListColumn.Title = "Module";
            /*ListColumn.FixedWidth=70;
            ListColumn.MaxWidth=70;
            ListColumn.MinWidth=70;*/
            Gtk.CellRendererText ListCell = new Gtk.CellRendererText ();
            // Add the cell to the column
            ListColumn.PackStart (ListCell, true);
            TREE_Menu.AppendColumn (ListColumn);
            ListColumn.AddAttribute (ListCell, "text", 1);
            // Event on treeview
            TREE_Menu.Selection.Changed += OnSelectionEntryUpdate;

            Pixbuf icoSys = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.system.png");
            iter = ListMenu.AppendValues(icoSys.ScaleSimple(20,20, Gdk.InterpType.Nearest),cch_system);
            this.TREE_Menu.SetCursor(ListMenu.GetPath(iter),TREE_Menu.GetColumn(1),false);
            Pixbuf icoDate = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.datetime.png");
            ListMenu.AppendValues(icoDate.ScaleSimple(20,20, Gdk.InterpType.Nearest), cch_datetime);
            Pixbuf icoUsers = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.users.png");
            ListMenu.AppendValues(icoUsers.ScaleSimple(20,20, Gdk.InterpType.Nearest), cch_users);
            Pixbuf icoX = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.xorg.png");
            ListMenu.AppendValues(icoX.ScaleSimple(20,20, Gdk.InterpType.Nearest), cch_xorg);
            Pixbuf icoupdate = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.update.png");
            ListMenu.AppendValues(icoupdate.ScaleSimple(20,20, Gdk.InterpType.Nearest),cch_update);
            Pixbuf icoupdateConf = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.updateconf.png");
            ListMenu.AppendValues(icoupdateConf.ScaleSimple(20,20, Gdk.InterpType.Nearest),cch_updateConf);
            Pixbuf icopkg = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.packages.png");
            ListMenu.AppendValues(icopkg.ScaleSimple(20,20, Gdk.InterpType.Nearest),cch_packages);
            Pixbuf icohardware = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.hardware.png");
            ListMenu.AppendValues(icohardware.ScaleSimple(20,20, Gdk.InterpType.Nearest),cch_hardware);
            Pixbuf icoservices = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.services.png");
            ListMenu.AppendValues(icoservices.ScaleSimple(20,20, Gdk.InterpType.Nearest),cch_services);
            Pixbuf iconet = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.network.png");
            ListMenu.AppendValues(iconet.ScaleSimple(20,20, Gdk.InterpType.Nearest),cch_network);
            Pixbuf icologin = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.loginmanager.png");
            ListMenu.AppendValues(icologin.ScaleSimple(20,20, Gdk.InterpType.Nearest),cch_loginManager);
            string ouput = Outils.getoutput("uname -a");
            if (ouput.IndexOf("i686") >=0 || ouput.IndexOf("x86_64")>=0)
            {
                Pixbuf icogrub = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.grub.png");
                ListMenu.AppendValues(icogrub.ScaleSimple(20,20, Gdk.InterpType.Nearest),cch_grub);
            }
            Pixbuf icosup = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.support.png");
            ListMenu.AppendValues(icosup.ScaleSimple(20,20, Gdk.InterpType.Nearest),cch_support);
            Pixbuf iconews = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.news.png");
            ListMenu.AppendValues(iconews.ScaleSimple(20,20, Gdk.InterpType.Nearest),cch_news);
            Pixbuf icologs = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.logs.png");
            ListMenu.AppendValues(icologs.ScaleSimple(20,20, Gdk.InterpType.Nearest),cch_logs);
            Pixbuf iconotes = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.notes.png");
            ListMenu.AppendValues(iconotes.ScaleSimple(20,20, Gdk.InterpType.Nearest),cch_notes);
            Pixbuf icoconfig = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.configurations.png");
            ListMenu.AppendValues(icoconfig.ScaleSimple(20,20, Gdk.InterpType.Nearest),cch_configuration);
            Pixbuf icoabout = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.about.png");
            ListMenu.AppendValues(icoabout.ScaleSimple(20,20, Gdk.InterpType.Nearest),cch_about);
        }
开发者ID:frugalware,项目名称:frugal-tweak,代码行数:69,代码来源:Fen_Menu.cs


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