示例#1
0
        public LauncherWidget()
        {
            var tb = new Entry("");
            tb.SetIconFromIconName(EntryIconPosition.Secondary, "search");
            tb.Changed += (s, e) => {
                ShowSearch(tb.Text);
            };

            tb.KeyReleaseEvent += (s, e) => {
                if (e.Event.Key == Gdk.Key.Return && appListStore.NColumns != 0) { //TODO: appListStore.NColumns does not work
                    hpaned.Child1.ChildFocus(DirectionType.TabForward);
                }
                if (e.Event.Key == Gdk.Key.Escape) {
                    Parent.Hide(); //TODO: detect Window
                }
            };

            tb.Margin = 5;
            //tb.BorderWidth = 1;
            PackStart(tb, false, false, 0);

            hpaned = new HPaned();

            Add(hpaned);

            /*Add(CreateList());
            Add(CreateList());*/

            var appList = CreateAppList();
            hpaned.Add1(appList);
            hpaned.Add2(CreateCatList());

            ShowAllApps();

            ShowAll();
            allButton.Active = true;
            lastActiveButton = allButton;
        }