def NewBigredbuttonWindow(parallelport, verbose=False, on=0xff, off=0):
    """NewBigredbuttonWindow - returns a fully instantiated
    BigredbuttonWindow object. Use this function rather than
    creating a BigredbuttonWindow directly.
    """

    #look for the ui file that describes the ui
    basic_path = os.path.join(getdatapath(), 'ui')
    ui_filename = os.path.join(getdatapath(), 'ui', 'BigredbuttonWindow.ui')
    
    if not os.path.exists(ui_filename):
        ui_filename = None

    builder = gtk.Builder()
    builder.add_from_file(ui_filename)
    #builder.add_from_file(about_filename)
    window = builder.get_object("bigredbutton_window")
    window.finish_initializing(builder, on=on, off=off, verbose=verbose, \
            port=parallelport)
    return window
def NewTimerDialog():
    #look for the ui file that describes the ui
    ui_filename = os.path.join(getdatapath(), 'ui', 'TimerBigredbuttonDialog.ui')
    if not os.path.exists(ui_filename):
        ui_filename = None

    builder = gtk.Builder()
    builder.add_from_file(ui_filename)
    dialog = builder.get_object('timer_bigredbutton_dialog')
    dialog.finish_initializing(builder)
    return dialog
def NewValueDialog(on_value, off_value):
    #look for the ui file that describes the ui
    ui_filename = os.path.join(getdatapath(), 'ui', 'ValueBigredbuttonDialog.ui')
    if not os.path.exists(ui_filename):
        ui_filename = None

    builder = gtk.Builder()
    builder.add_from_file(ui_filename)
    dialog = builder.get_object('value_bigredbutton_dialog')
    dialog.finish_initializing(builder)
    dialog.set_value(on_value, off_value)
    return dialog
def NewAboutBigredbuttonDialog():
    """NewAboutBigredbuttonDialog - returns a fully instantiated
    AboutBigredbuttonDialog object. Use this function rather than
    creating a AboutBigredbuttonDialog instance directly.
    
    """

    #look for the ui file that describes the ui
    from os.path import join
    ui_filename = join(getdatapath(), 'ui', 'AboutBigredbuttonDialog.ui')
    if not os.path.exists(ui_filename):
        ui_filename = None

    builder = gtk.Builder()
    builder.add_from_file(ui_filename)    
    dialog = builder.get_object("about_dialog")
    dialog.finish_initializing(builder)
    return dialog