Fwd: Formatted text for tables.




---------- Forwarded message ----------
From: Shalom Bhooshi <s bhooshi gmail com>
Date: Feb 13, 2008 4:47 AM
Subject: Formatted text for tables.
To: Gtk2-Perl Mailing List <gtk-perl-list gnome org>
Cc: Shalom Bhooshi <s bhooshi gmail com>


Greetings All,

I've been trying (albeit unsuccessfully) to try and achieve something like this within rows of a table. Let me draw out a row first so it's a little clearer to explain what I am trying to do.

|``````````````|``````````````````````````````````````````````````````````````````|
|    Icon    |                      Item                                      |
|    Here   |``````````````````````````````````````````````````````````````````|
|              |              Information/Description                   |
``````````````````````````````````````````````````````````````````````````````````

So, I've managed to setup the liststore and table and have managed to get multilines within the second column but my predicament now is how I can

1. Format the description text differently (smaller font, different colour, etc) to other text in the cell.
2. Hightlight search terms (different fill colour, bolder font, etc)

I'm not very familiar with Gtk2 just yet but from what I have understood so far, I might have to subclass Gtk2::CellRenderer and/or Gtk::Entry (from which this might be possible). But what I don't really know how to do via this method is

1. Tie (loosely said) an Entry object to a CellRenderer and have the formatted text renderered in the cell
2. Return the composite object back to the program to be used in a TreeViewColumn.
3. How to format the text stored in the Liststore.

Again, I'm not very capable around Gtk2/Perl just yet, so maybe I am barking up the wrong tree by going down this route.

I seek your advice and would appreciate any feedback. I would also be very grateful if you could throw in some code/examples/links that could get me moving in the right direction.

Many Thanks,

Shalom

PS. An example application - http://www.galago-project.org/images/screenshots/beagle-galago.png
PPS. I've attached the attempt at a prototype i've been working on

Attachment: gtk2_treeview_simple
Description: Binary data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]