Ktam3874/pitx software guide – Kontron KTAM3874-pITX User Manual
Page 165

KTD-S0057-I
Page 161 Linux® Programming Examples (DebianTM)
KTAM3874/pITX Software Guide
static void font_dialog (void)
{
GtkWidget
*fontwgt;
PangoContext
*context;
PangoFontDescription
*fontdesc;
gchar
*tmp;
static gchar font [64] = "\0";
fontwgt = gtk_font_chooser_dialog_new (FONT_TITLE, (GtkWindow *) NULL);
if (! g_ascii_isalpha (font[0]))
{
context = gtk_widget_create_pango_context (GET_FONT_WIDGET);
fontdesc = pango_context_get_font_description (context);
tmp = (gchar *) pango_font_description_to_string (fontdesc);
g_stpcpy (font, tmp);
g_free
(tmp);
pango_font_description_free
(fontdesc);
}
gtk_font_chooser_set_font
(GTK_FONT_CHOOSER (fontwgt), font);
if (gtk_dialog_run (GTK_DIALOG (fontwgt)) == GTK_RESPONSE_OK)
{
tmp = gtk_font_chooser_get_font (GTK_FONT_CHOOSER (fontwgt));
g_stpcpy (font, tmp);
fontdesc = pango_font_description_from_string (tmp);
gtk_widget_override_font (GET_FONT_WIDGET, fontdesc);
pango_font_description_free
(fontdesc);
g_free
(tmp);
}
gtk_widget_destroy
(fontwgt);
}
static gint radius_dialog_value (gboolean update, gint val)
{
static gint radius_value = 0;
if
(update)
radius_value = val;
return
radius_value;
}
static void radius_dialog (void)
{
GtkWidget
*dialog,
*content,
*scale;
gdouble
width;
gint
value;