From c2a57e4aa1d897a2fe425bc09d9dbb140834fa55 Mon Sep 17 00:00:00 2001 From: lakinduakash Date: Tue, 5 Mar 2019 11:03:08 +0530 Subject: [PATCH] Reformat --- src/ui/glade/main.glade | 19 ------------ src/ui/main.c | 66 ++++++++++++++++++----------------------- 2 files changed, 29 insertions(+), 56 deletions(-) delete mode 100644 src/ui/glade/main.glade diff --git a/src/ui/glade/main.glade b/src/ui/glade/main.glade deleted file mode 100644 index 47f434c..0000000 --- a/src/ui/glade/main.glade +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - False - Wifi hotspot - - - - - - True - False - multiple - - - - diff --git a/src/ui/main.c b/src/ui/main.c index 9563bb3..52170f6 100644 --- a/src/ui/main.c +++ b/src/ui/main.c @@ -1,55 +1,47 @@ #include static void -print_hello (GtkWidget *widget, - gpointer data) -{ - g_print ("Hello World\n"); +print_hello(GtkWidget *widget, + gpointer data) { + g_print("Hello World\n"); } -static void print_hello2 (GtkWidget *widget, - gpointer data) -{ - g_print ("Hello World 2\n"); +static void print_hello2(GtkWidget *widget, + gpointer data) { + g_print("Hello World 2\n"); } +int main(int argc,char *argv[]) { + GtkBuilder *builder; + GObject *window; + GObject *button; + GError *error = NULL; + gtk_init(&argc, &argv); -int -main (int argc, - char *argv[]) -{ - GtkBuilder *builder; - GObject *window; - GObject *button; - GError *error = NULL; - - gtk_init (&argc, &argv); - - /* Construct a GtkBuilder instance and load our UI description */ - builder = gtk_builder_new (); - if (gtk_builder_add_from_file (builder, "glade/main.ui", &error) == 0) - { - g_printerr ("Error loading file: %s\n", error->message); - g_clear_error (&error); - return 1; + /* Construct a GtkBuilder instance and load our UI description */ + builder = gtk_builder_new(); + if (gtk_builder_add_from_file(builder, "glade/main.ui", &error) == 0) { + g_printerr("Error loading file: %s\n", error->message); + g_clear_error(&error); + return 1; } - /* Connect signal handlers to the constructed widgets. */ - window = gtk_builder_get_object (builder, "window"); - g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL); + /* Connect signal handlers to the constructed widgets. */ + window = gtk_builder_get_object(builder, "window"); + g_signal_connect (window, "destroy", G_CALLBACK(gtk_main_quit), NULL); - button = gtk_builder_get_object (builder, "button1"); - g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL); + button = gtk_builder_get_object(builder, "button1"); + g_signal_connect (button, "clicked", G_CALLBACK(print_hello), NULL); - button = gtk_builder_get_object (builder, "button_new"); - g_signal_connect (button, "clicked", G_CALLBACK (print_hello2), NULL); + button = gtk_builder_get_object(builder, "button_new"); + g_signal_connect (button, "clicked", G_CALLBACK(print_hello2), NULL); - button = gtk_builder_get_object (builder, "quit"); - g_signal_connect (button, "clicked", G_CALLBACK (gtk_main_quit), NULL); + button = gtk_builder_get_object(builder, "quit"); + g_signal_connect (button, "clicked", G_CALLBACK(gtk_main_quit), NULL); - gtk_main (); + gtk_main(); - return 0; + return 0; } \ No newline at end of file