Hi All,
I am facing a color issue with GtkTreeView on both Nokia 770 and 800.
on 770 for "selected" color, base[NORMAL] color isjavascript:SetCmd(cmdSend);
displayed.
On GTK-2.0 expected behaviour comes.
on 800 only default selected color is displayed.
I have pasted my program here. I kept it as gtk because i have seen hildon
also supports gtk programming.
/******************************************************/
#include <gtk/gtk.h>
enum
{
COL_NAME = 0,
COL_AGE,
NUM_COLS
};
static GtkTreeModel *
create_and_fill_model (void)
{
GtkListStore *store;
GtkTreeIter iter;
store = gtk_list_store_new (NUM_COLS, G_TYPE_STRING, G_TYPE_UINT);
/* Append a row and fill in some data */
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
COL_NAME, "Heinz El-Mann",
COL_AGE, 51,
-1);
/* append another row and fill in some data */
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
COL_NAME, "Jane Doe",
COL_AGE, 23,
-1);
/* ... and a third row */
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
COL_NAME, "Joe Bungop",
COL_AGE, 91,
-1);
return GTK_TREE_MODEL (store);
}
static GtkWidget *
create_view_and_model (void)
{
GtkCellRenderer *renderer;
GtkTreeModel *model;
GtkWidget *view;
view = gtk_tree_view_new ();
gtk_widget_set_name(view, "aud_view");
/* --- Column #1 --- */
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view),
-1,
"Name",
renderer,
"text", COL_NAME,
NULL);
/* --- Column #2 --- */
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view),
-1,
"Age",
renderer,
"text", COL_AGE,
NULL);
model = create_and_fill_model ();
gtk_tree_view_set_model (GTK_TREE_VIEW (view), model);
gtk_widget_set_name(model, "aud_view");
/* The tree view has acquired its own reference to the
* model, so we can drop ours. That way the model will
* be freed automatically when the tree view is destroyed */
g_object_unref (model);
return view;
}
int
main (int argc, char **argv)
{
GtkWidget *window;
GtkWidget *view;
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_rc_parse("tree_resource.rc");
g_signal_connect (window, "delete_event", gtk_main_quit, NULL); /* dirty */
view = create_view_and_model ();
gtk_container_add (GTK_CONTAINER (window), view);
gtk_widget_show_all (window);
gtk_main ();
return 0;
}
/*********************************************************/
The resource file:
style "aud-treeview"
{
GtkTreeView::odd_row_color = "#F5F2ED"
GtkTreeView::even_row_color = "#FAF9F7"
fg[NORMAL] = "#ffffff"
fg[PRELIGHT] = "#ffffff"
fg[ACTIVE] = "#ffffff"
fg[SELECTED] = "#ffffff"
fg[INSENSITIVE] = "#ffffff"
bg[NORMAL] = "#ffffff"
bg[PRELIGHT] = "#ffffff"
bg[ACTIVE] = "#ffffff"
bg[SELECTED] = "#ff0000"
bg[INSENSITIVE] = "#ffffff"
base[NORMAL] = "#ffffff"
base[PRELIGHT] = "#ffffff"
base[ACTIVE] = "#ffffff"
base[SELECTED] = "#ff0000"
base[INSENSITIVE] = "#ffffff"
text[NORMAL] = "#000000"
text[PRELIGHT] = "#000000"
text[ACTIVE] = "#000000"
text[SELECTED] = "#000000"
text[INSENSITIVE] = "#000000"
}
widget "*.aud_view" style "aud-treeview"
/**************************************************************************/
here for selected row, it displays only white color.
What can be the option to solve this problem ?
Thanks.
Best Regards,
Raviprasad Sharma K
DISCLAIMER:
This message (including attachment if any) is confidential and may be
privileged. If you have received this message by mistake please notify the
sender by return e-mail and delete this message from your system. Any
unauthorized use or dissemination of this message in whole or in part is
strictly prohibited.
E-mail may contain viruses. Before opening attachments please check them for
viruses and defects. While MindTree Consulting Limited (MindTree) has put in
place checks to minimize the risks, MindTree will not be responsible for any
viruses or defects or any forwarded attachments emanating either from within
MindTree or outside.
Please note that e-mails are susceptible to change and MindTree shall not be
liable for any improper, untimely or incomplete transmission.
MindTree reserves the right to monitor and review the content of all messages
sent to or from MindTree e-mail address. Messages sent to or from this e-mail
address may be stored on the MindTree e-mail system or else where.
_______________________________________________
maemo-developers mailing list
[email protected]
https://lists.maemo.org/mailman/listinfo/maemo-developers