Wrap more GTK
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 30 Dec 2017 04:34:04 +0000 (15:34 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 30 Dec 2017 04:34:04 +0000 (15:34 +1100)
contrib/brushexport/callbacks.cpp
contrib/brushexport/interface.cpp
radiant/build.cpp
radiant/commands.cpp
radiant/entityinspector.cpp
radiant/entitylist.cpp
radiant/feedback.cpp
radiant/map.cpp
radiant/preferences.cpp
radiant/texwindow.cpp

index 260a8ac..86943c2 100644 (file)
@@ -30,7 +30,7 @@ void OnExportClicked( ui::Button button, gpointer user_data ){
        // get ignore list from ui
        std::set<std::string> ignore;
 
-       GtkTreeView* view = GTK_TREE_VIEW( lookup_widget( button , "t_materialist" ) );
+       auto view = ui::TreeView::from(lookup_widget(button, "t_materialist"));
        ui::ListStore list = ui::ListStore::from(gtk_tree_view_get_model( view ));
 
        GtkTreeIter iter;
@@ -113,14 +113,14 @@ void OnAddMaterial( ui::Button button, gpointer user_data ){
 
        const gchar* name = gtk_entry_get_text( edit );
        if ( g_utf8_strlen( name, -1 ) > 0 ) {
-               ui::ListStore list = ui::ListStore::from( gtk_tree_view_get_model( GTK_TREE_VIEW( lookup_widget( button , "t_materialist" ) ) ) );
+               ui::ListStore list = ui::ListStore::from( gtk_tree_view_get_model(ui::TreeView::from(lookup_widget(button, "t_materialist") )) );
                list.append(0, name);
                gtk_entry_set_text( edit, "" );
        }
 }
 
 void OnRemoveMaterial( ui::Button button, gpointer user_data ){
-       GtkTreeView* view = GTK_TREE_VIEW( lookup_widget( button , "t_materialist" ) );
+       GtkTreeView* view = ui::TreeView::from(lookup_widget(button, "t_materialist"));
        ui::ListStore list = ui::ListStore::from( gtk_tree_view_get_model( view ) );
        GtkTreeSelection* sel = gtk_tree_view_get_selection( view );
 
index 1a9967b..a4e8d73 100644 (file)
@@ -103,8 +103,8 @@ create_w_plugplug2( void ){
        gtk_widget_set_name( t_materialist, "t_materialist" );
        t_materialist.show();
        scrolledwindow1.add(t_materialist);
-       gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( t_materialist ), FALSE );
-       gtk_tree_view_set_enable_search( GTK_TREE_VIEW( t_materialist ), FALSE );
+       gtk_tree_view_set_headers_visible(t_materialist, FALSE );
+       gtk_tree_view_set_enable_search(t_materialist, FALSE );
 
        auto ed_materialname = ui::Entry(ui::New);
        gtk_widget_set_name( ed_materialname, "ed_materialname" );
@@ -189,13 +189,14 @@ void CreateWindow( void ){
        // column & renderer
        GtkTreeViewColumn* col = gtk_tree_view_column_new();
        gtk_tree_view_column_set_title( col, "materials" );
-       gtk_tree_view_append_column( GTK_TREE_VIEW( lookup_widget( wnd, "t_materialist" ) ), col );
+       auto view = ui::TreeView::from(lookup_widget(wnd, "t_materialist"));
+       gtk_tree_view_append_column(view, col );
        auto renderer = ui::CellRendererText(ui::New);
-       gtk_tree_view_insert_column_with_attributes( GTK_TREE_VIEW( lookup_widget( wnd, "t_materialist" ) ), -1, "", renderer, "text", 0, NULL );
+       gtk_tree_view_insert_column_with_attributes(view, -1, "", renderer, "text", 0, NULL );
 
        // list store
        ui::ListStore ignorelist = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
-       gtk_tree_view_set_model( GTK_TREE_VIEW( lookup_widget( wnd, "t_materialist" ) ), ignorelist );
+       gtk_tree_view_set_model(view, ignorelist );
     ignorelist.unref();
 
        gtk_widget_show_all( wnd );
index 0cc7df8..92cc072 100644 (file)
@@ -704,11 +704,11 @@ gboolean project_cell_edited( GtkCellRendererText* cell, gchar* path_string, gch
        return FALSE;
 }
 
-gboolean project_key_press( ui::Widget widget, GdkEventKey* event, ProjectList* projectList ){
+gboolean project_key_press( ui::TreeView widget, GdkEventKey* event, ProjectList* projectList ){
        Project& project = projectList->m_project;
 
        if ( event->keyval == GDK_KEY_Delete ) {
-               GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( widget ) );
+               GtkTreeSelection* selection = gtk_tree_view_get_selection(widget );
                GtkTreeIter iter;
                GtkTreeModel* model;
                if ( gtk_tree_selection_get_selected( selection, &model, &iter ) ) {
@@ -802,14 +802,14 @@ gboolean commands_cell_edited( GtkCellRendererText* cell, gchar* path_string, gc
        return FALSE;
 }
 
-gboolean commands_key_press( ui::Widget widget, GdkEventKey* event, ui::ListStore store ){
+gboolean commands_key_press( ui::TreeView widget, GdkEventKey* event, ui::ListStore store ){
        if ( g_current_build == 0 ) {
                return FALSE;
        }
        Build& build = *g_current_build;
 
        if ( event->keyval == GDK_KEY_Delete ) {
-               GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( widget ) );
+               GtkTreeSelection* selection = gtk_tree_view_get_selection(widget );
                GtkTreeIter iter;
                GtkTreeModel* model;
                if ( gtk_tree_selection_get_selected( selection, &model, &iter ) ) {
@@ -832,8 +832,6 @@ gboolean commands_key_press( ui::Widget widget, GdkEventKey* event, ui::ListStor
 ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectList ){
        ui::Window window = MainFrame_getWindow().create_dialog_window("Build Menu", G_CALLBACK(dialog_delete_callback ), &modal, -1, 400 );
 
-       ui::Widget buildView{ui::null};
-
        {
                auto table1 = create_dialog_table( 2, 2, 4, 4, 4 );
                window.add(table1);
@@ -849,6 +847,8 @@ ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi
                                vbox.pack_start( button, FALSE, FALSE, 0 );
                        }
                }
+               auto buildViewStore = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
+               auto buildView = ui::TreeView( ui::TreeModel( buildViewStore ));
                {
                        auto frame = create_dialog_frame( "Build menu" );
             table1.attach(frame, {0, 1, 0, 1});
@@ -857,24 +857,22 @@ ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi
                                frame.add(scr);
 
                                {
-                                       auto store = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
-
-                                       ui::Widget view = ui::TreeView( ui::TreeModel( store ));
-                                       gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
+                                       auto view = buildView;
+                                       auto store = buildViewStore;
+                                       gtk_tree_view_set_headers_visible(view, FALSE );
 
                                        auto renderer = ui::CellRendererText(ui::New);
                                        object_set_boolean_property( G_OBJECT( renderer ), "editable", TRUE );
                                        renderer.connect("edited", G_CALLBACK( project_cell_edited ), &projectList );
 
                                        GtkTreeViewColumn* column = ui::TreeViewColumn( "", renderer, {{"text", 0}} );
-                                       gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
+                                       gtk_tree_view_append_column(view, column );
 
-                                       GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) );
+                                       GtkTreeSelection* selection = gtk_tree_view_get_selection(view );
                                        gtk_tree_selection_set_mode( selection, GTK_SELECTION_BROWSE );
 
                                        view.show();
 
-                                       buildView = view;
                                        projectList.m_store = store;
                                        scr.add(view);
 
@@ -892,19 +890,19 @@ ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi
                                frame.add(scr);
 
                                {
-                                       ui::ListStore store = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
+                                       auto store = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
 
-                                       ui::Widget view = ui::TreeView(ui::TreeModel( store ));
-                                       gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
+                                       auto view = ui::TreeView(ui::TreeModel( store ));
+                                       gtk_tree_view_set_headers_visible(view, FALSE );
 
                                        auto renderer = ui::CellRendererText(ui::New);
                                        object_set_boolean_property( G_OBJECT( renderer ), "editable", TRUE );
                                        renderer.connect( "edited", G_CALLBACK( commands_cell_edited ), store );
 
                                        GtkTreeViewColumn* column = ui::TreeViewColumn( "", renderer, {{"text", 0}} );
-                                       gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
+                                       gtk_tree_view_append_column(view, column );
 
-                                       GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) );
+                                       GtkTreeSelection* selection = gtk_tree_view_get_selection(view );
                                        gtk_tree_selection_set_mode( selection, GTK_SELECTION_BROWSE );
 
                                        view.show();
@@ -915,7 +913,7 @@ ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi
 
                                        view.connect( "key_press_event", G_CALLBACK( commands_key_press ), store );
 
-                                       auto sel = ui::TreeSelection(gtk_tree_view_get_selection( GTK_TREE_VIEW( buildView ) ));
+                                       auto sel = ui::TreeSelection(gtk_tree_view_get_selection(buildView ));
                                        sel.connect( "changed", G_CALLBACK( project_selection_changed ), store );
                                }
                        }
index 46d17b2..21b6e90 100644 (file)
@@ -408,18 +408,18 @@ void DoCommandListDlg(){
                        auto view = ui::TreeView(ui::TreeModel(store));
                        dialog.m_list = view;
 
-                       gtk_tree_view_set_enable_search( GTK_TREE_VIEW( view ), false ); // annoying
+                       gtk_tree_view_set_enable_search(view, false ); // annoying
 
                        {
                                auto renderer = ui::CellRendererText(ui::New);
                                GtkTreeViewColumn* column = ui::TreeViewColumn( "Command", renderer, {{"text", 0}, {"weight-set", 2}, {"weight", 3}} );
-                               gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
+                               gtk_tree_view_append_column(view, column );
                        }
 
                        {
                                auto renderer = ui::CellRendererText(ui::New);
                                GtkTreeViewColumn* column = ui::TreeViewColumn( "Key", renderer, {{"text", 1}, {"weight-set", 2}, {"weight", 3}} );
-                               gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
+                               gtk_tree_view_append_column(view, column );
                        }
 
                        view.show();
index 02bff91..cc523ad 100644 (file)
@@ -1317,7 +1317,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                                        ui::ListStore store = ui::ListStore(gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_POINTER ));
 
                                        auto view = ui::TreeView( ui::TreeModel(store ));
-                                       gtk_tree_view_set_enable_search( GTK_TREE_VIEW( view ), FALSE );
+                                       gtk_tree_view_set_enable_search(view, FALSE );
                                        gtk_tree_view_set_headers_visible( view, FALSE );
                                        view.connect( "button_press_event", G_CALLBACK( EntityClassList_button_press ), 0 );
                                        view.connect( "key_press_event", G_CALLBACK( EntityClassList_keypress ), 0 );
@@ -1400,24 +1400,24 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                                        {
                                                ui::ListStore store = ui::ListStore(gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_STRING ));
 
-                                               ui::Widget view = ui::TreeView(ui::TreeModel(store ));
-                                               gtk_tree_view_set_enable_search( GTK_TREE_VIEW( view ), FALSE );
-                                               gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
+                                               auto view = ui::TreeView(ui::TreeModel(store ));
+                                               gtk_tree_view_set_enable_search(view, FALSE );
+                                               gtk_tree_view_set_headers_visible(view, FALSE );
 
                                                {
                                                        auto renderer = ui::CellRendererText(ui::New);
                                                        GtkTreeViewColumn* column = ui::TreeViewColumn( "", renderer, {{"text", 0}} );
-                                                       gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
+                                                       gtk_tree_view_append_column(view, column );
                                                }
 
                                                {
                                                        auto renderer = ui::CellRendererText(ui::New);
                                                        GtkTreeViewColumn* column = ui::TreeViewColumn( "", renderer, {{"text", 1}} );
-                                                       gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
+                                                       gtk_tree_view_append_column(view, column );
                                                }
 
                                                {
-                                                       auto selection = ui::TreeSelection(gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) ));
+                                                       auto selection = ui::TreeSelection(gtk_tree_view_get_selection(view ));
                                                        selection.connect( "changed", G_CALLBACK( EntityProperties_selection_changed ), 0 );
                                                }
 
index bf2bf0e..ac90ccf 100644 (file)
@@ -296,25 +296,25 @@ void EntityList_constructWindow( ui::Window main_window ){
                window.add(scr);
 
                {
-                       ui::Widget view = ui::TreeView(ui::New);
-                       gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
+            auto view = ui::TreeView(ui::New);
+                       gtk_tree_view_set_headers_visible(view, FALSE );
 
                        auto renderer = ui::CellRendererText(ui::New);
                        GtkTreeViewColumn* column = gtk_tree_view_column_new();
                        gtk_tree_view_column_pack_start( column, renderer, TRUE );
                        gtk_tree_view_column_set_cell_data_func( column, renderer, entitylist_treeviewcolumn_celldatafunc, 0, 0 );
 
-                       GtkTreeSelection* select = gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) );
+                       GtkTreeSelection* select = gtk_tree_view_get_selection(view );
                        gtk_tree_selection_set_mode( select, GTK_SELECTION_MULTIPLE );
 
                        view.connect( "row_expanded", G_CALLBACK( entitylist_treeview_row_expanded ), 0 );
                        view.connect( "row_collapsed", G_CALLBACK( entitylist_treeview_rowcollapsed ), 0 );
 
-                       gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
+                       gtk_tree_view_append_column(view, column );
 
                        view.show();
                        scr.add(view);
-                       getEntityList().m_tree_view = GTK_TREE_VIEW( view );
+                       getEntityList().m_tree_view = view;
                }
        }
 
index 5edc590..ff0fa4c 100644 (file)
@@ -300,17 +300,17 @@ ui::Window CDbgDlg::BuildDialog(){
        {
                ui::ListStore store = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
 
-               ui::Widget view = ui::TreeView(ui::TreeModel(store ));
-               gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
+               auto view = ui::TreeView(ui::TreeModel(store ));
+               gtk_tree_view_set_headers_visible(view, FALSE );
 
                {
                        auto renderer = ui::CellRendererText(ui::New);
                        GtkTreeViewColumn* column = ui::TreeViewColumn( "", renderer, {{"text", 0}} );
-                       gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
+                       gtk_tree_view_append_column(view, column );
                }
 
                {
-                       auto selection = ui::TreeSelection(gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) ));
+                       auto selection = ui::TreeSelection(gtk_tree_view_get_selection(view ));
                        gtk_tree_selection_set_mode( selection, GTK_SELECTION_BROWSE );
                        selection.connect( "changed", G_CALLBACK( feedback_selection_changed ), NULL );
                }
index 03cbc21..55b747d 100644 (file)
@@ -835,20 +835,20 @@ void DoMapInfo(){
                        {
                                ui::ListStore store = ui::ListStore(gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_STRING ));
 
-                               ui::Widget view = ui::TreeView(ui::TreeModel(store ));
-                               gtk_tree_view_set_headers_clickable( GTK_TREE_VIEW( view ), TRUE );
+                               auto view = ui::TreeView(ui::TreeModel(store ));
+                               gtk_tree_view_set_headers_clickable(view, TRUE );
 
                                {
                                        auto renderer = ui::CellRendererText(ui::New);
                                        GtkTreeViewColumn* column = ui::TreeViewColumn( "Entity", renderer, {{"text", 0}} );
-                                       gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
+                                       gtk_tree_view_append_column(view, column );
                                        gtk_tree_view_column_set_sort_column_id( column, 0 );
                                }
 
                                {
                                        auto renderer = ui::CellRendererText(ui::New);
                                        GtkTreeViewColumn* column = ui::TreeViewColumn( "Count", renderer, {{"text", 1}} );
-                                       gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
+                                       gtk_tree_view_append_column(view, column );
                                        gtk_tree_view_column_set_sort_column_id( column, 1 );
                                }
 
index 6ad88df..561ce8b 100644 (file)
@@ -734,16 +734,16 @@ ui::Window PrefsDlg::BuildDialog(){
                                        auto store = ui::TreeStore(gtk_tree_store_new( 2, G_TYPE_STRING, G_TYPE_POINTER ));
 
                                        auto view = ui::TreeView(ui::TreeModel(store));
-                                       gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
+                                       gtk_tree_view_set_headers_visible(view, FALSE );
 
                                        {
                                                auto renderer = ui::CellRendererText(ui::New);
                                                GtkTreeViewColumn* column = ui::TreeViewColumn( "Preferences", renderer, {{"text", 0}} );
-                                               gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
+                                               gtk_tree_view_append_column(view, column );
                                        }
 
                                        {
-                                               auto selection = ui::TreeSelection(gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) ));
+                                               auto selection = ui::TreeSelection(gtk_tree_view_get_selection(view ));
                                                selection.connect( "changed", G_CALLBACK( treeSelection ), this );
                                        }
 
@@ -814,7 +814,7 @@ ui::Window PrefsDlg::BuildDialog(){
                                                }
                                        }
 
-                                       gtk_tree_view_expand_all( GTK_TREE_VIEW( view ) );
+                                       gtk_tree_view_expand_all(view );
 
                                        g_object_unref( G_OBJECT( store ) );
                                }
index 2894305..7607c4b 100644 (file)
@@ -259,13 +259,13 @@ CopiedString shader;
 ui::Window m_parent{ui::null};
 ui::GLArea m_gl_widget{ui::null};
 ui::Widget m_texture_scroll{ui::null};
-ui::Widget m_treeViewTree{ui::null};
-ui::Widget m_treeViewTags{ui::null};
+ui::TreeView m_treeViewTree{ui::null};
+ui::TreeView m_treeViewTags{ui::null};
 ui::Frame m_tag_frame{ui::null};
 ui::ListStore m_assigned_store{ui::null};
 ui::ListStore m_available_store{ui::null};
-ui::Widget m_assigned_tree{ui::null};
-ui::Widget m_available_tree{ui::null};
+ui::TreeView m_assigned_tree{ui::null};
+ui::TreeView m_available_tree{ui::null};
 ui::Widget m_scr_win_tree{ui::null};
 ui::Widget m_scr_win_tags{ui::null};
 ui::Widget m_tag_notebook{ui::null};
@@ -1540,7 +1540,7 @@ void TextureBrowser_constructTreeStore(){
        auto store = ui::TreeStore(gtk_tree_store_new( 1, G_TYPE_STRING ));
        TextureGroups_constructTreeModel( groups, store );
 
-       gtk_tree_view_set_model(GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTree ), store);
+       gtk_tree_view_set_model(g_TextureBrowser.m_treeViewTree, store);
 
        g_object_unref( G_OBJECT( store ) );
 }
