[Sugar-devel] How to use CSS style sheets to style widgets in Sugar Activities [Gtk3]

Aneesh Dogra lionaneesh at gmail.com
Thu Dec 13 08:53:55 EST 2012


Works! Thanks a lot. :)


On Thu, Dec 13, 2012 at 3:33 PM, Flavio Danesse <fdanesse at gmail.com> wrote:

> screen = Gdk.Screen.get_default()
> css_provider = Gtk.CssProvider()
> style_path = os.path.join(JAMediaObjectsPath, "JAMediaEstilo.css")
> css_provider.load_from_path(style_path)
> context = Gtk.StyleContext()
> context.add_provider_for_screen(
>     screen,
>     css_provider,
>     Gtk.STYLE_PROVIDER_PRIORITY_USER)
>
>
>
> 2012/12/13 Aneesh Dogra <lionaneesh at gmail.com>
>
>> I am trying to get a functionality like
>> http://erikos.sweettimez.de/page/2/
>>
>> I tried adding :-
>>
>> style_context = self.get_style_context()
>>
>> css_provider = Gtk.CssProvider()
>> css_provider.load_from_path('gtk-widgets1.css')
>>
>> style_context.add_provider(css_provider,
>>                            Gtk.STYLE_PROVIDER_PRIORITY_USER)
>>
>>
>> in the Application's init but it doesn't seem to work.
>>
>> I would prefer to get the exact same functionality but any alternates
>> which can provide similar effects should do the job. What I don't wanna use
>> is cairo. I want something CSS like.
>>
>> I am mainly trying to style a Gtk.TextView and Gtk.Entry.
>> --
>> Thanks
>> Aneesh Dogra (lionaneesh)
>>
>> _______________________________________________
>> Sugar-devel mailing list
>> Sugar-devel at lists.sugarlabs.org
>> http://lists.sugarlabs.org/listinfo/sugar-devel
>>
>>
>


-- 
Thanks
Aneesh Dogra (lionaneesh)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20121213/b56bb5d2/attachment-0001.html>


More information about the Sugar-devel mailing list