May-26-2017, 03:32 PM
thanks!
if you look at post #1, that's what i used to implement the gtk2 solution.
for gtk3, this:
i can now get some information about gtk colors without showing a window:
if i uncomment the last 3 lines i also get a long list of gtk3 properties; but i
- don't know how to get at the values
- don't know if they're even filled with current values.
any help appreciated.
o.
(May-25-2017, 05:26 PM)Larz60+ Wrote: (using pygtk and package)afaiu pygtk is python2 and works only with gtk2.
if you look at post #1, that's what i used to implement the gtk2 solution.
for gtk3, this:
Quote:http://python.6.x6.nabble.com/GTK3-get-b...03859.htmlis a little closer to what I want.
i can now get some information about gtk colors without showing a window:
#!/usr/bin/env python import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk def on_button_clicked(button, tv): style = tv.get_style_context() bgcolor = style.get_background_color(Gtk.StateType.NORMAL) print(bgcolor) win = Gtk.Window() vb = Gtk.VBox() tv = Gtk.TextView() vb.add(tv) win.show_all() style = tv.get_style_context() bgcolor = style.get_background_color(Gtk.StateType.NORMAL) print(bgcolor) #settings = Gtk.Settings.get_default() #for i in settings.list_properties(): # print(i)this will give me reasonable color values:
Output:Gdk.RGBA(red=0.866667, green=0.866667, blue=0.866667, alpha=1.000000)
halfway there.if i uncomment the last 3 lines i also get a long list of gtk3 properties; but i
- don't know how to get at the values
- don't know if they're even filled with current values.
any help appreciated.
o.