# Path: fstimer/gui/util_classes.py
# class GtkStockButton(Gtk.Button):
#     
#     def __init__(self, icon_name, label_text):
#         #Init a regular Gtk.Button
#         Gtk.Button.__init__(self)
#         #Add the icon and the label.
#         fname = os.path.join(icon_path, icon_files[icon_name])
#         btnIcon = Gtk.Image.new_from_file(fname)
#         btnLabel = Gtk.Label(label_text+' ')
#         #pack 'em into an HBox
#         btnHbox = Gtk.HBox(False, 0)
#         btnHbox.pack_start(btnIcon, False, False, 0)
#         btnHbox.pack_start(btnLabel, True, True, 0)
#         self.add(btnHbox)
#         return


import gi
import fstimer.gui
from gi.repository import Gtk
from fstimer.gui.util_classes import GtkStockButton
        check_button2.set_sensitive(False)
        check_button.connect('toggled', self.lock_check_button2, check_button,
                             check_button2)
        numlapsadj = Gtk.Adjustment(value=2, lower=2, upper=10, step_incr=1)
        numlapsbtn = Gtk.SpinButton(digits=0, climb_rate=0)
        numlapsbtn.set_adjustment(numlapsadj)
        #Activate the button as needed
        if numlaps > 1:
            check_button.set_active(True)
            numlapsadj.set_value(numlaps)
            if variablelaps:
                check_button2.set_active(True)
        else:
            check_button.set_active(False)
            numlapsadj.set_value(2)
        #Pop these in an hbox
        hbox_0 = Gtk.HBox(False, 0)
        hbox_0.pack_start(check_button, False, False, 8)
        hbox_0.pack_start(numlapsbtn, False, False, 8)
        # The next button
        hbox_05 = Gtk.HBox(False, 0)
        hbox_05.pack_start(check_button2, False, False, 8)
        # And an hbox with 2 buttons
        hbox_1 = Gtk.HBox(False, 0)
        btnCANCEL = GtkStockButton('close',"Close")
        btnCANCEL.connect('clicked', lambda btn: self.hide())
        alignCANCEL = Gtk.Alignment.new(0, 0, 0, 0)
        alignCANCEL.add(btnCANCEL)
        btnBACK = GtkStockButton('back',"Back")
        btnBACK.connect('clicked', back_clicked_cb)

# Path: fstimer/gui/util_classes.py
# class GtkStockButton(Gtk.Button):
#     
#     def __init__(self, icon_name, label_text):
#         #Init a regular Gtk.Button
#         Gtk.Button.__init__(self)
#         #Add the icon and the label.
#         fname = os.path.join(icon_path, icon_files[icon_name])
#         btnIcon = Gtk.Image.new_from_file(fname)
#         btnLabel = Gtk.Label(label_text+' ')
#         #pack 'em into an HBox
#         btnHbox = Gtk.HBox(False, 0)
#         btnHbox.pack_start(btnIcon, False, False, 0)
#         btnHbox.pack_start(btnLabel, True, True, 0)
#         self.add(btnHbox)
#         return


# Path: fstimer/gui/projecttype.py
import gi
import fstimer.gui
from gi.repository import Gtk
from fstimer.gui.util_classes import GtkStockButton

        check_button2.set_sensitive(False)
        check_button.connect('toggled', self.lock_check_button2, check_button,
                             check_button2)
        numlapsadj = Gtk.Adjustment(value=2, lower=2, upper=10, step_incr=1)
        numlapsbtn = Gtk.SpinButton(digits=0, climb_rate=0)
        numlapsbtn.set_adjustment(numlapsadj)
        #Activate the button as needed
        if numlaps > 1:
            check_button.set_active(True)
            numlapsadj.set_value(numlaps)
            if variablelaps:
                check_button2.set_active(True)
        else:
            check_button.set_active(False)
            numlapsadj.set_value(2)
        #Pop these in an hbox
        hbox_0 = Gtk.HBox(False, 0)
        hbox_0.pack_start(check_button, False, False, 8)
        hbox_0.pack_start(numlapsbtn, False, False, 8)
        # The next button
        hbox_05 = Gtk.HBox(False, 0)
        hbox_05.pack_start(check_button2, False, False, 8)
        # And an hbox with 2 buttons
        hbox_1 = Gtk.HBox(False, 0)
        btnCANCEL = GtkStockButton('close',"Close")
        btnCANCEL.connect('clicked', lambda btn: self.hide())
        alignCANCEL = Gtk.Alignment.new(0, 0, 0, 0)
        alignCANCEL.add(btnCANCEL)
        btnBACK = GtkStockButton('back',"Back")
        btnBACK.connect('clicked', back_clicked_cb)

        btnNEXT = GtkStockButton('forward',"Next")