@@ -1550,7 +1550,7 @@ void TextureBrowser_constructTreeStoreTags(){
        auto store = ui::TreeStore(gtk_tree_store_new( 1, G_TYPE_STRING ));
        GtkTreeModel* model = g_TextureBrowser.m_all_tags_list;
 
-       gtk_tree_view_set_model( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTags ), model );
+       gtk_tree_view_set_model(g_TextureBrowser.m_treeViewTags, model );
 
        g_object_unref( G_OBJECT( store ) );
 }
@@ -1558,7 +1558,7 @@ void TextureBrowser_constructTreeStoreTags(){
 void TreeView_onRowActivated( GtkTreeView* treeview, GtkTreePath* path, GtkTreeViewColumn* col, gpointer userdata ){
        GtkTreeIter iter;
 
-       GtkTreeModel* model = gtk_tree_view_get_model( GTK_TREE_VIEW( treeview ) );
+       GtkTreeModel* model = gtk_tree_view_get_model(treeview );
 
        if ( gtk_tree_model_get_iter( model, &iter, path ) ) {
                gchar dirName[1024];
@@ -1582,13 +1582,13 @@ void TreeView_onRowActivated( GtkTreeView* treeview, GtkTreePath* path, GtkTreeV
 
 void TextureBrowser_createTreeViewTree(){
        g_TextureBrowser.m_treeViewTree = ui::TreeView(ui::New);
-       gtk_tree_view_set_enable_search( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTree ), FALSE );
+       gtk_tree_view_set_enable_search(g_TextureBrowser.m_treeViewTree, FALSE );
 
-       gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTree ), FALSE );
+       gtk_tree_view_set_headers_visible(g_TextureBrowser.m_treeViewTree, FALSE );
        g_TextureBrowser.m_treeViewTree.connect( "row-activated", (GCallback) TreeView_onRowActivated, NULL );
 
        auto renderer = ui::CellRendererText(ui::New);
-       gtk_tree_view_insert_column_with_attributes( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTree ), -1, "", renderer, "text", 0, NULL );
+       gtk_tree_view_insert_column_with_attributes(g_TextureBrowser.m_treeViewTree, -1, "", renderer, "text", 0, NULL );
 
        TextureBrowser_constructTreeStore();
 }
