Skip to content

Commit

Permalink
*** empty log message ***
Browse files Browse the repository at this point in the history
  • Loading branch information
scuri committed Nov 12, 2012
1 parent 5da58c1 commit 39336ef
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
13 changes: 7 additions & 6 deletions src/gtk/iupgtk_canvas.c
Expand Up @@ -261,7 +261,7 @@ static gboolean gtkCanvasBorderExposeEvent(GtkWidget *widget, GdkEventExpose *ev
gtk_widget_get_allocation(widget, &allocation);
gtk_style_context_save (context);
gtk_style_context_add_class(context, GTK_STYLE_CLASS_FRAME);
gtk_render_frame (context, cr, allocation.x, allocation.y, allocation.width, allocation.height);
gtk_render_frame (context, cr, 0, 0, allocation.width, allocation.height);
gtk_style_context_restore (context);
#else
GdkWindow* window = iupgtkGetWindow(widget);
Expand All @@ -278,21 +278,22 @@ static gboolean gtkCanvasBorderExposeEvent(GtkWidget *widget, GdkEventExpose *ev

static void gtkCanvasLayoutUpdateMethod(Ihandle *ih)
{
GdkWindow* window = iupgtkGetWindow(ih->handle);

iupdrvBaseLayoutUpdateMethod(ih);

/* Force GdkWindow size update when not visible,
so when mapped before show GDK returns the correct value. */
if (!iupdrvIsVisible(ih))
{
GdkWindow* window = iupgtkGetWindow(ih->handle);
gdk_window_resize(window, ih->currentwidth, ih->currentheight);
}

gtkCanvasUpdateChildLayout(ih);
}

static void gtkCanvasUpdateScrollLayout(Ihandle *ih)
{
if (!iupAttribGet(ih, "_IUPMOT_CANVASRESIZE"))
if (!iupAttribGet(ih, "_IUPGTK_CANVASRESIZE"))
gtkCanvasUpdateChildLayout(ih);
}

Expand All @@ -306,11 +307,11 @@ static void gtkCanvasSizeAllocate(GtkWidget* widget, GdkRectangle *allocation, I
int sb_vert_visible = sb_vert && gtk_widget_get_visible(sb_vert);
int sb_horiz_visible = sb_horiz && gtk_widget_get_visible(sb_horiz);

iupAttribSetStr(ih, "_IUPMOT_CANVASRESIZE", "1");
iupAttribSetStr(ih, "_IUPGTK_CANVASRESIZE", "1");

cb(ih, allocation->width, allocation->height);

iupAttribSetStr(ih, "_IUPMOT_CANVASRESIZE", NULL);
iupAttribSetStr(ih, "_IUPGTK_CANVASRESIZE", NULL);

/* check if the application changed the scrollbars layout */
if (sb_vert_visible != (sb_vert && gtk_widget_get_visible(sb_vert)) ||
Expand Down
2 changes: 1 addition & 1 deletion src/gtk/iupgtk_common.c
Expand Up @@ -625,8 +625,8 @@ int iupdrvGetScrollbarSize(void)
gtk_widget_get_preferred_size(sb, NULL, &requisition);
#else
gtk_widget_size_request(sb, &requisition);
size = requisition.width+1;
#endif
size = requisition.width+1;
gtk_widget_destroy(win);
}

Expand Down
4 changes: 0 additions & 4 deletions src/iup_split.c
Expand Up @@ -211,10 +211,6 @@ static void iSplitSetBarPosition(Ihandle* ih)
used only when LAYOUTDRAG=NO */
int x = ih->x,
y = ih->y;
Ihandle *child1, *child2 = NULL;
child1 = ih->firstchild->brother;
if (child1)
child2 = child1->brother;

if (ih->data->orientation == ISPLIT_VERT)
{
Expand Down
3 changes: 3 additions & 0 deletions test/canvas_scrollbar.c
Expand Up @@ -90,6 +90,8 @@ static int resize_cb(Ihandle *ih, int canvas_w, int canvas_h)

update_scrollbar(ih, canvas_w, canvas_h);
update_viewport(ih, canvas, IupGetFloat(ih, "POSX"), IupGetFloat(ih, "POSY"));

printf("RESIZE_CB(%d, %d) RASTERSIZE=%s DRAWSIZE=%s \n", canvas_w, canvas_h, IupGetAttribute(ih, "RASTERSIZE"), IupGetAttribute(ih, "DRAWSIZE"));
return IUP_DEFAULT;
}

Expand Down Expand Up @@ -157,6 +159,7 @@ void CanvasScrollbarTest(void)
cnv = IupCanvas(NULL);
IupSetAttribute(cnv, "RASTERSIZE", "300x200"); /* initial size */
IupSetAttribute(cnv, "SCROLLBAR", "YES");
// IupSetAttribute(cnv, "EXPAND", "NO");

IupSetCallback(cnv, "RESIZE_CB", (Icallback)resize_cb);
IupSetCallback(cnv, "ACTION", (Icallback)action);
Expand Down

0 comments on commit 39336ef

Please sign in to comment.