|
|
|
|
@ -64,17 +64,41 @@ void yon_ubl_status_box_render(char *text, BACKGROUND_IMAGE_TYPE type){
|
|
|
|
|
_yon_ubl_status_box_render(text,type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void _yon_ubl_status_highlight_incorrect(GtkWidget *widget){
|
|
|
|
|
struct __yon_ubl_status_box_render_thread_struct{
|
|
|
|
|
char *text;
|
|
|
|
|
BACKGROUND_IMAGE_TYPE type;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
gboolean _yon_ubl_status_box_render_thread(struct __yon_ubl_status_box_render_thread_struct *data){
|
|
|
|
|
render_data statusbox = render;
|
|
|
|
|
yon_ubl_status_box_set(data->type,statusbox.box,GTK_IMAGE(statusbox.icon));
|
|
|
|
|
if (data->text){
|
|
|
|
|
gtk_label_set_text(GTK_LABEL(statusbox.label), data->text);
|
|
|
|
|
free(data->text);
|
|
|
|
|
}
|
|
|
|
|
free(data);
|
|
|
|
|
return G_SOURCE_REMOVE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_ubl_status_box_render_thread(char *text, BACKGROUND_IMAGE_TYPE type){
|
|
|
|
|
struct __yon_ubl_status_box_render_thread_struct *data = malloc(sizeof(struct __yon_ubl_status_box_render_thread_struct));
|
|
|
|
|
data->text=yon_char_new(text);
|
|
|
|
|
data->type=type;
|
|
|
|
|
g_idle_add((GSourceFunc)_yon_ubl_status_box_render_thread,data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gboolean _yon_ubl_status_highlight_incorrect(GtkWidget *widget){
|
|
|
|
|
gtk_style_context_add_class(gtk_widget_get_style_context(widget),"errorBox");
|
|
|
|
|
sleep(5);
|
|
|
|
|
gtk_style_context_remove_class(gtk_widget_get_style_context(widget),"errorBox");
|
|
|
|
|
return G_SOURCE_REMOVE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_ubl_status_highlight_incorrect(GtkWidget *widget){
|
|
|
|
|
GThread *thread = g_thread_new(NULL,(GThreadFunc)_yon_ubl_status_highlight_incorrect,widget);
|
|
|
|
|
g_idle_add((GSourceFunc)_yon_ubl_status_highlight_incorrect,widget);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void _yon_ubl_status_list_store_highlight_incorrect(GtkWidget **widget_pack){
|
|
|
|
|
gboolean _yon_ubl_status_list_store_highlight_incorrect(GtkWidget **widget_pack){
|
|
|
|
|
GtkListStore *list = (GtkListStore*)widget_pack[0];
|
|
|
|
|
GtkTreeIter *iter = (GtkTreeIter*)widget_pack[1];
|
|
|
|
|
GdkRGBA rgba,rgba2;
|
|
|
|
|
@ -89,13 +113,14 @@ void _yon_ubl_status_list_store_highlight_incorrect(GtkWidget **widget_pack){
|
|
|
|
|
gtk_list_store_set(list,iter,1,gdk_rgba_to_string(&rgba2),2,gdk_rgba_to_string(&rgba),-1);
|
|
|
|
|
sleep(5);
|
|
|
|
|
gtk_list_store_set(list,iter,1,NULL,2,NULL,-1);
|
|
|
|
|
return G_SOURCE_REMOVE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_ubl_status_list_store_highlight_incorrect(GtkListStore *list, GtkTreeIter *iter){
|
|
|
|
|
GtkWidget **pack = malloc(sizeof(GtkWidget *)*2);
|
|
|
|
|
pack[0]=(GtkWidget*)list;
|
|
|
|
|
pack[1]=(GtkWidget*)iter;
|
|
|
|
|
GThread *thread = g_thread_new(NULL,(GThreadFunc)_yon_ubl_status_list_store_highlight_incorrect,pack);
|
|
|
|
|
g_idle_add((GSourceFunc)_yon_ubl_status_list_store_highlight_incorrect,pack);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct temp_statusbox {
|
|
|
|
|
|