gtk2 sam7fc telemetrie application
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.2KB

  1. #include <gtk/gtk.h>
  2. #include <gtkdatabox.h>
  3. gint graph_tab_init(GtkNotebook *notebook)
  4. {
  5. GtkWidget *table = gtk_table_new(3, 3, FALSE);
  6. GtkWidget *box = gtk_databox_new();
  7. gtk_table_attach(GTK_TABLE(table), box, 1, 2, 1, 2,
  8. GTK_FILL | GTK_EXPAND | GTK_SHRINK,
  9. GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 0);
  10. GtkWidget *scrollbar = gtk_hscrollbar_new(gtk_databox_get_hadjustment(GTK_DATABOX(box)));
  11. gtk_table_attach(GTK_TABLE(table), scrollbar, 1, 2, 2, 3,
  12. GTK_FILL | GTK_EXPAND | GTK_SHRINK,
  13. GTK_FILL, 0, 0);
  14. scrollbar = gtk_vscrollbar_new(gtk_databox_get_vadjustment(GTK_DATABOX(box)));
  15. gtk_table_attach(GTK_TABLE(table), scrollbar, 2, 3, 1, 2,
  16. GTK_FILL,
  17. GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 0);
  18. GtkWidget *ruler = gtk_hruler_new();
  19. gtk_table_attach(GTK_TABLE(table), ruler, 1, 2, 0, 1,
  20. GTK_FILL | GTK_EXPAND | GTK_SHRINK,
  21. GTK_FILL, 0, 0);
  22. gtk_databox_set_hruler(GTK_DATABOX(box), GTK_RULER(ruler));
  23. ruler = gtk_vruler_new();
  24. gtk_table_attach (GTK_TABLE (table), ruler, 0, 1, 1, 2,
  25. GTK_FILL,
  26. GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 0);
  27. gtk_databox_set_vruler(GTK_DATABOX(box), GTK_RULER(ruler));
  28. GtkWidget *label = gtk_label_new(" Graph ");
  29. return gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table, label);
  30. }