MCPcopy Create free account
hub / github.com/NetHack/NetHack / ghack_highlight_widget

Function ghack_highlight_widget

outdated/win/gnome/gnstatus.c:875–908  ·  view source on GitHub ↗

Widget changed, so add it to the highlighing list */

Source from the content-addressed store, hash-verified

873
874/* Widget changed, so add it to the highlighing list */
875static void
876ghack_highlight_widget(GtkWidget *widget, GtkStyle *oldStyle,
877 GtkStyle *newStyle)
878{
879 Highlight *highlt;
880 GList *item;
881
882 /* Check if this widget is already in the queue. If so then
883 * remove it, so we will only have the new entry in the queue */
884 for (item = g_list_first(s_HighLightList); item;) {
885 highlt = (Highlight *) item->data;
886 if (highlt) {
887 if (highlt->widget == widget) {
888 s_HighLightList = g_list_remove_link(s_HighLightList, item);
889 g_free(highlt);
890 g_list_free_1(item);
891 break;
892 }
893 }
894 if (item)
895 item = item->next;
896 else
897 break;
898 }
899
900 /* Ok, now highlight this widget and add it into the fade
901 * highlighting queue */
902 highlt = g_new(Highlight, 1);
903 highlt->nTurnsLeft = NUM_TURNS_HIGHLIGHTED;
904 highlt->oldStyle = oldStyle;
905 highlt->widget = widget;
906 s_HighLightList = g_list_prepend(s_HighLightList, highlt);
907 gtk_widget_set_style(GTK_WIDGET(widget), newStyle);
908}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected