]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Wrap GtkTreeView
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 17 Feb 2016 07:09:31 +0000 (18:09 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 17 Feb 2016 07:09:31 +0000 (18:09 +1100)
contrib/brushexport/interface.cpp
libs/uilib/uilib.cpp
libs/uilib/uilib.h
radiant/entityinspector.cpp
radiant/entitylist.cpp
radiant/texwindow.cpp

index 2ac8f9770145a052d94325a8cc496e0d6dc52b75..3c73a6a6de2e6730c73e8d8e118cb9ff64743873 100644 (file)
@@ -123,7 +123,7 @@ create_w_plugplug2( void ){
        gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow1 ), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
        gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scrolledwindow1 ), GTK_SHADOW_IN );
 
-       t_materialist = gtk_tree_view_new();
+       t_materialist = ui::TreeView();
        gtk_widget_set_name( t_materialist, "t_materialist" );
        gtk_widget_show( t_materialist );
        gtk_container_add( GTK_CONTAINER( scrolledwindow1 ), t_materialist );
index 191990e05e1472efac561c09f8ad6e3ac7bc42f4..484cbb073e588352752833dc588cc46abf87d5c0 100644 (file)
@@ -163,6 +163,9 @@ namespace ui {
     TreePath::TreePath(const char *path) : TreePath(gtk_tree_path_new_from_string(path))
     { }
 
+    TreeView::TreeView() : TreeView(GTK_TREE_VIEW(gtk_tree_view_new()))
+    { }
+
     TreeView::TreeView(TreeModel model) : TreeView(GTK_TREE_VIEW(gtk_tree_view_new_with_model(model)))
     { }
 
index 24d3145025107fbaf91605a87902eca34d0977e3..56696ce55f8c73a6abe3d6ff70b4eaf0d50d94df 100644 (file)
@@ -218,6 +218,7 @@ namespace ui {
     );
 
     WRAP(TreeView, Widget, ui_treeview,
+         TreeView();
          TreeView(TreeModel model);
     );
 
index d5c833626bc7cc02efb9a2ffe55451fffed50f91..9a0b9ef944917d61e10fdeb10c6adaceb86a3f8f 100644 (file)
@@ -1337,7 +1337,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                                {
                                        GtkListStore* store = gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_POINTER );
 
-                                       GtkTreeView* view = GTK_TREE_VIEW( gtk_tree_view_new_with_model( GTK_TREE_MODEL( store ) ) );
+                                       GtkTreeView* view = ui::TreeView( ui::TreeModel( GTK_TREE_MODEL( store ) ));
                                        gtk_tree_view_set_enable_search( GTK_TREE_VIEW( view ), FALSE );
                                        gtk_tree_view_set_headers_visible( view, FALSE );
                                        g_signal_connect( G_OBJECT( view ), "button_press_event", G_CALLBACK( EntityClassList_button_press ), 0 );
index a93d9698a6fe04fb1d75bfa163aa522f3fd27224..0303e55ada74e90b7ce571c5e329b5fc0a7f4f4a 100644 (file)
@@ -300,7 +300,7 @@ void EntityList_constructWindow( ui::Window main_window ){
                gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( scr ) );
 
                {
-                       ui::Widget view = ui::Widget(gtk_tree_view_new());
+                       ui::Widget view = ui::TreeView();
                        gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
 
                        auto renderer = ui::CellRendererText();
index 2aad7a3c54d4594b86024b3aa2cae9cc403ed777..2b53597b9b86685834bd32274e7d678422592da9 100644 (file)
@@ -1529,7 +1529,7 @@ void TreeView_onRowActivated( GtkTreeView* treeview, GtkTreePath* path, GtkTreeV
 }
 
 void TextureBrowser_createTreeViewTree(){
-       g_TextureBrowser.m_treeViewTree = ui::Widget(GTK_WIDGET( gtk_tree_view_new() ));
+       g_TextureBrowser.m_treeViewTree = ui::TreeView();
        gtk_tree_view_set_enable_search( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTree ), FALSE );
 
        gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTree ), FALSE );
@@ -1585,7 +1585,7 @@ gboolean TreeViewTags_onButtonPressed( ui::Widget treeview, GdkEventButton *even
 }
 
 void TextureBrowser_createTreeViewTags(){
-       g_TextureBrowser.m_treeViewTags = ui::Widget(GTK_WIDGET( gtk_tree_view_new() ));
+       g_TextureBrowser.m_treeViewTags = ui::TreeView();
        gtk_tree_view_set_enable_search( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTags ), FALSE );
 
        g_signal_connect( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTags ), "button-press-event", (GCallback)TreeViewTags_onButtonPressed, NULL );