Create basic GObject structure for GraphView

This commit is contained in:
2020-04-02 00:32:11 +02:00
parent 850ae7db43
commit 7323fd15e8
4 changed files with 139 additions and 8 deletions

View File

@@ -1,18 +1,48 @@
/*
* This file is part of GtkGraphView.
*
* Foobar is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* GtkGraphView is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GtkGraphView. If not, see <https://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <gtk/gtk.h>
#include <gtk-graph-view.h>
static gboolean main_window_delete_event(GtkWidget *window, gpointer user)
{
(void)user;
gtk_widget_destroy(window);
gtk_main_quit();
return FALSE;
}
int main(int argc, char **argv)
{
GtkWidget *main_window;
printf("Hello World!\n");
GtkWidget *graph_view;
gtk_init(&argc, &argv);
main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_show(main_window);
gtk_window_set_default_size(GTK_WINDOW(main_window), 800, 800);
g_signal_connect(main_window, "delete-event", G_CALLBACK(main_window_delete_event), NULL);
graph_view = gtk_graph_view_new();
gtk_container_add(GTK_CONTAINER(main_window), graph_view);
gtk_widget_show_all(main_window);
gtk_main();
return 0;