Gdk RGBA color



Hi,

I'm trying to utilize the c functions:

gtk_widget_override_color() 
gtk_widget_override_background_color()

The problem I'm facing is that a blessed Gdk::RGBA object is required.
How do I do it?

A Python example out there in googleland says
############################################# 
from gi.repository import Gdk

supposing that Gtk.TextView instance is called doc

doc.override_background_color(Gtk.StateFlags.NORMAL, Gdk.RGBA(0, 0, 0, 1))

change the Gdk.RGBA(0, 0, 0, 1) as you wish

rgba, each value lies between 0.0 and 0.1, r stands for red, g for green, b for blue and a stands for alpha.
###############################################

When I try to run it in Perl, I'm stuck at how to get  Gdk.RGBA(0, 0, 0, 1)
translated to Perl.  "Use Gdk;" dosn't seem to work.

I tried this ( with a few variations) :

$textview1->override_background_color('normal', Gtk3::Gdk::RGBA( 0,0,0,1 ) );

but no luck. 

Any clues on how to create the RGBA object?

Thanks,
zentara










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