@@ -1619,12 +1619,12 @@ void TextureBrowser_createContextMenu( ui::Widget treeview, GdkEventButton *even
                                        gdk_event_get_time( (GdkEvent*)event ) );
 }
 
-gboolean TreeViewTags_onButtonPressed( ui::Widget treeview, GdkEventButton *event ){
+gboolean TreeViewTags_onButtonPressed( ui::TreeView treeview, GdkEventButton *event ){
        if ( event->type == GDK_BUTTON_PRESS && event->button == 3 ) {
                GtkTreePath *path;
-               GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( treeview ) );
+               GtkTreeSelection* selection = gtk_tree_view_get_selection(treeview );
 
-               if ( gtk_tree_view_get_path_at_pos( GTK_TREE_VIEW( treeview ), event->x, event->y, &path, NULL, NULL, NULL ) ) {
+               if ( gtk_tree_view_get_path_at_pos(treeview, event->x, event->y, &path, NULL, NULL, NULL ) ) {
                        gtk_tree_selection_unselect_all( selection );
                        gtk_tree_selection_select_path( selection, path );
                        gtk_tree_path_free( path );
@@ -1638,14 +1638,14 @@ gboolean TreeViewTags_onButtonPressed( ui::Widget treeview, GdkEventButton *even
 
 void TextureBrowser_createTreeViewTags(){
        g_TextureBrowser.m_treeViewTags = ui::TreeView(ui::New);
-       gtk_tree_view_set_enable_search( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTags ), FALSE );
+       gtk_tree_view_set_enable_search(g_TextureBrowser.m_treeViewTags, FALSE );
 
        g_TextureBrowser.m_treeViewTags.connect( "button-press-event", (GCallback)TreeViewTags_onButtonPressed, NULL );
 
-       gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTags ), FALSE );
+       gtk_tree_view_set_headers_visible(g_TextureBrowser.m_treeViewTags, FALSE );
 
        auto renderer = ui::CellRendererText(ui::New);
-       gtk_tree_view_insert_column_with_attributes( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTags ), -1, "", renderer, "text", 0, NULL );
+       gtk_tree_view_insert_column_with_attributes(g_TextureBrowser.m_treeViewTags, -1, "", renderer, "text", 0, NULL );
 
        TextureBrowser_constructTreeStoreTags();
 }
@@ -1743,7 +1743,7 @@ void TextureBrowser_assignTags(){
        GSList* node;
        gchar* tag_assigned;
 
-       GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( g_TextureBrowser.m_available_tree ) );
+       GtkTreeSelection* selection = gtk_tree_view_get_selection(g_TextureBrowser.m_available_tree );
 
        gtk_tree_selection_selected_foreach( selection, (GtkTreeSelectionForeachFunc)TextureBrowser_tagMoveHelper, &selected );
 
@@ -1793,7 +1793,7 @@ void TextureBrowser_removeTags(){
        GSList* node;
        gchar* tag;
 
-       GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( g_TextureBrowser.m_assigned_tree ) );
+       GtkTreeSelection* selection = gtk_tree_view_get_selection(g_TextureBrowser.m_assigned_tree );
 
        gtk_tree_selection_selected_foreach( selection, (GtkTreeSelectionForeachFunc)TextureBrowser_tagMoveHelper, &selected );
 
@@ -1842,7 +1842,7 @@ void TextureBrowser_searchTags(){
        char buffer[256];
        char tags_searched[256];
 
-       GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTags ) );
+       GtkTreeSelection* selection = gtk_tree_view_get_selection(g_TextureBrowser.m_treeViewTags );
 
        gtk_tree_selection_selected_foreach( selection, (GtkTreeSelectionForeachFunc)TextureBrowser_tagMoveHelper, &selected );
 
