From: TimePath Date: Wed, 17 Feb 2016 07:09:31 +0000 (+1100) Subject: Wrap GtkTreeView X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0a775e503d02786ad2131b19c6d52c87cfd1e0a8;p=xonotic%2Fnetradiant.git Wrap GtkTreeView --- diff --git a/contrib/brushexport/interface.cpp b/contrib/brushexport/interface.cpp index 2ac8f977..3c73a6a6 100644 --- a/contrib/brushexport/interface.cpp +++ b/contrib/brushexport/interface.cpp @@ -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 ); diff --git a/libs/uilib/uilib.cpp b/libs/uilib/uilib.cpp index 191990e0..484cbb07 100644 --- a/libs/uilib/uilib.cpp +++ b/libs/uilib/uilib.cpp @@ -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))) { } diff --git a/libs/uilib/uilib.h b/libs/uilib/uilib.h index 24d31450..56696ce5 100644 --- a/libs/uilib/uilib.h +++ b/libs/uilib/uilib.h @@ -218,6 +218,7 @@ namespace ui { ); WRAP(TreeView, Widget, ui_treeview, + TreeView(); TreeView(TreeModel model); ); diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index d5c83362..9a0b9ef9 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -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 ); diff --git a/radiant/entitylist.cpp b/radiant/entitylist.cpp index a93d9698..0303e55a 100644 --- a/radiant/entitylist.cpp +++ b/radiant/entitylist.cpp @@ -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(); diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index 2aad7a3c..2b53597b 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -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 );