コード例 #1
0
        public HotKey SelectHotkey(HotKey hotkey, object parent = null)
        {
            HotKeySelectorDialog dialog;
            Window w;

            w      = parent != null ? (parent as Widget).Toplevel as Window : mainWindow;
            dialog = new HotKeySelectorDialog(w);
            if (dialog.Run() == (int)ResponseType.Ok)
            {
                hotkey = dialog.HotKey;
            }
            else
            {
                hotkey = null;
            }
            dialog.Destroy();
            return(hotkey);
        }
コード例 #2
0
        protected virtual void OnChangebutonClicked(object sender, System.EventArgs e)
        {
            HotKeySelectorDialog dialog = new HotKeySelectorDialog();

            dialog.TransientFor = (Gtk.Window) this.Toplevel;
            HotKey prevHotKey = cat.HotKey;

            if (dialog.Run() == (int)ResponseType.Ok)
            {
                cat.HotKey = dialog.HotKey;
                UpdateGui();
            }
            dialog.Destroy();
            if (HotKeyChanged != null)
            {
                HotKeyChanged(prevHotKey, cat);
            }
        }