@@ -2089,7 +2089,7 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){
 
                        TextureBrowser_createTreeViewTags();
 
-                       GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTags ) );
+                       GtkTreeSelection* selection = gtk_tree_view_get_selection(g_TextureBrowser.m_treeViewTags );
                        gtk_tree_selection_set_mode( selection, GTK_SELECTION_MULTIPLE );
 
                        gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW( g_TextureBrowser.m_scr_win_tags ), g_TextureBrowser.m_treeViewTags  );
@@ -2131,13 +2131,13 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){
                        g_TextureBrowser.m_assigned_tree = ui::TreeView(ui::TreeModel(g_TextureBrowser.m_assigned_store ));
                        g_TextureBrowser.m_assigned_store.unref();
                        g_TextureBrowser.m_assigned_tree.connect( "row-activated", (GCallback) TextureBrowser_removeTags, NULL );
-                       gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( g_TextureBrowser.m_assigned_tree ), FALSE );
+                       gtk_tree_view_set_headers_visible(g_TextureBrowser.m_assigned_tree, FALSE );
 
-                       GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( g_TextureBrowser.m_assigned_tree ) );
+                       GtkTreeSelection* selection = gtk_tree_view_get_selection(g_TextureBrowser.m_assigned_tree );
                        gtk_tree_selection_set_mode( selection, GTK_SELECTION_MULTIPLE );
 
                        GtkTreeViewColumn* column = ui::TreeViewColumn( "", renderer, {{"text", TAG_COLUMN}} );
