init browser component

This commit is contained in:
yggverse 2024-08-04 19:44:57 +03:00
parent 1c1b1ea41f
commit 859beb871b
2 changed files with 64 additions and 0 deletions

43
src/Yoda/Browser.cpp Normal file
View File

@ -0,0 +1,43 @@
#include "Browser.h"
YodaBrowser::YodaBrowser(
GtkApplication *application
) {
this->gtk = gtk_application_window_new(
application
);
gtk_window_set_title(
GTK_WINDOW(
this->gtk
),
YodaBrowser::TITLE
);
gtk_window_set_default_size(
GTK_WINDOW(
this->gtk
),
YodaBrowser::WIDTH,
YodaBrowser::HEIGHT
);
GtkWidget *label = gtk_label_new(
"Hello, World!"
);
gtk_window_set_child(
GTK_WINDOW(
this->gtk
),
label
);
gtk_widget_show(
GTK_WIDGET(
this->gtk
)
);
// @TODO signals
}

21
src/Yoda/Browser.h Normal file
View File

@ -0,0 +1,21 @@
#ifndef YODA_BROWSER_H
#define YODA_BROWSER_H
#include "../main.h"
class YodaBrowser
{
public:
GtkWidget *gtk;
const guint WIDTH = 640;
const guint HEIGHT = 480;
const gchar* TITLE = "Yoda";
YodaBrowser(
GtkApplication *application
);
};
#endif