Ejemplo n.º 1
0
int main (void)
{
  GStylesheet *stylesheet;
  GStyleClass *style_class;
  gchar *property = NULL;

  g_print ("Started...\n");
  g_type_init ();

  style_class = init_style_class_hierarchy ();

  g_print ("> Name: %s\n", g_style_class_get_name (style_class));
  
  g_print ("Load file...\n");

  stylesheet = g_stylesheet_new_from_file ("./hierarchy.css", NULL);

  g_print ("Get property <button> ");
  g_stylesheet_get_property (stylesheet,
                             G_STYLEABLE (button),
                             "color",
                             &property);
  g_print ("%s\n", property);

  g_print ("Get property <notebook> ");
  g_stylesheet_get_property (stylesheet,
                             G_STYLEABLE (notebook),
                             "color",
                             &property);
  g_print ("%s\n", property);

  g_print ("Get property <notebook > tab> ");
  g_stylesheet_get_property (stylesheet,
                             G_STYLEABLE (notebooktab),
                             "color",
                             &property);
  g_print ("%s\n", property);

  g_print ("Get property <notebook > tab:first-child> ");
  g_stylesheet_get_property (stylesheet,
                             G_STYLEABLE (notebooktab_first),
                             "color",
                             &property);
  g_print ("%s\n", property);

  g_print ("Get property <treeview > row> ");
  g_stylesheet_get_property (stylesheet,
                             G_STYLEABLE (treeviewrow),
                             "color",
                             &property);
  g_print ("%s\n", property);

  g_print ("Finished...\n");

  return 0;
}
Ejemplo n.º 2
0
static const char*
g_style_class_get_node_name (const GStyleable *node)
{
  return g_style_class_get_name (G_STYLE_CLASS (node));
}