def build_timer(self, *args): """Timer label""" b, f = st.set_buttons_color('timer', 1) # noinspection PyAttributeOutsideInit self.timer = Label(self.row_0_column_2, text=self.timer_text.get(), bg=b, fg=f, font=st.font(self.rem, 14)) self.timer.grid(row=1, column=0, rowspan=2, sticky='nsew')
def build_welcome_label(self, *args): """Word categories label""" bg, fg = st.set_buttons_color('title', 1) title = Label(self.welcome, text='Guess Letters', bg=bg, fg=fg, font=st.font(self.rem, 24), justify=CENTER) title.pack(side=TOP, padx=20, pady=50)
def build_clock_label(self, *args): """Main clock label""" bg, fg = st.set_buttons_color('points', 1) # noinspection PyAttributeOutsideInit self.clock = Label(self.row_0_column_2, textvariable=self.clock_text, bg=bg, fg=fg, font=st.font(self.rem, 0), bd=0, width=2) self.clock.grid(row=0, column=0, sticky='news', padx=0, pady=0)
def build_score_label(self, *args): """Word categories label""" bg, fg = st.set_buttons_color('points', 1) points = Label(self.row_0_column_1, text='Points:', bg=bg, fg=fg, font=st.font(self.rem, -4, style='normal'), bd=0, width=2) points.grid(row=0, column=0, sticky='news', padx=0, pady=0) b, f = st.set_buttons_color('score', 1) score = Label(self.row_0_column_1, textvariable=self.score_text, bg=b, fg=f, font=st.font(self.rem, 0), justify=CENTER, bd=0, width=2) score.grid(row=1, column=0, sticky='news', padx=0, pady=0)
def build_word_label(self, *args): """Secret word label""" bg, fg = st.set_buttons_color('word', 1) # noinspection PyAttributeOutsideInit self.secret_word_label = Label(self.row_2_grid, textvariable=self.word_text, bg=bg, fg=fg, justify=RIGHT, font=st.font(self.rem, 16), anchor='e') self.secret_word_label.grid(row=0, column=1, sticky='nse', padx=20, pady=5)
def build_title_label(self, *args): """Word categories label""" bg, fg = st.set_buttons_color('title', 1) title = Label(self.row_0_grid, text=self.banner_text.get(), bg=bg, fg=fg, font=st.font(self.rem, 10), width=6) title.grid(row=0, column=5, rowspan=2, columnspan=10, sticky='ew', padx=5, pady=2)
def create_button(self, frame, text): """General buttons creator""" font = None command = self.set_command(text) state = None bg, fg, abg, afg, dfg = st.set_buttons_color(text) button = Button(frame, text=text.capitalize(), bg=bg, fg=fg, font=font, bd=0, command=command, justify='center', overrelief=SUNKEN, anchor=CENTER, state=state, disabledforeground=dfg, activeforeground=afg, activebackground=abg, image=None) return button