practice-timer/TimerMiniWindow.c

64 lines
2.1 KiB
C
Raw Permalink Normal View History

2022-09-08 01:18:05 -07:00
#include "TimerMiniWindow.h"
struct _TimerMiniWindow {
GtkWindow parent;
GtkWidget *startStopButton;
2022-09-09 16:27:32 -07:00
GtkWidget *saveButton;
2022-09-08 01:18:05 -07:00
GtkWidget *expandButton;
GtkWidget *timerLabel;
2022-09-09 16:27:32 -07:00
GtkWidget *timerButton;
GtkWidget *nameBox;
2022-09-08 01:18:05 -07:00
};
G_DEFINE_TYPE(TimerMiniWindow, timer_mini_window, GTK_TYPE_WINDOW);
2022-09-08 03:26:17 -07:00
TimerMiniWindow *timer_mini_window_new() {
return g_object_new(TIMER_TYPE_MINI_WINDOW, NULL);
2022-09-08 01:18:05 -07:00
}
GtkLabel *timer_mini_window_get_timer_label(TimerMiniWindow *self) {
return GTK_LABEL(self->timerLabel);
}
2022-09-09 16:27:32 -07:00
GtkButton *timer_mini_window_get_timer_button(TimerMiniWindow *self) {
return GTK_BUTTON(self->timerButton);
}
2022-09-08 01:18:05 -07:00
GtkButton *timer_mini_window_get_start_stop_button(TimerMiniWindow *self) {
return GTK_BUTTON(self->startStopButton);
}
2022-09-09 16:27:32 -07:00
GtkButton *timer_mini_window_get_save_button(TimerMiniWindow *self) {
return GTK_BUTTON(self->saveButton);
2022-09-08 01:18:05 -07:00
}
GtkButton *timer_mini_window_get_expand_button(TimerMiniWindow *self) {
return GTK_BUTTON(self->expandButton);
}
2022-09-09 16:27:32 -07:00
GtkComboBoxText *timer_mini_window_get_name_box(TimerMiniWindow *self) {
return GTK_COMBO_BOX_TEXT(self->nameBox);
}
2022-09-08 01:18:05 -07:00
void timer_mini_window_class_init(TimerMiniWindowClass *class) {
gtk_widget_class_set_template_from_resource(
GTK_WIDGET_CLASS(class), "/zander/practicetimer/ui/mini-window.glade");
gtk_widget_class_bind_template_child_internal(GTK_WIDGET_CLASS(class),
TimerMiniWindow, startStopButton);
gtk_widget_class_bind_template_child_internal(GTK_WIDGET_CLASS(class),
2022-09-09 16:27:32 -07:00
TimerMiniWindow, saveButton);
2022-09-08 01:18:05 -07:00
gtk_widget_class_bind_template_child_internal(GTK_WIDGET_CLASS(class),
TimerMiniWindow, expandButton);
gtk_widget_class_bind_template_child_internal(GTK_WIDGET_CLASS(class),
TimerMiniWindow, timerLabel);
2022-09-09 16:27:32 -07:00
gtk_widget_class_bind_template_child_internal(GTK_WIDGET_CLASS(class),
TimerMiniWindow, nameBox);
gtk_widget_class_bind_template_child_internal(GTK_WIDGET_CLASS(class),
TimerMiniWindow, timerButton);
2022-09-08 01:18:05 -07:00
}
void timer_mini_window_init(TimerMiniWindow *self) {
gtk_widget_init_template(GTK_WIDGET(self));
}