Subversion Repositories basico

Compare Revisions

Ignore whitespace Rev 73 → Rev 74

/trunk/basico/uifuncs.py
15,12 → 15,27
 
class UIFuncs(Service):
def initialize(self):
self.log.debug("Loading common UI Funcs service")
self.gui = self.app.get_service('GUI')
self.cb = self.app.get_service('Callbacks')
self.im = self.app.get_service('IM')
 
 
def get_gtk_version(self):
return Gtk.get_major_version(), Gtk.get_minor_version(), Gtk.get_micro_version()
 
 
def check_gtk_version(self):
vmajor, vminor, vmicro = self.get_gtk_version()
self.log.debug("GTK+ Version: %d.%d.%d" % (vmajor, vminor, vmicro))
 
if vmajor == 3 and vminor >= 18:
self.log.debug("GTK+ version supported")
return True
else:
self.log.error("Please, install a modern version of GTK+ (>= 3.18)")
return False
 
 
def get_label(self, text, xalign=0.5, yalign=0.5):
label = Gtk.Label()
label.set_selectable(False)