[IUP] IupText minimum size [SOLVED]
- Posted by petelomax Apr 27, 2016
- 1499 views
I am trying to make the text field auto-expand when the window is resized. If I start with a size of 100x100 then it works pretty much as I want (apart from being the wrong size and place), however if I start with a size of 800x100 then it seems to set a minimum size on the text field that it will not shrink below, so the X is clipped below 800. Any ideas?
(include pGUI.e) Ihandle flbl, ftxt, flb2, box, dlg IupOpen() flbl = IupLabel("Filter") ftxt = IupText("") IupSetAttribute(ftxt, "EXPAND", "HORIZONTAL") flb2 = IupLabel("X") box = IupHbox({flbl,ftxt,flb2}) IupSetAttribute(box, "MARGIN", "2x2") IupSetAttribute(box, "GAP", "10") dlg = IupDialog(box) IupSetAttribute(dlg, "TITLE", "pdemo") IupSetAttribute(dlg, "SIZE", "100x100") -- IupSetAttribute(dlg, "SIZE", "800x100") IupShow(dlg) IupMainLoop() IupClose()
Pete
SOLVED [17 hours later]: use IupSetAttribute(dlg, "SHRINK", "YES"). (The shrink attribute does not work on ftxt, btw, only the containing dialog.)