Beispiel #1
0
static void
glade_eprop_icon_sources_load (GladeEditorProperty * eprop,
                               GladeProperty * property)
{
  GladeEditorPropertyClass *parent_class =
      g_type_class_peek_parent (GLADE_EDITOR_PROPERTY_GET_CLASS (eprop));
  GladeEPropIconSources *eprop_sources = GLADE_EPROP_ICON_SOURCES (eprop);

  /* Chain up in a clean state... */
  parent_class->load (eprop, property);

  icon_sources_populate_store (eprop_sources);

  gtk_widget_queue_draw (GTK_WIDGET (eprop_sources->view));
}
Beispiel #2
0
static void
glade_eprop_model_data_load (GladeEditorProperty * eprop,
                             GladeProperty * property)
{
  GladeEditorPropertyClass *parent_class =
      g_type_class_peek_parent (GLADE_EDITOR_PROPERTY_GET_CLASS (eprop));
  GladeEPropModelData *eprop_data = GLADE_EPROP_MODEL_DATA (eprop);

  clear_view (eprop);

  /* Chain up in a clean state... */
  parent_class->load (eprop, property);

  gtk_tree_view_set_model (eprop_data->view, NULL);
  if (!property)
    return;

  if ((eprop_data->store = eprop_model_data_generate_store (eprop)) != NULL)
    {
      eprop_data->selection = gtk_tree_view_get_selection (eprop_data->view);

      /* Pass ownership of the store to the view... */
      gtk_tree_view_set_model (eprop_data->view,
                               GTK_TREE_MODEL (eprop_data->store));
      g_object_unref (G_OBJECT (eprop_data->store));

      g_signal_connect (G_OBJECT (eprop_data->store), "row-deleted",
                        G_CALLBACK (eprop_treeview_row_deleted), eprop);
    }

  /* Create new columns with renderers */
  eprop_model_data_generate_columns (eprop);

  if (eprop_data->store)
    {
      if (eprop_data->adding_row)
        eprop_data_focus_new (eprop_data);
      else if (eprop_data->want_focus &&
               eprop_data->editing_row >= 0 && eprop_data->editing_column >= 0)
	eprop_data_focus_editing_cell (eprop_data);
    }
}
Beispiel #3
0
static void
glade_eprop_accel_load (GladeEditorProperty * eprop, GladeProperty * property)
{
  GladeEditorPropertyClass *parent_class =
      g_type_class_peek_parent (GLADE_EDITOR_PROPERTY_GET_CLASS (eprop));
  GladeEPropAccel *eprop_accel = GLADE_EPROP_ACCEL (eprop);
  gchar *accels;

  /* Chain up first */
  parent_class->load (eprop, property);

  if (property == NULL)
    return;

  if ((accels =
       glade_accels_make_string (g_value_get_boxed (glade_property_inline_value (property)))) != NULL)
    {
      gtk_entry_set_text (GTK_ENTRY (eprop_accel->entry), accels);
      g_free (accels);
    }
  else
    gtk_entry_set_text (GTK_ENTRY (eprop_accel->entry), "");

}