RIOT 多线程调度实战:用 thread_duel 示例深入理解 Round Robin 调度与线程公平性
2026/9/19 23:29:36
在开发自定义小部件时,我们通常需要重写父类GtkWindowClass的尺寸请求和分配函数。以下是my_marquee_size_request()和my_marquee_size_allocate()函数的实现:
/* Handle size requests for the widget. This function forces the widget to have * an initial size set according to the predefined width and the font size. */ static void my_marquee_size_request (GtkWidget *widget, GtkRequisition *requisition) { PangoFontDescription *fd; g_return_if_fail (widget != NULL || requisition != NULL); g_return_if_fail (IS_MY_MARQUEE (widget)); fd = widget->style->font_desc; requisition->width = MARQUEE_MIN_WIDTH; requisition->height = (pango_font_description_get_size (fd)