예제 #1
0
    def __init__(self, prop, *args, **kwargs):
        Button.__init__(self, *args, **kwargs)

        # Styling
        context = self.get_style_context()      
        provider = CssProvider()
        resource = 'ml/prevete/Daty/gtk/property.css'
        provider.load_from_resource(resource)
        context.add_provider(provider, STYLE_PROVIDER_PRIORITY_APPLICATION) 

        context = self.description.get_style_context()
        set_style(context, resource, 'popover_description', True)

        self.set_label(prop["Label"], prop["Description"])
        self.description.set_text(prop['Description'])
        self.description.set_line_wrap(True)
예제 #2
0
    def __init__(self,
                 *args,
                 image=None,
                 tooltip=None,
                 callback=None,
                 cb_args={},
                 **kwargs):
        Button.__init__(self, *args, **kwargs)

        # Styling
        context = self.get_style_context()
        provider = CssProvider()
        provider.load_from_resource('/ml/prevete/Daty/gtk/roundedbutton.css')
        context.add_provider(provider, STYLE_PROVIDER_PRIORITY_APPLICATION)

        if callback:
            self.connect("clicked", callback, *cb_args)

        if image:
            self.image.set_from_icon_name(image, IconSize.BUTTON)

        if tooltip:
            self.set_tooltip_text(tooltip)