-                       gtk_tree_view_append_column( GTK_TREE_VIEW( g_TextureBrowser.m_assigned_tree ), column );
+                       gtk_tree_view_append_column(g_TextureBrowser.m_assigned_tree, column );
                        g_TextureBrowser.m_assigned_tree.show();
 
                        scrolled_win.show();
@@ -2159,13 +2159,13 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){
                        g_TextureBrowser.m_available_tree = ui::TreeView(ui::TreeModel(g_TextureBrowser.m_available_store ));
                        g_TextureBrowser.m_available_store.unref();
                        g_TextureBrowser.m_available_tree.connect( "row-activated", (GCallback) TextureBrowser_assignTags, NULL );
-                       gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( g_TextureBrowser.m_available_tree ), FALSE );
+                       gtk_tree_view_set_headers_visible(g_TextureBrowser.m_available_tree, FALSE );
 
-                       GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( g_TextureBrowser.m_available_tree ) );
+                       GtkTreeSelection* selection = gtk_tree_view_get_selection(g_TextureBrowser.m_available_tree );
                        gtk_tree_selection_set_mode( selection, GTK_SELECTION_MULTIPLE );
 
                        GtkTreeViewColumn* column = ui::TreeViewColumn( "", renderer, {{"text", TAG_COLUMN}} );
