* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#include <config.h>
+#include "config.h"
#include "gtkfontbutton.h"
-#include "gtksignal.h"
#include "gtkmain.h"
#include "gtkalignment.h"
#include "gtkhbox.h"
GtkWidget *
gtk_font_button_new_with_font (const gchar *fontname)
{
- return g_object_new (GTK_TYPE_FONT_BUTTON, "font_name", fontname, NULL);
+ return g_object_new (GTK_TYPE_FONT_BUTTON, "font-name", fontname, NULL);
}
/**
* gtk_font_button_get_font_name:
* @font_button: a #GtkFontButton
*
- * Retrieves the name of the currently selected font.
+ * Retrieves the name of the currently selected font. This name includes
+ * style and size information as well. If you want to render something
+ * with the font, use this string with pango_font_description_from_string() .
+ * If you're interested in peeking certain values (family name,
+ * style, size, weight) just query these properties from the
+ * #PangoFontDescription object.
*
* Returns: an internal copy of the font name which must not be freed.
*
font_dialog = GTK_FONT_SELECTION_DIALOG (font_button->priv->font_dialog);
- if (GTK_WIDGET_TOPLEVEL (parent) && GTK_IS_WINDOW (parent))
+ if (gtk_widget_is_toplevel (parent) && GTK_IS_WINDOW (parent))
{
if (GTK_WINDOW (parent) != gtk_window_get_transient_for (GTK_WINDOW (font_dialog)))
gtk_window_set_transient_for (GTK_WINDOW (font_dialog), GTK_WINDOW (parent));
G_CALLBACK (dialog_destroy), font_button);
}
- if (!GTK_WIDGET_VISIBLE (font_button->priv->font_dialog))
+ if (!gtk_widget_get_visible (font_button->priv->font_dialog))
{
font_dialog = GTK_FONT_SELECTION_DIALOG (font_button->priv->font_dialog);
gint n_families, n_faces, i;
n_families = 0;
+ families = NULL;
pango_context_list_families (gtk_widget_get_pango_context (GTK_WIDGET (font_button)),
&families, &n_families);
n_faces = 0;