#include <gtk/gtk.h>

int main ()
{
  gtk_init (NULL, NULL);

  GtkWidget *w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  GtkWidget *grid = gtk_grid_new ();
  gtk_orientable_set_orientation (GTK_ORIENTABLE (grid), GTK_ORIENTATION_VERTICAL);
  gtk_container_add (GTK_CONTAINER (w), grid);

  /* continuous */
  GtkWidget *bar = gtk_level_bar_new ();
  gtk_level_bar_set_value (GTK_LEVEL_BAR (bar), 0.3);
  gtk_container_add (GTK_CONTAINER (grid), bar);

  bar = gtk_level_bar_new ();
  gtk_level_bar_set_value (GTK_LEVEL_BAR (bar), 0.3);
  gtk_level_bar_set_inverted (GTK_LEVEL_BAR (bar), TRUE);
  gtk_container_add (GTK_CONTAINER (grid), bar);

  bar = gtk_level_bar_new ();
  gtk_orientable_set_orientation (GTK_ORIENTABLE (bar), GTK_ORIENTATION_VERTICAL);
  gtk_level_bar_set_value (GTK_LEVEL_BAR (bar), 0.3);
  gtk_container_add (GTK_CONTAINER (grid), bar);

  bar = gtk_level_bar_new ();
  gtk_orientable_set_orientation (GTK_ORIENTABLE (bar), GTK_ORIENTATION_VERTICAL);
  gtk_level_bar_set_value (GTK_LEVEL_BAR (bar), 0.3);
  gtk_level_bar_set_inverted (GTK_LEVEL_BAR (bar), TRUE);
  gtk_container_add (GTK_CONTAINER (grid), bar);

  /* discrete */
  bar = gtk_level_bar_new ();
  gtk_level_bar_set_mode (GTK_LEVEL_BAR (bar), GTK_LEVEL_BAR_MODE_DISCRETE);
  gtk_level_bar_set_max_value (GTK_LEVEL_BAR (bar), 5);
  gtk_level_bar_set_value (GTK_LEVEL_BAR (bar), 2);
  gtk_container_add (GTK_CONTAINER (grid), bar);

  bar = gtk_level_bar_new ();
  gtk_level_bar_set_mode (GTK_LEVEL_BAR (bar), GTK_LEVEL_BAR_MODE_DISCRETE);
  gtk_level_bar_set_max_value (GTK_LEVEL_BAR (bar), 5);
  gtk_level_bar_set_value (GTK_LEVEL_BAR (bar), 2);
  gtk_level_bar_set_inverted (GTK_LEVEL_BAR (bar), TRUE);
  gtk_container_add (GTK_CONTAINER (grid), bar);

  bar = gtk_level_bar_new ();
  gtk_level_bar_set_mode (GTK_LEVEL_BAR (bar), GTK_LEVEL_BAR_MODE_DISCRETE);
  gtk_orientable_set_orientation (GTK_ORIENTABLE (bar), GTK_ORIENTATION_VERTICAL);
  gtk_level_bar_set_max_value (GTK_LEVEL_BAR (bar), 5);
  gtk_level_bar_set_value (GTK_LEVEL_BAR (bar), 2);
  gtk_container_add (GTK_CONTAINER (grid), bar);

  bar = gtk_level_bar_new ();
  gtk_level_bar_set_mode (GTK_LEVEL_BAR (bar), GTK_LEVEL_BAR_MODE_DISCRETE);
  gtk_orientable_set_orientation (GTK_ORIENTABLE (bar), GTK_ORIENTATION_VERTICAL);
  gtk_level_bar_set_max_value (GTK_LEVEL_BAR (bar), 5);
  gtk_level_bar_set_value (GTK_LEVEL_BAR (bar), 2);
  gtk_level_bar_set_inverted (GTK_LEVEL_BAR (bar), TRUE);
  gtk_container_add (GTK_CONTAINER (grid), bar);

  gtk_widget_show_all (w);

  gtk_main ();

  return 0;
}
