~daubers/+junk/rdghackauthbot

« back to all changes in this revision

Viewing changes to rdghacksignbot/rdghacksignbot_lib/AboutDialog.py

  • Committer: Matt Daubney
  • Date: 2011-12-29 22:25:47 UTC
  • Revision ID: matt@daubers.co.uk-20111229222547-e10vqkoc0y6pnr5w
* GTK stuff

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
 
2
### BEGIN LICENSE
 
3
# This file is in the public domain
 
4
### END LICENSE
 
5
 
 
6
from gi.repository import Gtk # pylint: disable=E0611
 
7
 
 
8
from . helpers import get_builder
 
9
 
 
10
class AboutDialog(Gtk.AboutDialog):
 
11
    __gtype_name__ = "AboutDialog"
 
12
 
 
13
    def __new__(cls):
 
14
        """Special static method that's automatically called by Python when 
 
15
        constructing a new instance of this class.
 
16
        
 
17
        Returns a fully instantiated AboutDialog object.
 
18
        """
 
19
        builder = get_builder('AboutRdghacksignbotDialog')
 
20
        new_object = builder.get_object("about_rdghacksignbot_dialog")
 
21
        new_object.finish_initializing(builder)
 
22
        return new_object
 
23
 
 
24
    def finish_initializing(self, builder):
 
25
        """Called while initializing this instance in __new__
 
26
 
 
27
        finish_initalizing should be called after parsing the ui definition
 
28
        and creating a AboutDialog object with it in order
 
29
        to finish initializing the start of the new AboutRdghacksignbotDialog
 
30
        instance.
 
31
        
 
32
        Put your initialization code in here and leave __init__ undefined.
 
33
        """
 
34
        # Get a reference to the builder and set up the signals.
 
35
        self.builder = builder
 
36
        self.ui = builder.get_ui(self)
 
37