application/main.c

Thu, 28 Aug 2014 19:25:21 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Thu, 28 Aug 2014 19:25:21 +0200
changeset 57
ddfd6b90cc54
parent 56
87e3a5dc66dd
child 58
2b124f8ebd95
permissions
-rw-r--r--

updated UiText implementation (Qt)

0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 /*
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 *
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
4 * Copyright 2012 Olaf Wintermann. All rights reserved.
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 *
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 * Redistribution and use in source and binary forms, with or without
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 * modification, are permitted provided that the following conditions are met:
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 *
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 * 1. Redistributions of source code must retain the above copyright
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 * notice, this list of conditions and the following disclaimer.
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 *
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 * 2. Redistributions in binary form must reproduce the above copyright
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer in the
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 * documentation and/or other materials provided with the distribution.
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 *
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 * POSSIBILITY OF SUCH DAMAGE.
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 */
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29 #include <stdio.h>
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30 #include <stdlib.h>
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
32 #include <ui/ui.h>
28
794a5c91c479 added open/save dialogs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 27
diff changeset
33 #include <ucx/buffer.h>
794a5c91c479 added open/save dialogs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 27
diff changeset
34 #include <ucx/utils.h>
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35
2
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
36
39
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
37 typedef struct Person {
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
38 char *name;
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
39 char *mail;
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
40 } Person;
5
19d37cb9c96c added textarea
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 4
diff changeset
41
52
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
42 typedef struct Document {
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
43 UiText text;
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
44 } Document;
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
45
56
87e3a5dc66dd added text widget (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 55
diff changeset
46 UiText text;
87e3a5dc66dd added text widget (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 55
diff changeset
47
55
9076eb40454d added toolbar (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 54
diff changeset
48 void action_new(UiEvent *event, void *data) {
9076eb40454d added toolbar (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 54
diff changeset
49 printf("new\n");
9076eb40454d added toolbar (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 54
diff changeset
50 }
9076eb40454d added toolbar (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 54
diff changeset
51
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
52 void action_close(UiEvent *event, void *data) {
54
97bafeca1c7c added Qt window and menu implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
53 printf("action_close\n");
55
9076eb40454d added toolbar (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 54
diff changeset
54 ui_close(event->obj);
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
55 }
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
56
39
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
57 char* person_getvalue(Person *p, int column) {
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
58 switch(column) {
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
59 case 0: return p->name;
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
60 case 1: return p->mail;
2
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
61 }
39
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
62 return NULL;
14
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
63 }
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
64
42
29b2821d1262 added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
65 void action_activate(UiEvent *event, void *data) {
29b2821d1262 added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
66 UiListSelection *selection = event->eventdata;
29b2821d1262 added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
67 printf("activate: %d\n", event->intval);
29b2821d1262 added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
68 }
29b2821d1262 added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
69
29b2821d1262 added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
70 void action_select(UiEvent *event, void *data) {
29b2821d1262 added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
71 UiListSelection *selection = event->eventdata;
29b2821d1262 added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
72 printf("selection[%d]: ", selection->count);
29b2821d1262 added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
73 for(int i=0;i<selection->count;i++) {
29b2821d1262 added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
74 printf("%d ", selection->rows[i]);
29b2821d1262 added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
75 }
29b2821d1262 added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
76 printf("\n");
29b2821d1262 added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
77 }
29b2821d1262 added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
78
49
a80ba8741be6 added toolbar toggle button (Cocoa)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
79 void action_button(UiEvent *event, void *data) {
a80ba8741be6 added toolbar toggle button (Cocoa)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
80 printf("button: %d\n", event->intval);
55
9076eb40454d added toolbar (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 54
diff changeset
81 //char *s = ui_gettext(event->obj, "text");
56
87e3a5dc66dd added text widget (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 55
diff changeset
82 char *s = ui_getval(text);
87e3a5dc66dd added text widget (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 55
diff changeset
83 printf("{%s}\n", s);
49
a80ba8741be6 added toolbar toggle button (Cocoa)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
84 }
a80ba8741be6 added toolbar toggle button (Cocoa)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
85
29
c96169444d88 added locale support (Cocoa) and ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 28
diff changeset
86 int main(int argc, char** argv) {
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
87 ui_init("app1", argc, argv);
30
34513f76d5a8 added locale support (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
88 ui_locales_dir("/opt/app1/locales");
34513f76d5a8 added locale support (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
89 ui_load_lang_def(NULL, "en_EN");
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 30
diff changeset
90 //ui_openfilefunc(action_new, NULL);
29
c96169444d88 added locale support (Cocoa) and ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 28
diff changeset
91
22
bcf880b29bc3 textarea automatically sets selection group (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 21
diff changeset
92
7
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
93
39
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
94 ui_menu("File");
54
97bafeca1c7c added Qt window and menu implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
95 //ui_menuitem("Close", action_close, NULL);
55
9076eb40454d added toolbar (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 54
diff changeset
96 ui_menuitem_st(UI_STOCK_NEW, action_new, NULL);
39
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
97 ui_menuitem_st(UI_STOCK_CLOSE, action_close, NULL);
54
97bafeca1c7c added Qt window and menu implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
98 //ui_checkitem("Check", action_button, NULL);
49
a80ba8741be6 added toolbar toggle button (Cocoa)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
99
56
87e3a5dc66dd added text widget (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 55
diff changeset
100 ui_toolitem_st("button", UI_STOCK_OPEN, action_button, NULL);
55
9076eb40454d added toolbar (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 54
diff changeset
101 ui_toolbar_add_default("button");
3
c1a75454b444 added toolbar
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
102
7
431dde3c5fbe added Cocoa implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
103 printf("create window\n");
39
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
104 UiObject *window = ui_window("Mod0", NULL);
56
87e3a5dc66dd added text widget (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 55
diff changeset
105 ui_textarea(window, &text);
1
eb5269000bc8 added some document functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
106
54
97bafeca1c7c added Qt window and menu implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
107 /*
39
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
108 UiModelInfo *model = ui_model_info(window->ctx, UI_STRING, "Name", UI_STRING, "Email", -1);
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
109 model->getvalue = (ui_model_getvalue_f)person_getvalue;
42
29b2821d1262 added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
110 model->activate = action_activate;
29b2821d1262 added table view events (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
111 model->selection = action_select;
39
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
112 UiList *list = ui_list_new();
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
113 Person *p1 = ui_malloc(window->ctx, sizeof(Person));
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
114 Person *p2 = ui_malloc(window->ctx, sizeof(Person));
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
115 Person *p3 = ui_malloc(window->ctx, sizeof(Person));
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
116 Person *p4 = ui_malloc(window->ctx, sizeof(Person));
46
4a5e0b9b6992 fixed fonts (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 45
diff changeset
117 p1->name = "Some Näme";
39
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
118 p1->mail = "mail@host.com";
46
4a5e0b9b6992 fixed fonts (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 45
diff changeset
119 p2->name = "押井守";
39
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
120 p2->mail = "other.person@provider.com";
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
121 p3->name = "My Self";
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
122 p3->mail = "my@self.org";
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
123 p4->name = "Gregory House";
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
124 p4->mail = "greg@pp";
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
125 ui_list_append(list, p1);
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
126 ui_list_append(list, p2);
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
127 ui_list_append(list, p3);
4e66271541e8 added table view (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
128 ui_list_append(list, p4);
45
cfeb2d5f1332 added scrolled window for table widget (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 42
diff changeset
129
52
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
130 //ui_sidebar(window);
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
131 //ui_table(window, list, model);
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
132 //ui_end(window);
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
133
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
134 UiTabbedPane *view = ui_tabbed_document_view(window);
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
135
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
136 UiObject *tab1 = ui_document_tab(view);
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
137 Document *doc1 = ui_document_new(1024);
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
138 UiContext *ctx1 = ui_document_context(doc1);
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
139 ui_document_regtext(doc1, "text", &doc1->text);
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
140 ui_textarea_nv(tab1, "text");
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
141 ui_set_document(tab1, doc1);
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
142
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
143
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
144 UiObject *tab2 = ui_document_tab(view);
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
145 Document *doc2 = ui_document_new(1024);
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
146 UiContext *ctx2 = ui_document_context(doc2);
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
147 ui_document_regtext(doc2, "text", &doc2->text);
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
148 ui_textarea_nv(tab2, "text");
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 51
diff changeset
149 ui_set_document(tab2, doc2);
1
eb5269000bc8 added some document functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
150
53
62205699cd0e improved motif tabs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
151 UiObject *tab3 = ui_document_tab(view);
62205699cd0e improved motif tabs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
152 Document *doc3 = ui_document_new(1024);
62205699cd0e improved motif tabs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
153 UiContext *ctx3 = ui_document_context(doc3);
62205699cd0e improved motif tabs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
154 ui_document_regtext(doc3, "text", &doc3->text);
62205699cd0e improved motif tabs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
155 ui_textarea_nv(tab3, "text");
62205699cd0e improved motif tabs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
156 ui_set_document(tab3, doc3);
54
97bafeca1c7c added Qt window and menu implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
157 */
53
62205699cd0e improved motif tabs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
158
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
159 ui_show(window);
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
160 ui_main();
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
161
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
162 return (EXIT_SUCCESS);
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
163 }

mercurial