Re: Gtk2::CellRendererText font issue



On 2 May 2003, Guillaume Cottenceau wrote:

Chas Owens <alas wilma widomaker com> writes:

I have set the font for a Gtk2::TreeView by saying

my $list     = Gtk2::TreeView->new($store);
my $renderer = Gtk2::CellRendererText->new;
$renderer->set("editable", 1);
$renderer->set("font", "Monospace 20");

my $i;
for my $col (@cols) {
    $list->append_column(
            Gtk2::TreeViewColumn->new_with_attributes(
                    $col,
                    $renderer,
                    text => $i++
            )
    );
}

and it works. Or at least it works until I go to edit a cell.
Then the font drops back to original size. When I am finished
editing it jumps back. Is there some way to set the font size
for editing?

you may want to list the properties of the $renderer, maybe it
will help you guess if there is something like font-edited or
anything of the like, being special when text is being edited.


--
Guillaume Cottenceau - http://people.mandrakesoft.com/~gc/


How do I list the properties of a widget?  I found the "font" property by looking through the Gtk docs at 
developer.gnome.org.  Unfortunatly they don't list anything like "font-edited" in the list there.

I have also tried

$list->modify_font(Gtk2::Pango::FontDescription->from_string("Monospace 20"));

and

$renderer->set(
        "font-desc",
        Gtk2::Pango::FontDescription->from_string("Monospace 20")
);

but the same thing happens.




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