Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1219)

Unified Diff: views/controls/table/native_table_gtk.cc

Issue 6256004: views: Implement NativeTableGtk::RemoveColumn method. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/table/native_table_gtk.cc
diff --git a/views/controls/table/native_table_gtk.cc b/views/controls/table/native_table_gtk.cc
index 633705bd9574420d0b401e324810c095770c0d76..99569995c41ba5cc6bf5485700c8ee629ababe70 100644
--- a/views/controls/table/native_table_gtk.cc
+++ b/views/controls/table/native_table_gtk.cc
@@ -69,14 +69,24 @@ void NativeTableGtk::InsertColumn(const TableColumn& column, int index) {
NOTIMPLEMENTED();
}
-void NativeTableGtk::RemoveColumn(int index) {
- NOTIMPLEMENTED();
+void NativeTableGtk::RemoveColumn(int column_index) {
+ if (!native_view())
+ return;
+
+ GtkTreeViewColumn* column = gtk_tree_view_get_column(tree_view_,
+ column_index);
+ if (column) {
+ gtk_tree_view_remove_column(tree_view_, column);
+
+ if (table_->model()->RowCount() > 0)
+ OnRowsChanged(0, table_->model()->RowCount() - 1);
+ }
}
int NativeTableGtk::GetColumnWidth(int column_index) const {
GtkTreeViewColumn* column = gtk_tree_view_get_column(tree_view_,
column_index);
- return gtk_tree_view_column_get_width(column);
+ return column ? gtk_tree_view_column_get_width(column) : -1;
}
void NativeTableGtk::SetColumnWidth(int column_index, int width) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698