File: main.cc

package info (click to toggle)
libgtksourceviewmm 3.18.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 16,736 kB
  • sloc: sh: 11,279; xml: 5,908; cpp: 800; perl: 236; javascript: 95; makefile: 79
file content (35 lines) | stat: -rw-r--r-- 705 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <iostream>
#include <gtkmm.h>
#include <gtksourceviewmm.h>
using namespace std ;
using namespace Glib ;
using namespace Gtk ;
using namespace Gsv;

int
main (int a_argc, char *a_argv[])
{
    Glib::RefPtr<Gtk::Application> app =
        Gtk::Application::create(a_argc, a_argv,
            "org.gtksourceviewmm.test");

    Gsv::init () ;

    View source_view ;
    RefPtr<Buffer> buffer = source_view.get_source_buffer () ;
    if (!buffer) {
        cerr << "Gsv::View::get_source_buffer () failed" << std::endl ;
        return -1;
    }
    buffer->set_text ("coin") ;

    Window window ;
    window.add (source_view) ;

    window.show_all () ;

    app->run (window) ;

    return 0 ;
}