-                       gtk_tree_view_append_column( GTK_TREE_VIEW( g_TextureBrowser.m_available_tree ), column );
+                       gtk_tree_view_append_column(g_TextureBrowser.m_available_tree, column );
                        g_TextureBrowser.m_available_tree.show();
 
                        scrolled_win.show();
@@ -2264,7 +2264,7 @@ void TextureBrowser_addTag(){
                gtk_list_store_set( g_TextureBrowser.m_available_store, &iter, TAG_COLUMN, tag.c_str(), -1 );
 
                // Select the currently added tag in the available list
-               GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( g_TextureBrowser.m_available_tree ) );
+               GtkTreeSelection* selection = gtk_tree_view_get_selection(g_TextureBrowser.m_available_tree );
                gtk_tree_selection_select_iter( selection, &iter );
 
                g_TextureBrowser.m_all_tags_list.append(TAG_COLUMN, tag.c_str());
@@ -2281,7 +2281,7 @@ void TextureBrowser_renameTag(){
 
        GSList* selected = NULL;
 
-       GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTags ) );
+       GtkTreeSelection* selection = gtk_tree_view_get_selection(g_TextureBrowser.m_treeViewTags );
        gtk_tree_selection_selected_foreach( selection, GtkTreeSelectionForeachFunc( TextureBrowser_selectionHelper ), &selected );
 
        if ( g_slist_length( selected ) == 1 ) { // we only rename a single tag
@@ -2323,7 +2323,7 @@ void TextureBrowser_renameTag(){
 void TextureBrowser_deleteTag(){
        GSList* selected = NULL;
 
-       GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTags ) );
+       GtkTreeSelection* selection = gtk_tree_view_get_selection(g_TextureBrowser.m_treeViewTags );
        gtk_tree_selection_selected_foreach( selection, GtkTreeSelectionForeachFunc( TextureBrowser_selectionHelper ), &selected );
 
        if ( g_slist_length( selected ) == 1 ) { // we only delete a single tag
@@ -2408,7 +2408,7 @@ void TextureBrowser_RefreshShaders(){
        ScopeDisableScreenUpdates disableScreenUpdates( "Processing...", "Loading Shaders" );
        GlobalShaderSystem().refresh();
        UpdateAllWindows();
-       GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(GlobalTextureBrowser().m_treeViewTree));
+       GtkTreeSelection* selection = gtk_tree_view_get_selection(GlobalTextureBrowser().m_treeViewTree);
        GtkTreeModel* model = NULL;
        GtkTreeIter iter;
        if ( gtk_tree_selection_get_selected (selection, &model, &iter) )