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.
 
 

26 lines
769 B

#include <gtk/gtk.h>
static gboolean connected = FALSE;
static void connect_cb(GtkWidget *widget, gpointer data)
{
connected = !connected;
if (connected)
gtk_button_set_label(GTK_BUTTON(widget), "Disconnect");
else
gtk_button_set_label(GTK_BUTTON(widget), "Connect");
}
gint control_tab_init(GtkNotebook *notebook)
{
GtkWidget *table = gtk_table_new(10, 10, FALSE);
gtk_container_set_border_width(GTK_CONTAINER(table), 10);
GtkWidget *button = gtk_button_new_with_label("Connect");
gtk_table_attach(GTK_TABLE(table), button, 0, 1, 0, 1, 0, 0, 10, 10);
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(connect_cb), NULL);
GtkWidget *label = gtk_label_new(" Control ");
return gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table, label);
}