Maintenant que le pb du window_scroll est résolu j'ai un nouveau pb au niveau du scrolling lui même .
Pour illustrer le pb voici un exemple (vite fait) de ma fonction draw qui dessine 30 ligne de texte.

Dans le main les attributs du window_scroll sont définis comme suit:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
 
myApp.pScrollBar = gtk_scrolled_window_new(NULL,NULL);
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(myApp.pScrollBar), myApp.pDrawArea);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(myApp.pScrollBar), GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC);
Et la fonction draw:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
void draw_cb(GtkWidget *drawArea, GdkEventExpose *event, gpointer userData)
{
    APPLICATION *pApp = (APPLICATION*)userData;
 
   static int wScrn, hScrn = 0;
   if (pPixmap == NULL || wScrn != drawArea->allocation.width || hScrn != drawArea->allocation.height)
   {
    wScrn = drawArea->allocation.width;
    hScrn = drawArea->allocation.height;
    pPixmap = gdk_pixmap_new(drawArea->window, wScrn, hScrn, -1);//
    gdk_draw_rectangle(pPixmap, drawArea->style->white_gc, TRUE, 0, 0, wScrn, hScrn);
   }
 
   gdk_draw_drawable(drawArea->window, drawArea->style->fg_gc[GTK_WIDGET_STATE (drawArea)],
                                        pPixmap, event->area.x, event->area.y,
                                        event->area.x, event->area.y,
                                        event->area.width, event->area.height);
 
   PangoContext *pContext = gtk_widget_get_pango_context(drawArea);
   PangoLayout *pLayout = pango_layout_new(pContext);
   pango_layout_set_text (pLayout, "Test Draw", 10);
   int i;
   for(i = 0; i < 30; i++)
   {
     gdk_draw_layout (drawArea->window, drawArea->style->fg_gc[GTK_WIDGET_STATE(drawArea)],
                                                                              0,i * 15, pLayout);
   }
   gtk_widget_set_size_request (pApp->pDrawArea, drawArea->allocation.width, i * 15);
   g_object_unref(pLayout);
}
Le pb est que lorsque je bouge le slider de bas en haut un peu rapidement il y a comme un effet de clipping.
Est ce la façon de manipuler/redessiner la drawing area qui n'est pas bonne ou est ce que ça vient du système de scrolling ?

Merci d'avance