@@ -16,7 +16,7 @@ var code_regions: Array[Array] = [
1616
1717func _initialize_mode () -> Error :
1818 _initialize_highlighter ()
19- _setup_panel ()
19+ panel = U . load_resource ( "user://modes/python/panel.tscn" ). instantiate ()
2020 comment_delimiters .append ({
2121 "start_key" : "#" ,
2222 "end_key" : "" ,
@@ -105,23 +105,3 @@ func _initialize_highlighter() -> void:
105105 for region in code_regions :
106106 syntax_highlighter .add_color_region (region [1 ], region [2 ], region [0 ], region [3 ])
107107
108-
109- func _setup_panel () -> void :
110- panel = TextForgePanel .new ()
111- var run = Button .new ()
112- var output = TextEdit .new ()
113- panel .add_child (VBoxContainer .new ())
114- panel .get_child (0 ).size = Vector2 (100 , 300 )
115- panel .get_child (0 ).add_child (run )
116- panel .get_child (0 ).add_child (output )
117- run .size_flags_horizontal = Control .SIZE_FILL
118- output .size_flags_horizontal = Control .SIZE_FILL
119- output .size_flags_vertical = Control .SIZE_EXPAND_FILL
120- run .text = "Run Code"
121- run .pressed .connect (_execute .bind (output ))
122-
123-
124- func _execute (output ) -> void :
125- var out : Array
126- OS .execute ("python" , [Global .get_file_path ()], out )
127- output .text = "\n ---\n " .join (out )
0 commit comments