]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Wrap GtkTextView
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 17 Feb 2016 07:36:38 +0000 (18:36 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 17 Feb 2016 07:36:38 +0000 (18:36 +1100)
libs/uilib/uilib.cpp
libs/uilib/uilib.h
radiant/console.cpp
radiant/entityinspector.cpp
radiant/gtkdlgs.cpp

index 589da73cb66a121ae9b7e1f9025f6799b08770e7..3b169fafc3a3cb6ec14029f0b06a6c925e09c8c7 100644 (file)
@@ -167,6 +167,9 @@ namespace ui {
             GTK_TABLE(gtk_table_new(rows, columns, homogenous)))
     { }
 
+    TextView::TextView() : TextView(GTK_TEXT_VIEW(gtk_text_view_new()))
+    { }
+
     TreePath::TreePath() : TreePath(gtk_tree_path_new())
     { }
 
index 7e943985ac58d2cd839e0318bf9404e3924bf531..3afaa0cb55ae357fefa0a28c52364dd8c462bf9f 100644 (file)
@@ -27,6 +27,7 @@ using ui_paned = struct _GtkPaned;
 using ui_scrolledwindow = struct _GtkScrolledWindow;
 using ui_spinbutton = struct _GtkSpinButton;
 using ui_table = struct _GtkTable;
+using ui_textview = struct _GtkTextView;
 using ui_treemodel = struct _GtkTreeModel;
 using ui_treepath = struct _GtkTreePath;
 using ui_treeview = struct _GtkTreeView;
@@ -220,6 +221,10 @@ namespace ui {
          Table(std::size_t rows, std::size_t columns, bool homogenous);
     );
 
+    WRAP(TextView, Widget, ui_textview,
+         TextView();
+    );
+
     WRAP(TreeModel, Widget, ui_treemodel,);
 
     WRAP(TreePath, Object, ui_treepath,
index 4530bc290ba339175ee67c036f40001d20e8231f..11e56c6db477bfc10a97f9e51038b79881f22ab3 100644 (file)
@@ -116,7 +116,7 @@ ui::Widget Console_constructWindow( ui::Window toplevel ){
        gtk_widget_show( scr );
 
        {
-               ui::Widget text = ui::Widget(gtk_text_view_new());
+               ui::Widget text = ui::TextView();
                gtk_widget_set_size_request( text, 0, -1 ); // allow shrinking
                gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( text ), GTK_WRAP_WORD );
                gtk_text_view_set_editable( GTK_TEXT_VIEW( text ), FALSE );
index 9a0b9ef944917d61e10fdeb10c6adaceb86a3f8f..83166da1294bb753c98ebfe7731201df97a90a4c 100644 (file)
@@ -1372,7 +1372,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                                gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scr ), GTK_SHADOW_IN );
 
                                {
-                                       GtkTextView* text = GTK_TEXT_VIEW( gtk_text_view_new() );
+                                       GtkTextView* text = ui::TextView();
                                        gtk_widget_set_size_request( GTK_WIDGET( text ), 0, -1 ); // allow shrinking
                                        gtk_text_view_set_wrap_mode( text, GTK_WRAP_WORD );
                                        gtk_text_view_set_editable( text, FALSE );
index 4a333a37995da98762b6b5516a384519f7d4fa46..5c76cf61d73905fe489f143a182c5463d17a11e6 100644 (file)
@@ -570,7 +570,7 @@ void DoAbout(){
                                        GtkScrolledWindow* sc_extensions = create_scrolled_window( GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS, 4 );
                                        gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( sc_extensions ) );
                                        {
-                                               ui::Widget text_extensions = ui::Widget(gtk_text_view_new());
+                                               ui::Widget text_extensions = ui::TextView();
                                                gtk_text_view_set_editable( GTK_TEXT_VIEW( text_extensions ), FALSE );
                                                gtk_container_add( GTK_CONTAINER( sc_extensions ), text_extensions );
                                                GtkTextBuffer* buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW( text_extensions ) );
@@ -766,7 +766,7 @@ static void CreateGtkTextEditor(){
        gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
        gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scr ), GTK_SHADOW_IN );
 
-       text = ui::Widget(gtk_text_view_new());
+       text = ui::TextView();
        gtk_container_add( GTK_CONTAINER( scr ), text );
        gtk_widget_show( text );
        g_object_set_data( G_OBJECT( dlg ), "text", (gpointer) text );