Browse Source

init browser component

CPP-GTK4
yggverse 4 months ago
parent
commit
859beb871b
  1. 43
      src/Yoda/Browser.cpp
  2. 21
      src/Yoda/Browser.h

43
src/Yoda/Browser.cpp

@ -0,0 +1,43 @@ @@ -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

@ -0,0 +1,21 @@ @@ -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
Loading…
Cancel
Save