practice-timer/TimerMiniWindow.c

57 lines
1.8 KiB
C
Raw Normal View History

2022-09-08 01:18:05 -07:00
#include "TimerMiniWindow.h"
struct _TimerMiniWindow {
GtkWindow parent;
GtkWindow *parentWindow;
GtkWidget *startStopButton;
GtkWidget *resetButton;
GtkWidget *expandButton;
GtkWidget *timerLabel;
};
G_DEFINE_TYPE(TimerMiniWindow, timer_mini_window, GTK_TYPE_WINDOW);
TimerMiniWindow *timer_mini_window_new(GtkWindow *parent) {
TimerMiniWindow *self = g_object_new(TIMER_TYPE_MINI_WINDOW, NULL);
self->parentWindow = parent;
return self;
}
GtkWindow *timer_mini_window_get_parent(TimerMiniWindow *self) {
return self->parentWindow;
}
GtkLabel *timer_mini_window_get_timer_label(TimerMiniWindow *self) {
return GTK_LABEL(self->timerLabel);
}
GtkButton *timer_mini_window_get_start_stop_button(TimerMiniWindow *self) {
return GTK_BUTTON(self->startStopButton);
}
GtkButton *timer_mini_window_get_reset_button(TimerMiniWindow *self) {
return GTK_BUTTON(self->resetButton);
}
GtkButton *timer_mini_window_get_expand_button(TimerMiniWindow *self) {
return GTK_BUTTON(self->expandButton);
}
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, resetButton);
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);
}
void timer_mini_window_init(TimerMiniWindow *self) {
gtk_widget_init_template(GTK_WIDGET(self));
}