Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_text/text_ops.c
| Show First 20 Lines • Show All 267 Lines • ▼ Show 20 Lines | |||||
| static int text_new_exec(bContext *C, wmOperator *UNUSED(op)) | static int text_new_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| { | { | ||||
| SpaceText *st = CTX_wm_space_text(C); | SpaceText *st = CTX_wm_space_text(C); | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| Text *text; | Text *text; | ||||
| PointerRNA ptr, idptr; | PointerRNA ptr, idptr; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| text = BKE_text_add(bmain, "Text"); | text = BKE_text_add(bmain, DATA_("Text")); | ||||
| /* hook into UI */ | /* hook into UI */ | ||||
| UI_context_active_but_prop_get_templateID(C, &ptr, &prop); | UI_context_active_but_prop_get_templateID(C, &ptr, &prop); | ||||
| if (prop) { | if (prop) { | ||||
| RNA_id_pointer_create(&text->id, &idptr); | RNA_id_pointer_create(&text->id, &idptr); | ||||
| RNA_property_pointer_set(&ptr, prop, idptr, NULL); | RNA_property_pointer_set(&ptr, prop, idptr, NULL); | ||||
| RNA_property_update(C, &ptr, prop); | RNA_property_update(C, &ptr, prop); | ||||
| ▲ Show 20 Lines • Show All 3,674 Lines • Show Last 20 Lines | |||||