#include <mx/mx.h>

void
add_button (ClutterActor *flow, gchar *text)
{
  ClutterActor *button;
  button = mx_button_new_with_label (text);
  clutter_container_add_actor (CLUTTER_CONTAINER (flow), button);
}

int
main(int argc, char *argv[])
{
  MxApplication *application;
  MxWindow *window;
  ClutterActor *stage, *table;
  ClutterActor *flow, *open, *eject, *import;
  ClutterLayoutManager *flow_layout;

  application = mx_application_new (&argc, &argv, "Window",
      MX_APPLICATION_SINGLE_INSTANCE);

  window = mx_application_create_window (application);
  stage = (ClutterActor *) mx_window_get_clutter_stage (window);

  table = mx_table_new ();
  mx_window_set_child (window, table);

  flow_layout = clutter_flow_layout_new (CLUTTER_FLOW_HORIZONTAL);
  clutter_flow_layout_set_homogeneous (CLUTTER_FLOW_LAYOUT (flow_layout),
      FALSE);
  g_object_set (flow_layout,
      "row-spacing", 2.0,
      "column-spacing", 2.0,
      NULL);
  flow = clutter_box_new (flow_layout);
  mx_table_add_actor (MX_TABLE (table), flow, 0, 0);

  add_button (flow, "Open");
  add_button (flow, "Eject");
  add_button (flow, "Import media from the library");
  add_button (flow, "Kill");
  add_button (flow, "?");
  add_button (flow, "Another button");

  clutter_actor_show (stage);
  mx_application_run (application);
  return 0;
}
