author | František Kučera <franta-hg@frantovo.cz> |
Tue, 03 Dec 2019 16:24:22 +0100 | |
branch | v_0 |
changeset 4 | b2c40d783699 |
parent 2 | bca03092cdb6 |
permissions | -rw-r--r-- |
0
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
1 |
/** |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
2 |
* Relational pipes |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
3 |
* Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info) |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
4 |
* |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
5 |
* This program is free software: you can redistribute it and/or modify |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License as published by |
2
bca03092cdb6
fix license version: GNU GPLv3
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
7 |
* the Free Software Foundation, version 3 of the License. |
0
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
8 |
* |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
13 |
* |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
15 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
16 |
*/ |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
17 |
#include <cstdlib> |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
18 |
#include <unistd.h> |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
19 |
#include <memory> |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
20 |
|
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
21 |
#include <gtkmm.h> |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
22 |
|
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
23 |
#include <relpipe/cli/CLI.h> |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
24 |
#include <relpipe/cli/RelpipeCLIException.h> |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
25 |
#include <relpipe/reader/Factory.h> |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
26 |
#include <relpipe/reader/RelationalReader.h> |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
27 |
#include <relpipe/reader/RelpipeReaderException.h> |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
28 |
|
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
29 |
using namespace relpipe::cli; |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
30 |
using namespace relpipe::reader; |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
31 |
|
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
32 |
int main(int argc, char** argv) { |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
33 |
setlocale(LC_ALL, ""); |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
34 |
CLI::untieStdIO(); |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
35 |
CLI cli(argc, argv); |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
36 |
|
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
37 |
auto app = Gtk::Application::create(argc, argv, "org.gtkmm.examples.base"); |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
38 |
Gtk::Window window; |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
39 |
window.set_default_size(640, 480); |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
40 |
window.set_title("relpipe-out-gui.gtk"); |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
41 |
|
4 | 42 |
Gtk::Notebook notebook; |
43 |
||
44 |
Gtk::TreeModelColumnRecord columns; |
|
45 |
Gtk::TreeModelColumn<Glib::ustring> m_col_text; |
|
46 |
Gtk::TreeModelColumn<int> m_col_number; |
|
47 |
columns.add(m_col_text); |
|
48 |
columns.add(m_col_number); |
|
49 |
||
50 |
||
51 |
auto model = Gtk::ListStore::create(columns); |
|
52 |
||
53 |
Gtk::TreeView table(model); |
|
54 |
table.set_headers_visible(true); |
|
55 |
notebook.append_page(table, "TreeView"); |
|
56 |
||
57 |
||
58 |
Gtk::CheckButton b1; |
|
59 |
b1.set_label("hello"); |
|
60 |
||
61 |
notebook.append_page(b1, "CheckButton"); |
|
62 |
||
63 |
||
64 |
notebook.show_all(); |
|
65 |
window.add(notebook); |
|
0
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
66 |
return app->run(window); |
f28025ce355d
empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
67 |
} |