LAST_SIGNAL
};
-typedef void (*glWdgtTextPropsSignal) (GObject * object,
- gpointer data);
+typedef void (*glWdgtTextPropsSignal) (GObject *object, gpointer data);
/*===========================================*/
/* Private globals */
/* Local function prototypes */
/*===========================================*/
-static void gl_wdgt_text_props_class_init (glWdgtTextPropsClass * class);
-static void gl_wdgt_text_props_instance_init (glWdgtTextProps * text);
-static void gl_wdgt_text_props_finalize (GObject * object);
-static void gl_wdgt_text_props_construct (glWdgtTextProps * text, gchar * label);
+static void gl_wdgt_text_props_class_init (glWdgtTextPropsClass *class);
+static void gl_wdgt_text_props_instance_init (glWdgtTextProps *text);
+static void gl_wdgt_text_props_finalize (GObject *object);
+static void gl_wdgt_text_props_construct (glWdgtTextProps *text,
+ gchar *label);
-static void changed_cb (glWdgtTextProps * text);
-static void just_toggled_cb (GtkToggleButton * togglebutton,
- gpointer user_data);
+static void family_changed_cb (GtkEntry *entry, glWdgtTextProps *text);
+static void changed_cb (glWdgtTextProps *text);
+static void just_toggled_cb (GtkToggleButton *togglebutton,
+ gpointer user_data);
\f
/*================================================================*/
/* Boilerplate Object stuff. */
}
static void
-gl_wdgt_text_props_class_init (glWdgtTextPropsClass * class)
+gl_wdgt_text_props_class_init (glWdgtTextPropsClass *class)
{
GObjectClass *object_class;
}
static void
-gl_wdgt_text_props_instance_init (glWdgtTextProps * text)
+gl_wdgt_text_props_instance_init (glWdgtTextProps *text)
{
text->font_family_entry = NULL;
text->font_size_spin = NULL;
}
static void
-gl_wdgt_text_props_finalize (GObject * object)
+gl_wdgt_text_props_finalize (GObject *object)
{
glWdgtTextProps *text;
}
GtkWidget *
-gl_wdgt_text_props_new (gchar * label)
+gl_wdgt_text_props_new (gchar *label)
{
glWdgtTextProps *text;
/* Construct composite widget. */
/*============================================================*/
static void
-gl_wdgt_text_props_construct (glWdgtTextProps * text,
- gchar * label)
+gl_wdgt_text_props_construct (glWdgtTextProps *text,
+ gchar *label)
{
GtkWidget *wvbox, *wframe, *wtable, *wlabel, *whbox1, *wcombo;
- GList *family_names = NULL;
+ GList *family_names = NULL;
GtkObject *adjust;
wvbox = GTK_WIDGET (text);
gtk_combo_set_popdown_strings (GTK_COMBO (wcombo), family_names);
gnome_font_family_list_free (family_names);
text->font_family_entry = GTK_COMBO (wcombo)->entry;
+ gtk_combo_set_value_in_list (GTK_COMBO(wcombo), TRUE, FALSE);
gtk_entry_set_editable (GTK_ENTRY (text->font_family_entry), FALSE);
gtk_widget_set_size_request (wcombo, 200, -1);
gtk_box_pack_start (GTK_BOX (whbox1), wcombo, FALSE, FALSE, 0);
- g_signal_connect_swapped (G_OBJECT (text->font_family_entry),
- "changed", G_CALLBACK (changed_cb),
- G_OBJECT (text));
+ g_signal_connect (G_OBJECT (text->font_family_entry),
+ "changed", G_CALLBACK (family_changed_cb), text);
/* Font size entry widget */
adjust = gtk_adjustment_new (1.0, 1.0, 250.0, 1.0, 10.0, 10.0);
}
+/*--------------------------------------------------------------------------*/
+/* PRIVATE. modify widget due to change in selection */
+/*--------------------------------------------------------------------------*/
+static void
+family_changed_cb (GtkEntry *entry,
+ glWdgtTextProps *text)
+{
+ gchar *family_name;
+
+ family_name = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1);
+ if ( strlen(family_name) ) {
+ /* Emit our "changed" signal */
+ g_signal_emit (G_OBJECT (text),
+ wdgt_text_props_signals[CHANGED], 0);
+ }
+ g_free (family_name);
+}
+
/*--------------------------------------------------------------------------*/
/* PRIVATE. Callback for when any control in the widget has changed. */
/*--------------------------------------------------------------------------*/
static void
-changed_cb (glWdgtTextProps * text)
+changed_cb (glWdgtTextProps *text)
{
/* Emit our "changed" signal */
g_signal_emit (G_OBJECT (text), wdgt_text_props_signals[CHANGED], 0);
/* PRIVATE. Justify toggle button callback. */
/*--------------------------------------------------------------------------*/
static void
-just_toggled_cb (GtkToggleButton * togglebutton,
- gpointer user_data)
+just_toggled_cb (GtkToggleButton *togglebutton,
+ gpointer user_data)
{
glWdgtTextProps *text = GL_WDGT_TEXT_PROPS (user_data);
/* query values from controls. */
/*====================================================================*/
void
-gl_wdgt_text_props_get_params (glWdgtTextProps * text,
- gchar ** font_family,
- gdouble * font_size,
- GnomeFontWeight * font_weight,
- gboolean * font_italic_flag,
- guint * color,
- GtkJustification * just)
+gl_wdgt_text_props_get_params (glWdgtTextProps *text,
+ gchar **font_family,
+ gdouble *font_size,
+ GnomeFontWeight *font_weight,
+ gboolean *font_italic_flag,
+ guint *color,
+ GtkJustification *just)
{
guint8 r, g, b, a;
/* fill in values and ranges for controls. */
/*====================================================================*/
void
-gl_wdgt_text_props_set_params (glWdgtTextProps * text,
- gchar * font_family,
- gdouble font_size,
- GnomeFontWeight font_weight,
- gboolean font_italic_flag,
- guint color,
+gl_wdgt_text_props_set_params (glWdgtTextProps *text,
+ gchar *font_family,
+ gdouble font_size,
+ GnomeFontWeight font_weight,
+ gboolean font_italic_flag,
+ guint color,
GtkJustification just)
{
gtk_entry_set_text (GTK_ENTRY (text->font_family_entry), font_family);