Public feed #887901

Miscellany

public text v1 · immutable
Raw Edit
·published 2008-02-01 18:23 UTC
rendered paste body
# -*- coding: utf-8 -*-
 
import gtk
from Plugin import Plugin
 
def enable_rgba(widget, old_screen=None):
    screen = widget.get_screen()
    colormap = screen.get_rgba_colormap()
    if colormap == None:
        print 'Your screen does not support alpha channels!'
        colormap = screen.get_rgb_colormap()
    else:
        print 'Your screen supports alpha channels!'
    gtk.widget_set_default_colormap(colormap)
 
class MainClass(Plugin):
 
    def __init__(self, controller, msn):
        Plugin.__init__(self, controller, msn)
 
        self.description = _('Enable RGBA Visuals')
        self.authors = {'Andrea Cimitan': 'andrea.cimitan@gmail.com'}
        self.website = 'http://www.cimitan.com'
        self.displayName = _('RGBA Visual')
        self.name = 'RGBAVisual'
 
        self.controller = controller
        self.window = controller.mainWindow
 
    def start(self):
        self.enabled = True
        enable_rgba(self.window)
 
    def stop(self):
        self.enabled = False
 
    def check(self):
        return (True, 'Ok')