Tutorial: Adding A Content View Misleading
Following the "Adding A Content View" leads to an application that won't build and run.
I believe I've sufficiently followed the instructions, but find myself with an app that won't run.
Here's my window.ui
file (which in the tutorial is seemingly incorrectly referenced to as text_viewer-window.ui
).
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.20"/>
<template class="TextViewerWindow" parent="GtkApplicationWindow">
<property name="default-width">600</property>
<property name="default-height">300</property>
<property name="title">Text Viewer</property>
<style>
<class name="devel" />
</style>
<child type="titlebar">
<object class="GtkHeaderBar" id="header_bar">
<property name="visible">True</property>
<property name="show-close-button">True</property>
<property name="title">Hello, World!</property>
</object>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="hexpand">true</property>
<property name="vexpand">true</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="margin-start">6</property>
<property name="margin-end">6</property>
<property name="child">
<object class="GtkTextView" id="main_text_view">
<property name="monospace">true</property>
</object>
</property>
</object>
</child>
</template>
</interface>
And my window.py
file (which in the tutorial is seemingly incorrectly referenced to as text_viewer-window.py
):
from gi.repository import Gtk
@Gtk.Template(resource_path='/com/jasonfavrod/TextViewer/window.ui')
class TextViewerWindow(Gtk.ApplicationWindow):
__gtype_name__ = 'TextViewerWindow'
main_text_view = Gtk.Template.Child()
def __init__(self, **kwargs):
super().__init__(**kwargs)
After making these changes, I see red squiggles and the app will no longer run.