Migration Guide
IUP 2.x to IUP 3.x

Critical Changes (from 2.x to 2.7/3.0)

All critical changes were packed in version 2.7 so you can prepare your code to work with both 2.7 and 3.0 versions. And you will be able to alternate between both versions without having to add "ifdef"s to your code. The differences in the "iup.h" header file from 2.7 to 3.0 should contains only the new features introduced in 3.0.

IupOpen function declaration now include command line arguments used by X-Windows and GTK - The most important change is the signature of the IupOpen function. It was changed to include the main function arguments. The GTK and Motif toolkits use them. In IUP prior to version 2.7 they were ignored for Motif. In Windows they are always ignored. If for some reason you do not have access to the main function arguments you can use NULL in IupOpen. As a general rule the change is:

IupOpen()  >>   IupOpen(&argc,&argv)

You will also have to search&replace a few things in your source code:

the attribute "WIN_SAVEBITS"  >>  "SAVEUNDER"
the function IupGetType  >>  IupGetClassName

 Although the following were considered obsolete in IUP 2.6, their backward compatibility code were removed in 2.7. So you may have to search&replace for:

the attributes "MOTIF_FONT" and "WINFONT"  >>  "FONT"
the value of the attribute "CURSOR" =  "IUP"   >>   "HELP"   
the definition IUP_ANYWHERE  >>   IUP_CURRENT
the constructor IupColor (removed)  >>  use the color value

The "cdiup" and "cdluaiup" libraries moved from CD to IUP under the name "iupcd" and "iupluacd" - Also you will have to change your makefile or IDE project because we changed some library names to solve the cross dependencies between IUP, CD and IM libraries.

Strategic Changes (from 2.7 to 3.x)

All the changes described here are backward compatible with 2.7. So after doing them you will still be able to go back to 2.7.

Some global attributes like DEFAULTFONT, *BGCOLOR and *FGCOOR are now obtained from the system instead of hardcoded, this affects mainly applications in Windows were the hardcoded DEFAULTFONT was "Tahoma, 8" and the user changed the default font or used the Large Fonts option. If your dialog is too big in the new font then you can simply set DEFAULTFONTSIZE to force a smaller value.

The following headers were deprecated iupcb.h, iupcells.h, iupcolorbar.h, iupdial.h, iupgauge.h, iupmatrix.h, iuptree.h - they now simply include iupcontrols.h. You can replace them by iupcontrols.h in your code.

The following headers were deprecated iupcbox.h, iupsbox.h, iupgetparam.h, iupspin.h, iuptabs.h, iupval.h - they now simply include iup.h. You can remove them from your code.

The ACTION callback in IupText/IupMultiline now does NOT process extended keys anymore - the callback is called only if the text is edited, and key=0 if it is not a valid character. In 2.x the key parameter were used for some navigation keys, but now is used only for keys associated with characters. This is the most impacting change from 2.7 to 3.0, because some functionality in your application could stop working. Use the K_ANY or K_* callbacks instead to process navigation keys.

The Natural Size of IupText/IupMultiline does not uses the text contents anymore - to control the Natural Size use the SIZE/RASTERSIZE attributes, or the VISIBLECOLUMNS/VISIBLELINES attributes, or the EXPAND attribute. This will avoid the automatic resize of the IupText/IupMultiline if its content is changed by the user and the size of the dialog is changed so the layout is recalculated.

Now in IupCanvas the scrollbar parameters X/YMIN, X/YMAX and X/YLINE are updated only when DX/Y are updated. POSX/Y will only update the position of the scrollbar. In version 2.x was necessary to set POSX/Y to update those parameters.

The BGCOLOR attribute is now ignored in IupLabel, IupFrame, IupToggle (for the text background) and IupVal. They will use the background color of the native parent. IupFrame can has a color background when not using TITLE, and BGCOLOR is set before map.

The IupItem in GTK must have its VALUE attribute defined (ON or OFF) before mapping - so it can have the check mark, or define HIDEMARK=NO. If not done the item will not be checkable.

The new IupTabs does not supports the inactive tab feedback. So the tabs will be always active, although its children will be sucessfully disabled. The return value of the TABCHANGE_CB callback is not processed anymore. The most impacting feature is the TABORIENTATION attribute that has limited support in the native controls.

In IupMatrix the selection is made only using the mouse, pressing a key will NOT clear the selection anymore. You can still do that setting MARKED=NULL in the K_ANY callback.

In IupTree DEPTH is now a read-only attribute, use the INSERT* attributes to properly add nodes. The SELECTION_CB and MULTISELECTION_CB callbacks now ignore their return value. Now you can only add nodes to the tree after it has been mapped to hte native system. NAMEid attribute renamed to TITLE, old attribute still works but will be removed in future versions.