Commit 4d3c9455 authored by Alberto Fanjul's avatar Alberto Fanjul
Browse files

Adding gtksourceviews

parent 27e98983
project('diferencia', ['c', 'vala'], version: '0.1.0',
project('diferencia', ['c', 'vala'],
version: '0.1.0',
meson_version: '>= 0.40.0',
)
......@@ -9,4 +10,4 @@ subdir('data')
subdir('src')
subdir('po')
meson.add_install_script('build-aux/meson/postinstall.py')
\ No newline at end of file
meson.add_install_script('build-aux/meson/postinstall.py')
{
"app-id": "org.gnome.Diferencia",
"runtime": "org.gnome.Platform",
"runtime-version": "3.28",
"sdk": "org.gnome.Sdk",
"command": "diferencia",
"finish-args": [
"--share=network",
"--share=ipc",
"--socket=x11",
"--socket=wayland",
"--filesystem=xdg-run/dconf",
"--filesystem=~/.config/dconf:ro",
"--talk-name=ca.desrt.dconf",
"--env=DCONF_USER_CONFIG_DIR=.config/dconf"
],
"build-options": {
"cflags": "-O2 -g",
"cxxflags": "-O2 -g",
"env": {
"V": "1"
}
},
"cleanup": [
"/include",
"/lib/pkgconfig",
"/man",
"/share/doc",
"/share/gtk-doc",
"/share/man",
"/share/pkgconfig",
"/share/vala",
"*.la",
"*.a"
],
"modules": [
{
"name": "diferencia",
"buildsystem": "meson",
"config-opts": [ "--libdir=lib" ],
"builddir": true,
"sources": [
{
"type": "git",
"url": "file:///home/alberto/Projects/diferencia"
}
]
}
]
}
......@@ -6,13 +6,15 @@ diferencia_sources = [
diferencia_deps = [
dependency('gio-2.0', version: '>= 2.50'),
dependency('gtk+-3.0', version: '>= 3.22'),
dependency('gtksourceview-3.0'),
]
gnome = import('gnome')
diferencia_sources += gnome.compile_resources('diferencia-resources',
'diferencia.gresource.xml',
c_name: 'diferencia'
c_name: 'diferencia',
export: true
)
executable('diferencia', diferencia_sources,
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.20"/>
<!-- <requires lib="gtk+" version="3.12"/> -->
<!-- <requires lib="gtksourceview" version="3.0"/> -->
<!-- interface-requires gtk+ 3.12 -->
<!-- interface-requires gtksourceview 3.0 -->
<template class="DiferenciaWindow" parent="GtkApplicationWindow">
<property name="default-width">600</property>
<property name="default-height">300</property>
<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>
<property name="title" translatable="no">Diferencia</property>
<child>
<object class="GtkLabel" id="label">
<property name="label">Hello, World!</property>
<object class="GtkBox" id="box">
<property name="visible">True</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="2"/>
</attributes>
<property name="can_focus">False</property>
<child>
<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" id="left_scrolledwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkSourceView" id="left_sourceview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="left_margin">2</property>
<property name="right_margin">2</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkDrawingArea">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="right_scrolledwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkSourceView" id="right_sourceview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="left_margin">2</property>
<property name="right_margin">2</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
</template>
</interface>
......@@ -19,8 +19,9 @@
namespace Diferencia {
[GtkTemplate (ui = "/org/gnome/Diferencia/window.ui")]
public class Window : Gtk.ApplicationWindow {
[GtkChild]
Gtk.Label label;
[GtkChild (name = "left_sourceview")]
private Gtk.SourceView left_sourceview;
public Window (Gtk.Application app) {
Object (application: app);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment