Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-11-15 23:46:56 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-11-15 23:46:56 +0400
commit4c12550fe89a6a14ae246c37a97626c1b55c2b19 (patch)
tree7ef62e8cb93ccd5ff72e5e2a150b0e75cc14db9a /source/blender/makesrna/intern/rna_text_api.c
parent4f743dd0cc9e2a229402f08905c01ec248a038bf (diff)
Fix #29208: Text.clear() and Text.write() did not redraw text editor.
Diffstat (limited to 'source/blender/makesrna/intern/rna_text_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_text_api.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_text_api.c b/source/blender/makesrna/intern/rna_text_api.c
index ec669b28918..acfcad80f19 100644
--- a/source/blender/makesrna/intern/rna_text_api.c
+++ b/source/blender/makesrna/intern/rna_text_api.c
@@ -28,11 +28,25 @@
#include <stdlib.h>
#include <stdio.h>
-
#include "RNA_define.h"
#ifdef RNA_RUNTIME
+#include "WM_api.h"
+#include "WM_types.h"
+
+static void rna_Text_clear(Text *text)
+{
+ clear_text(text);
+ WM_main_add_notifier(NC_TEXT|NA_EDITED, text);
+}
+
+static void rna_Text_write(Text *text, const char *str)
+{
+ write_text(text, str);
+ WM_main_add_notifier(NC_TEXT|NA_EDITED, text);
+}
+
#else
void RNA_api_text(StructRNA *srna)
@@ -40,10 +54,10 @@ void RNA_api_text(StructRNA *srna)
FunctionRNA *func;
PropertyRNA *prop;
- func= RNA_def_function(srna, "clear", "clear_text");
+ func= RNA_def_function(srna, "clear", "rna_Text_clear");
RNA_def_function_ui_description(func, "clear the text block");
- func= RNA_def_function(srna, "write", "write_text");
+ func= RNA_def_function(srna, "write", "rna_Text_write");
RNA_def_function_ui_description(func, "write text at the cursor location and advance to the end of the text block");
prop= RNA_def_string(func, "text", "Text", 0, "", "New text for this datablock");
RNA_def_property_flag(prop, PROP_REQUIRED);