Gtk theme: how to match the name of the widget ?

Hi,

I define my own gtk 2 theme (gtkrc) and I want to match specific widget by name. Is it possible?
Class and widget_class are working. I want to have two different wx.ScrolledWindow in the same app moded by gtkrc

For example:

import wx
import os

os.environ[‘GTK2_RC_FILES’] = “/usr/share/themes/Test/gtk-2.0/gtkrc”

class Test(wx.Frame):
def init(self, parent, id, title):
wx.Frame.init(self, parent, id, title, size=(350, 350), style=wx.CAPTION | wx.SYSTEM_MENU | wx.CLOSE_BOX)

            panel = wx.Panel(self, 1)

            scroll = wx.ScrolledWindow(panel, 2, pos=(20,20), size=(300,300))
            scroll.SetScrollbars(1, 1, 800, 600)
            scroll.SetName("widgetName")

class MyApp(wx.App):
def OnInit(self):
frame = Test(None, -1, ‘Test’)
frame.SetName(“appName”)
frame.Show(True)
return True

app = MyApp()
app.MainLoop()

My gtkrc:

style “scrollbar”
{
GtkScrollbar::slider-width = 30
}

class “GtkScrollbar” style “scrollbar” # it works
class “appName.widgetName” style “scrollbar” # it does not work
class “*.appName.widgetName” style “scrollbar” # it does not work too

I am not sure if I defined style in gtkrc well and I am not sure if SetName() propagate name to the gtk layer.
Thanks for any response.

I don't think that it does, as far as I know it is only used in the wx layer. It might be able to be changed to set the widget names at the gtk level though, especially if you submit a patch to do it.

···

freak.czech@gmail.com wrote:

Hi,

I define my own gtk 2 theme (gtkrc) and I want to match specific widget
by name. Is it possible?
Class and widget_class are working. I want to have two different
wx.ScrolledWindowin the same app moded by gtkrc

I am not sure if I defined style in gtkrc well and I am not sure if
SetName() propagate name to the gtk layer.

--
Robin Dunn
Software Craftsman