Пример #1
0
static void
glade_popup_clear_property_cb (GtkMenuItem *item, GladeProperty *property)
{
  GValue value = { 0, };

  glade_property_get_default (property, &value);
  glade_command_set_property_value (property, &value);
  g_value_unset (&value);
}
Пример #2
0
static void
label_toggled (GtkWidget * widget,
	       GladeToolItemGroupEditor *group_editor)
{
  GladeProperty *property;
  GladeWidget   *gwidget = glade_editable_loaded_widget (GLADE_EDITABLE (group_editor));
  GValue value = { 0, };

  if (glade_editable_loading (GLADE_EDITABLE (group_editor)) || !gwidget)
    return;

  if (!gtk_toggle_button_get_active
      (GTK_TOGGLE_BUTTON (group_editor->label_radio)))
    return;

  glade_editable_block (GLADE_EDITABLE (group_editor));

  glade_command_push_group (_("Setting %s to use standard label text"),
                            glade_widget_get_name (gwidget));

  property = glade_widget_get_property (gwidget, "label-widget");
  glade_command_set_property (property, NULL);

  property = glade_widget_get_property (gwidget, "label");
  glade_property_get_default (property, &value);
  glade_command_set_property_value (property, &value);
  g_value_unset (&value);
  property = glade_widget_get_property (gwidget, "custom-label");
  glade_command_set_property (property, FALSE);

  glade_command_pop_group ();

  glade_editable_unblock (GLADE_EDITABLE (group_editor));

  /* reload buttons and sensitivity and stuff... */
  glade_editable_load (GLADE_EDITABLE (group_editor), gwidget);
}