private void OnFont(object o, EventArgs args)
 {
     FontSelectionDialog fs = new FontSelectionDialog("Choose font");
     int response = fs.Run();
     fs.Destroy();
     if (response == (int)Gtk.ResponseType.Cancel
             || response == (int)Gtk.ResponseType.None
             || response == (int)Gtk.ResponseType.DeleteEvent)
     {
         return;
     }
     try {
         textEditor.Font = FontDescription.FromString(fs.FontName);
     } catch (Exception e) {
         ShowError("Error setting font");
     }
 }
		// Font Change handler

		void OnFontButtonClicked (object sender, EventArgs args)
		{
			Gtk.FontSelectionDialog font_dialog =
			        new Gtk.FontSelectionDialog (
			        Catalog.GetString ("Choose Note Font"));

			string font_name = (string)
			                   Preferences.Get (Preferences.CUSTOM_FONT_FACE);
			font_dialog.SetFontName (font_name);

			if ((int) Gtk.ResponseType.Ok == font_dialog.Run ()) {
				if (font_dialog.FontName != font_name) {
					Preferences.Set (Preferences.CUSTOM_FONT_FACE,
					                 font_dialog.FontName);

					UpdateFontButton (font_dialog.FontName);
				}
			}

			font_dialog.Destroy ();
		}
Exemple #3
0
	public void OnSettingsSelectFont (object sender, EventArgs args)
	{
		FontSelectionDialog fsd = new FontSelectionDialog ("Select Font");
		try {
			fsd.SetFontName (Font);
			if (fsd.Run () == (int)Gtk.ResponseType.Ok) {
				Font = fsd.FontName;
			}
		}
		finally {
			fsd.Destroy ();
		}
	}
Exemple #4
0
        protected virtual void OnTextFontBrowseButtonClicked(object sender, System.EventArgs e)
        {
            FontSelectionDialog FontDlg = new FontSelectionDialog("Select I/O Text Font");
             FontDlg.SetFontName(TextFont);

             try
             {
            if (FontDlg.Run() == (int) ResponseType.Ok)
            {
               TextFont = FontDlg.FontName;
            }
             }
             finally
             {
            FontDlg.Destroy();
             }
        }
Exemple #5
0
 void CreateFontWidget()
 {
     var font = new Button(Stock.SelectFont);
       font.Clicked += delegate
     {
       var fs = new FontSelectionDialog(_("Select Font"));
       fs.Run();
       fs.Hide();
     };
       AttachAligned(0, 2, _("Font:"), 0.0, 0.5, font, 1, true);
 }