Wrap more GTK
[xonotic/netradiant.git] / radiant / feedback.cpp
index 4ef1415..a465ed6 100644 (file)
@@ -266,7 +266,7 @@ void CDbgDlg::Init(){
        }
 
        if ( m_clist ) {
-               gtk_list_store_clear( m_clist );
+               m_clist.clear();
        }
 }
 
@@ -279,12 +279,10 @@ void CDbgDlg::Push( ISAXHandler *pHandler ){
        }
 
        // put stuff in the list
-       gtk_list_store_clear( m_clist );
+       m_clist.clear();
        for ( std::size_t i = 0; i < static_cast<std::size_t>( m_pFeedbackElements->len ); ++i )
        {
-               GtkTreeIter iter;
-               gtk_list_store_append( m_clist, &iter );
-               gtk_list_store_set( m_clist, &iter, 0, GetElement( i )->getName(), -1 );
+               m_clist.append(0, GetElement(i)->getName());
        }
 
        ShowDlg();
@@ -293,7 +291,7 @@ void CDbgDlg::Push( ISAXHandler *pHandler ){
 ui::Window CDbgDlg::BuildDialog(){
        auto window = MainFrame_getWindow().create_floating_window("Q3Map debug window" );
 
-       auto scr = ui::ScrolledWindow();
+       auto scr = ui::ScrolledWindow(ui::New);
        scr.show();
        window.add(scr);
        gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC );
@@ -306,22 +304,22 @@ ui::Window CDbgDlg::BuildDialog(){
                gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
 
                {
-                       auto renderer = ui::CellRendererText();
+                       auto renderer = ui::CellRendererText(ui::New);
                        GtkTreeViewColumn* column = ui::TreeViewColumn( "", renderer, {{"text", 0}} );
                        gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
                }
 
                {
-                       GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) );
+                       auto selection = ui::TreeSelection(gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) ));
                        gtk_tree_selection_set_mode( selection, GTK_SELECTION_BROWSE );
-                       g_signal_connect( G_OBJECT( selection ), "changed", G_CALLBACK( feedback_selection_changed ), NULL );
+                       selection.connect( "changed", G_CALLBACK( feedback_selection_changed ), NULL );
                }
 
                view.show();
 
                scr.add(view);
 
-               g_object_unref( G_OBJECT( store ) );
+               store.unref();
 
                m_clist = store;
        }