cellrenderer

Change the color of one or more nodes in Jtree dynamically

大憨熊 提交于 2021-01-28 14:12:38
问题 I have created Jtree with Root node and 4Subnodes. My problem is like this: I need to change the foreground and background color of a particular node dynamically. How can i do it? Help me with some piece of code. Thank you all in advance... 回答1: How can i do it? I'm sure that JTree tutorial contains valuable info about DefaultTreeCellRenderer, Help me with some piece of code. tons of examples here or here or here 回答2: One easy way I found was to include HTML markup in the node text. The

How to make a column with a string and pixbuf in GtkTreeview?

眉间皱痕 提交于 2021-01-27 07:45:33
问题 I'm working in a app with Gtk+2 and i need to implement a File treeview. the actual code it's: public FileTree() { store = new TreeStore(2,typeof(string),typeof(string)); this.change_dir( "/dir/path" ); set_model( store ); // File icon var pixbuf = new Gtk.CellRendererPixbuf(); var column = new Gtk.TreeViewColumn(); column.set_title(""); column.pack_start(pixbuf, false); column.add_attribute(pixbuf,"stock-id",0); column.set_alignment(1.0f); append_column (column); // File name Gtk

How to make a column with a string and pixbuf in GtkTreeview?

让人想犯罪 __ 提交于 2021-01-27 07:44:57
问题 I'm working in a app with Gtk+2 and i need to implement a File treeview. the actual code it's: public FileTree() { store = new TreeStore(2,typeof(string),typeof(string)); this.change_dir( "/dir/path" ); set_model( store ); // File icon var pixbuf = new Gtk.CellRendererPixbuf(); var column = new Gtk.TreeViewColumn(); column.set_title(""); column.pack_start(pixbuf, false); column.add_attribute(pixbuf,"stock-id",0); column.set_alignment(1.0f); append_column (column); // File name Gtk

How to make a column with a string and pixbuf in GtkTreeview?

我是研究僧i 提交于 2021-01-27 07:44:53
问题 I'm working in a app with Gtk+2 and i need to implement a File treeview. the actual code it's: public FileTree() { store = new TreeStore(2,typeof(string),typeof(string)); this.change_dir( "/dir/path" ); set_model( store ); // File icon var pixbuf = new Gtk.CellRendererPixbuf(); var column = new Gtk.TreeViewColumn(); column.set_title(""); column.pack_start(pixbuf, false); column.add_attribute(pixbuf,"stock-id",0); column.set_alignment(1.0f); append_column (column); // File name Gtk

ag-grid set cellRendererParams to values from the row data

白昼怎懂夜的黑 提交于 2020-12-15 05:45:52
问题 I want to send data to my cellRenderer component via the cellRendererParams object but I don't know how to access row data for this. Here's an example of what I want to do: cellRendererParams: { label: currentRowData.myField + currentRowData.myOtherField } I don't want my cellRenderer component to have knowledge of the data structure of the grid since I may use it in other grids with different row data. 回答1: there are many ways: 1) valueGetter: (params) => ({ property1: params.data.myField1 +

ag-grid set cellRendererParams to values from the row data

£可爱£侵袭症+ 提交于 2020-12-15 05:45:06
问题 I want to send data to my cellRenderer component via the cellRendererParams object but I don't know how to access row data for this. Here's an example of what I want to do: cellRendererParams: { label: currentRowData.myField + currentRowData.myOtherField } I don't want my cellRenderer component to have knowledge of the data structure of the grid since I may use it in other grids with different row data. 回答1: there are many ways: 1) valueGetter: (params) => ({ property1: params.data.myField1 +

GTK3 custom cell renderer, that outputs widgets

ⅰ亾dé卋堺 提交于 2020-07-10 07:52:21
问题 I'm looking for a way to output random widgets in the TreeView cells. The lifecycle of these widgets is 100% controlled by me manually outside of the parent TreeView. Don't care about keyboard navigation and accessibility (so far). What I got by now is a modified official example. Header: #include <gtk/gtk.h> #define TYPE_RECKLESS_CELL_RENDERER (reckless_cell_renderer_get_type()) #define RECKLESS_CELL_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_RECKLESS_CELL_RENDERER,

GTK3 custom cell renderer, that outputs widgets

為{幸葍}努か 提交于 2020-07-10 07:50:42
问题 I'm looking for a way to output random widgets in the TreeView cells. The lifecycle of these widgets is 100% controlled by me manually outside of the parent TreeView. Don't care about keyboard navigation and accessibility (so far). What I got by now is a modified official example. Header: #include <gtk/gtk.h> #define TYPE_RECKLESS_CELL_RENDERER (reckless_cell_renderer_get_type()) #define RECKLESS_CELL_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_RECKLESS_CELL_RENDERER,

JTable cell text color changing

不打扰是莪最后的温柔 提交于 2020-01-30 06:34:27
问题 I´m rather new to Java and programming itself, so excuse me for the question. What I´m trying to do is the following: I´m making a bookkeeping program. On the column where the income/outcome is displayed, I want it so when the user enters a negative number (eg. -1.150€), the number turns red( or any color really, but red is what most bookkeeping programs use). only that specific cell on that column only. I have not started with a code yet so I cannot input one here. I also do not need it to

JTree TreeCellRenderer raising issue on showing the selection color

不问归期 提交于 2020-01-14 16:49:09
问题 I am using this below piece of code: class CountryTreeCellRenderer implements TreeCellRenderer { private JLabel label; CountryTreeCellRenderer() { label = new JLabel(); } public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { Object o = ((DefaultMutableTreeNode) value).getUserObject(); if (o instanceof Country) { Country country = (Country) o; label.setIcon(new ImageIcon(country.getFlagIcon()));