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); }
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); } }