practice-timer/TimerMiniWindow.c

64 lines
2.1 KiB
C

#include "TimerMiniWindow.h"
struct _TimerMiniWindow {
GtkWindow parent;
GtkWidget *startStopButton;
GtkWidget *saveButton;
GtkWidget *expandButton;
GtkWidget *timerLabel;
GtkWidget *timerButton;
GtkWidget *nameBox;
};
G_DEFINE_TYPE(TimerMiniWindow, timer_mini_window, GTK_TYPE_WINDOW);
TimerMiniWindow *timer_mini_window_new() {
return g_object_new(TIMER_TYPE_MINI_WINDOW, NULL);
}
GtkLabel *timer_mini_window_get_timer_label(TimerMiniWindow *self) {
return GTK_LABEL(self->timerLabel);
}
GtkButton *timer_mini_window_get_timer_button(TimerMiniWindow *self) {
return GTK_BUTTON(self->timerButton);
}
GtkButton *timer_mini_window_get_start_stop_button(TimerMiniWindow *self) {
return GTK_BUTTON(self->startStopButton);
}
GtkButton *timer_mini_window_get_save_button(TimerMiniWindow *self) {
return GTK_BUTTON(self->saveButton);
}
GtkButton *timer_mini_window_get_expand_button(TimerMiniWindow *self) {
return GTK_BUTTON(self->expandButton);
}
GtkComboBoxText *timer_mini_window_get_name_box(TimerMiniWindow *self) {
return GTK_COMBO_BOX_TEXT(self->nameBox);
}
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),
TimerMiniWindow, saveButton);
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);
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);
}
void timer_mini_window_init(TimerMiniWindow *self) {
gtk_widget_init_template(GTK_WIDGET(self));
}