protected void OnPreferencesActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { var dialog = new PreferencesDialog(Parent); dialog.Show(); } catch (Exception ex) { Frontend.ShowException(Parent, ex); } }
protected void OnPreferencesActionActivated(object sender, EventArgs e) { Trace.Call(sender, e); try { var builder = new Gtk.Builder(null, "PreferencesDialog2.ui", null); var widget = (Gtk.Widget)builder.GetObject("PreferencesDialog"); var dialog = new PreferencesDialog(Parent, builder, widget.Handle); dialog.Show(); } catch (Exception ex) { Frontend.ShowException(Parent, ex); } }
private void OnStatusIconPopupMenu(object sender, EventArgs e) { Trace.Call(sender, e); Gtk.Menu menu = new Gtk.Menu(); Gtk.ImageMenuItem preferencesItem = new Gtk.ImageMenuItem( Gtk.Stock.Preferences, null ); preferencesItem.Activated += delegate { try { var builder = new Gtk.Builder(null, "PreferencesDialog2.ui", null); var widget = (Gtk.Widget)builder.GetObject("PreferencesDialog"); var dialog = new PreferencesDialog(f_MainWindow, builder, widget.Handle); dialog.Show(); } catch (Exception ex) { Frontend.ShowException(ex); } }; menu.Add(preferencesItem); menu.Add(new Gtk.SeparatorMenuItem()); Gtk.ImageMenuItem quitItem = new Gtk.ImageMenuItem( Gtk.Stock.Quit, null ); quitItem.Activated += delegate { try { Frontend.Quit(); } catch (Exception ex) { Frontend.ShowException(ex); } }; menu.Add(quitItem); menu.ShowAll(); menu.Popup(); }