Example #1
0
static void
update_plugin()
	{
	gint		w_scroll, w_decal;
	static gint	x_scroll;

    if (command_pipe)
    {
    	command_done();

    }
	 if(GK.timer_ticks % 6 == 0)
    {
        run_command();
    }

#if defined(GKRELLM_HAVE_DECAL_SCROLL_TEXT)
	gkrellm_decal_scroll_text_set_text(panel, text1_btc, btc_text);
	gkrellm_decal_scroll_text_get_size(text1_btc, &w_scroll, NULL);
	gkrellm_decal_get_size(text1_btc, &w_decal, NULL);
	x_scroll -= 1;
	if (x_scroll <= -w_scroll)
		x_scroll = scroll_loop_mode ? 0 : w_decal;
	gkrellm_decal_text_set_offset(text1_btc, x_scroll, 0);
#else
	w_decal = text1_btc->w;
	w_scroll = gdk_string_width(text1_btc->text_style.font, scroll_text);
	x_scroll -= 1;
	if (x_scroll <= -w_scroll)
		x_scroll = w_decal;
	text1_btc->x_off = x_scroll;
	gkrellm_draw_decal_text(panel, text1_btc, scroll_text, x_scroll);
#endif
	gkrellm_draw_panel_layers(panel);
	}
Example #2
0
static void
update_plugin()
	{
	gint		w_scroll, w_decal;
	static gint	x_scroll;

#if defined(GKRELLM_HAVE_DECAL_SCROLL_TEXT)
	/* Gkrellm version 2.2.0 adds a scrolling text mode to a text decal so
	|  that inherently slow Pango text draws can be avoided at each scroll
	|  step as long as the sroll text string is unchanged.
	*/
	gkrellm_decal_scroll_text_set_text(panel, text1_decal, scroll_text);
	gkrellm_decal_scroll_text_get_size(text1_decal, &w_scroll, NULL);
	gkrellm_decal_get_size(text1_decal, &w_decal, NULL);
	x_scroll -= 1;
	if (x_scroll <= -w_scroll)
		x_scroll = scroll_loop_mode ? 0 : w_decal;
	gkrellm_decal_text_set_offset(text1_decal, x_scroll, 0);
#else
	w_decal = text1_decal->w;
	w_scroll = gdk_string_width(text1_decal->text_style.font, scroll_text);
	x_scroll -= 1;
	if (x_scroll <= -w_scroll)
		x_scroll = w_decal;
	text1_decal->x_off = x_scroll;
	gkrellm_draw_decal_text(panel, text1_decal, scroll_text, x_scroll);
#endif

	gkrellm_draw_panel_layers(panel);
	}