📄 refresh_table.c
字号:
/* * Compaq Hot Plug Controller Graphical User Interface * Copyright 2000, 2001 Compaq Computer Corporation * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or * NON INFRINGEMENT. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Please send all questions or concerns to linuxhotplug@compaq.com */#include "commonheader.h"#include "refresh_table.h"#include "build_table.h"#include "tree.h" // need for pci tree node structure// refresh the table void refresh_table(GtkWidget* table, GtkCTreeNode* node){ int i; int rt; char* widgetrow[2]; GtkCList* clist = GTK_CLIST(table); rt = sem_trywait(&critical); if (rt != 0) { // g_print("Trywait failed!\n"); return; } if (node) { pci_tree_node* p_node = ctree_partner(g_tree, node, slot_based); (*(p_node->build_table_data))(table, p_node); } // check if internal structure size equals the size of the table on display if (g_table_size != clist->rows) build_table(table, node); gtk_clist_freeze(GTK_CLIST(table)); for (i=0; i < g_table_size; i++) { widgetrow[0] = &(g_table_array[i*MAXLEN]); widgetrow[1] = &(g_table_array[i*MAXLEN + MAXLEN/4]); gtk_clist_set_text(GTK_CLIST(table), i, 0, widgetrow[0]); gtk_clist_set_text(GTK_CLIST(table), i, 1, widgetrow[1]); gtk_clist_set_cell_style(GTK_CLIST(table), i, 0, g_style_array[i][0]); gtk_clist_set_cell_style(GTK_CLIST(table), i, 1, g_style_array[i][1]); gtk_clist_set_selectable(GTK_CLIST(table), i, FALSE); } gtk_clist_thaw(GTK_CLIST(table)); sem_post(&critical);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -