Re: [gtk-list] gtk-perl + styles



Noonian wrote:
> 
> I'm trying to change the fg/bg of a Gtk::Text in gtk-perl and can't quite
> seem to fiugre out how to do it.  It's pretty easy in C, but afaik I dont
> have write access to the data members of a Gtk::Style.  I see accessors,
> but no mutators.  Any pointers?
I have used something like this:

  my $cm = $window->TOPLEVEL->window->get_colormap;
  my $red = $cm->color_alloc({red=>65000, green=>0, blue=>0});

  my $style = new Gtk::Style;
  $style->font(
    Gtk::Gdk::Font->load(
      '-*-helvetica-bold-r-normal-*-*-120-*-*-p-*-iso8859-1'));
  $style->fg('normal', $red);    # for Gtk::Label
  $style->text('normal', $red);  # for Gtk::Text

  $gtklabel->set_style($style);
  $gtktext->set_style($style);

Please excuse any cut-and-paste errors.

Regards, Dermot




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