Re: new plugin and problem

pierluigi petrelli <[email protected]>
Newsgroups gmane.comp.gnome.apps.gkrellm
Message-ID <[email protected]>
Bill WIlson wrote:
> On Sat, 22 Apr 2006 15:26:40 +0200
> pierluigi petrelli <[email protected]> wrote:
>
>   
>> hi all , i'm a new of this ml.
>> i have relased a first alpha version of a simple plugin that read from
>> g4 sensor.
>> url is http://g4mon.beddamatrix.net
>>
>> i have a problem of refresh in my plugin area. if a window walk on my
>> plugin area this part it becomes white and the refresh i very slow.
>> someone have an idea?
>>     
>
> You need to have a panel expose routine that draws your panel pixmap
> to the screen.
>
> In create_g4mon() you'll need to connect to the expose signal with
> code like:
>
>     if (first_create)
>         g_signal_connect(G_OBJECT(g4mon->drawing_area), "expose_event",
>                 G_CALLBACK(panel_expose_event), NULL);
>
> And you'll need to add the panel_expose_event() function:
>
> static gint
> panel_expose_event(GtkWidget *widget, GdkEventExpose *ev)
>     {
>     gdk_draw_drawable(widget->window,
>             widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
>             g4mon->pixmap, ev->area.x, ev->area.y, ev->area.x, ev->area.y,
>             ev->area.width, ev->area.height);
>     return FALSE;
>     }
>
> I also notice in your get_cpu_fanspeed() function you return a pointer
> which has been assigned to "input" which is on the stack and so can get
> trashed outside of get_cpu_fanspeed().  You should declare it
>
>     static char input[length];
>
> to get it off the stack.
>
> Bill
>
>
>   
tanks for your fast help, i have solved all my trouble.
ps. i have tryed to declare input

 static char input[length];

but at compile time gcc say me:

gcc -fPIC `pkg-config gtk+-2.0 --cflags` -c g4mon.c
g4mon.c: In function `get_cpu_fanspeed':
g4mon.c:52: error: storage size of 'input' isn't constant
g4mon.c:52: error: size of variable 'input' is too large
make: *** [g4mon.o] Error 1

bye


_______________________________________________
Gkrellm mailing list
[email protected]
http://ninja.linux-phreak.biz/mailman/listinfo/gkrellm
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.