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


C# Toolbar.GetItemIndex方法代码示例

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


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

示例1: PopulateToolbarPlaceholder

        public void PopulateToolbarPlaceholder (Toolbar toolbar, string path, Widget item, bool expand)
        {
            ToolItem placeholder = (ToolItem)UIManager.GetWidget (path);
            int position = toolbar.GetItemIndex (placeholder);
            toolbar.Remove (placeholder);

            if (item is ToolItem) {
                ((ToolItem)item).Expand = expand;
                toolbar.Insert ((ToolItem)item, position);
            } else {
                ToolItem container_item = new Hyena.Widgets.GenericToolItem<Widget> (item);
                container_item.Expand = expand;
                container_item.Show ();
                container_item.ToolbarReconfigured += (o, a) => {
                    SetItemSize (container_item, container_item.IconSize);
                };
                toolbar.Insert (container_item, position);
            }
        }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:19,代码来源:ActionManager.cs

示例2: SwapSeekSlider

        private void SwapSeekSlider()
        {
            // ripped off of Moblin extension

            // First grab the type and instance of the primary window
            // and make sure we're only hacking the Nereid UI
            var pwin = elements_service.PrimaryWindow;
            var pwin_type = pwin.GetType ();
            if (pwin_type.FullName != "Nereid.PlayerInterface") {
                return;
            }

            // Find ConnectedSeekSlider
            pwin_toolbar = (Toolbar)pwin_type.GetProperty ("HeaderToolbar").GetValue (pwin, null);
            foreach (var child in pwin_toolbar.Children) {
                if (child.GetType ().FullName.StartsWith ("Banshee.Widgets.GenericToolItem")) {
                    var c = child as Container;
                    if (c != null && c.Children[0] is ConnectedSeekSlider) {
                        connected_toolitem = child as ToolItem;
                        break;
                    }
                }
            }

            // swap original ConnectedSeekSlider with new ConnectedMoodSeekSlider
            var pos = pwin_toolbar.GetItemIndex (connected_toolitem as ToolItem);
            pwin_toolbar.Remove (connected_toolitem as Gtk.ToolItem);

            ConnectedMoodbarSeekSlider connected_moodbar_seek_slider;
            connected_moodbar_seek_slider = new ConnectedMoodbarSeekSlider ();
            connected_moodbar_seek_slider.Show ();

            moodbar_toolitem = new GenericToolItem<ConnectedMoodbarSeekSlider> (connected_moodbar_seek_slider);
            moodbar_toolitem.Show ();
            pwin_toolbar.Insert (moodbar_toolitem, pos);
        }
开发者ID:X4lldux,项目名称:banshee-moodbar-extension,代码行数:36,代码来源:MoodbarService.cs


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