Compare commits
2 commits
50fc355a0f
...
e23f917f02
Author | SHA1 | Date | |
---|---|---|---|
|
e23f917f02 | ||
|
d0e3ca7e21 |
3 changed files with 8 additions and 10 deletions
|
@ -1,7 +1,3 @@
|
||||||
--[[ utility functions ]]--
|
|
||||||
|
|
||||||
--
|
|
||||||
|
|
||||||
--[[ page module ]]--
|
--[[ page module ]]--
|
||||||
|
|
||||||
page = {}
|
page = {}
|
||||||
|
@ -12,11 +8,11 @@ end
|
||||||
|
|
||||||
function page.Append(content)
|
function page.Append(content)
|
||||||
for i, v in pairs(content) do
|
for i, v in pairs(content) do
|
||||||
__ext_pageview_append_tag("t", v[1] or v)
|
__ext_pageview_append_tag("t", v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function page.Commit(content)
|
function page.Commit(content)
|
||||||
page.Set("")
|
page.Set("")
|
||||||
page.Append(content)
|
page.Append(content)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
page.Commit{
|
page.Commit{
|
||||||
"yeah"
|
"<span foreground='blue' size='x-large'>Blue text</span> is <i>cool</i>!",
|
||||||
}
|
"\n",
|
||||||
|
"so true"
|
||||||
|
}
|
||||||
|
|
4
ui.c
4
ui.c
|
@ -34,9 +34,9 @@ void page_application_show(struct application_state* state) {
|
||||||
void page_application_text_buffer_append_text(struct application_state* state, const char* display_text) {
|
void page_application_text_buffer_append_text(struct application_state* state, const char* display_text) {
|
||||||
GtkTextIter iter;
|
GtkTextIter iter;
|
||||||
gtk_text_buffer_get_end_iter(GTK_TEXT_BUFFER(state->pageview_buffer), &iter);
|
gtk_text_buffer_get_end_iter(GTK_TEXT_BUFFER(state->pageview_buffer), &iter);
|
||||||
gtk_text_buffer_insert(GTK_TEXT_BUFFER(state->pageview_buffer), &iter, display_text, -1);
|
gtk_text_buffer_insert_markup(GTK_TEXT_BUFFER(state->pageview_buffer), &iter, display_text, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void page_application_text_buffer_set_text(struct application_state* state, const char* text) {
|
void page_application_text_buffer_set_text(struct application_state* state, const char* text) {
|
||||||
gtk_text_buffer_set_text(state->pageview_buffer, text, -1);
|
gtk_text_buffer_set_text(state->pageview_buffer, text, -1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue