[Iup-users] Suggestions (was: IUP compile error)
Otfried Cheong
otfried.iup at ipe.airpost.net
Thu Oct 4 12:49:36 GMT+3 2007
Antonio Scuri wrote:
> Yes, that makefile is incorrect. I already fixed it in CVS. In a few week I
> will release the 2.6 final.
>
> The GTK driver will be available soon. I've been working on IUP 3 for a
> while now and I guess in November I will have a beta.
That is great news. And then maybe this is the right time to make some
comments/requests:
(1) I'm using Cairo (www.cairographics.org) to draw into my
applications. This works very well, and I'm quite happy with the
combination of IUP and Cairo - but I needed a little hack which could be
fixed in IUP.
I have an IupCanvas widget. In the redraw callback, I do this:
int repaint_cb(Ihandle *self, float x, float y)
{
#ifdef WIN32
HDC *hdc = (HDC *) IupGetAttribute(ih, "HDC_WMPAINT");
cairo_surface_t *surface = cairo_win32_surface_create(*hdc);
#else
Widget wid = (Widget) IupGetAttribute(ih, "WID");
cairo_surface_t *surface = cairo_xlib_surface_create(XtDisplay(wid),
XtWindow(wid), iupmot_visual, w, h);
#endif
cairo_t *cc = cairo_create(surface);
// draw using cairo
cairo_destroy(cc);
cairo_surface_destroy(surface);
}
As you can see, everything is fine under Windows. Under X11, though, I
need pointers to the X display, the window, and the visual. IUP exposes
the window and the display, but doesn't seem to expose the visual (I
only got this to work by having a declaration "extern Visual
*iupmot_visual;" in my code, but this should really be exposed as a
global attribute).
(2) There is something strange about IupUpdate in the Motif driver.
This function is actually empty in the driver (at the end of "motif.c").
When the data in my program has changed, I call IupUpdate on the
IupCanvas, and I was wondering why nothing happened.
(3) IUP consists of some 'core' controls in the libiup library, and some
'extra' controls in the libiupcontrols library. It seems that the
separation has been made between controls that are entirely mapped to
native controls and those that haven't.
I think this is not the best possible separation. In my case, for
instance, I do not want to use libiupcontrols because it requires me to
link in libcd as well, nearly doubling the size of my application. It
would be nice if I could still use IupCBox and IupSBox (I looked at the
code, and it does not seem to make any use of CD at all, so I believe
these controls could easily be moved to libiup).
Would it perhaps be an idea to put those controls that do not need libcd
into libiup?
Best wishes,
Otfried
More information about the iup-users
mailing list