In C that means something else. I understand that didactically would be
interesting but it is something that should be learned. Actually many
beginners will use the other form, the same as I did in the example you
sent me (see attached file also). Like this:
Ihandle* label = IupLabel(....
Ihandle* button = IupButton(...
Ihandle* gridbox = IupGridBox(label, button, NULL);
This is much easier than:
Ihandle* ctrls[3];
ctrls[0] = IupLabel(....
ctrls[1] = IupButton(...
ctrls[2] = NULL;
Ihandle* gridbox = IupGridBoxv(ctrls);
Best,
Scuri
On Thu, Jan 19, 2017 at 7:37 PM, Andrew Robinson <arobinso...@cox.net>
wrote:
> How would you tell beginners to the C language, what is the proper way to
> define a *pointer to an array of pointers* in C? "*" means "pointer", and
> "**" means a pointer to a pointer, but IupGridBox doesn't require a pointer
> to a pointer, it requires a pointer to the first pointer in a series of
> pointers. No where in the documentation does it mention the word "array",
> you are just supposed to assume it is an array because nothing else makes
> sense, although it could have been a structure. Maybe writing it this way...
>
> Ihandle* IupGridBoxv(Ihandle[] **children*);
>
> ...would make that more clear, because Ihandle is one kind of data type (a
> pointer), and Ihandle[] is yet a different data type (an array).
>
> If you still disagree, that's okay, let's leave it at that. I don't want
> to spoil our "friendship" arguing over something that isn't that important
> to me as a friendship is.
>
> Best regards,
>
> Andrew
>
> On 1/19/2017 at 1:10 PM, Antonio Scuri <antonio.sc...@gmail.com> wrote:
>
>
> Hi,
>
> That's not just documentation, it implies in a change in the API. If you
> take a look at the "iup.h" header you will see that all boxes have the same
> constructors just like gridbox.
>
> Best,
> Scuri
>
>
> On Thu, Jan 19, 2017 at 4:03 PM, Andrew Robinson <arobinso...@cox.net>
> wrote:
>
>> You are a very responsive developer, Antonio! I have yet to see anyone
>> like you in any other group like IUP. I just hope that even when you
>> someday leave this group, that nothing will change about it. You saved me
>> the work of having to do my own GUI layout handler. I will give you future
>> feedback on it, if needed.
>>
>> In the meantime, here is a little feedback in regards to the IupGridBox
>> documentation:
>>
>> Ihandle* IupGridBoxv(Ihandle ***children*); should be listed as
>> Ihandle* IupGridBoxv(Ihandle **children[]*); or
>> Ihandle* IupGridBoxv(Ihandle ****children*);
>>
>> That last one might seem a little strange, but I saw it used by GTK+
>> for argv in their entry routine. Maybe this Stack Overflow discussion will
>> make sense of that: http://stackoverflow.com/quest
>> ions/13998669/cpp-pointers-and-arrays
>>
>> I know, I'm a little anal about documentation and a lot of people are not
>> receptive about that, so if this isn't really all that important to you,
>> you can safely ignore it. I just thought I would at least try :^)
>>
>> Andrew
>> On 1/19/2017 at 10:26 AM, Antonio Scuri <antonio.sc...@gmail.com> wrote:
>>
>> Hi,
>>
>> I added a new option for SIZECOL and SIZELIN, they can now be -1. If so
>> all controls will be considered when computing the gridbox size.
>>
>> Also I fixed an error in gridbox alignment.
>>
>> Just committed to SVN.
>>
>> IUP 3.21 should be released next week.
>>
>> Best,
>> Scuri
>>
>>
>> On Sun, Jan 15, 2017 at 2:04 PM, Antonio Scuri <antonio.sc...@gmail.com>
>> wrote:
>>
>>> Ok. Got it.
>>>
>>> Best,
>>> Scuri
>>>
>>>
>>> On Sun, Jan 15, 2017 at 1:11 PM, Andrew Robinson <arobinso...@cox.net>
>>> wrote:
>>>
>>>> int fnSrcFile(void) { return IUP_DEFAULT }
>>>> int fnDstFile(void) { return IUP_DEFAULT }
>>>> int fnBtnOk(void) { return IUP_DEFAULT }
>>>> int fnBtnQuit(void) { return IUP_CLOSE }
>>>> int main(int argc, char **argv) {
>>>> Ihandle *dlg, *hTxt, *guiPtr;
>>>> struct stGui {
>>>> Ihandle *lbl1;
>>>> Ihandle *lbl2;
>>>> Ihandle *txt1;
>>>> Ihandle *btn1;
>>>> Ihandle *lbl3;
>>>> Ihandle *lbl4;
>>>> Ihandle *txt2;
>>>> Ihandle *btn2;
>>>> Ihandle *lbl5;
>>>> Ihandle *lbl6;
>>>> Ihandle *btn3;
>>>> Ihandle *btn4;
>>>> Ihandle *end1 = 0; }
>>>>
>>>> IupOpen(&argc, &argv);
>>>>
>>>> lbl1 = IupLabel('SOURCE FILE')
>>>> lbl2 = IupLabel(':')
>>>> lbl3 = IupLabel('DST DIR')
>>>> lbl4 = IupLabel(':')
>>>> txt1 = IupText(NULL)
>>>> IupSetAttribute(txt1,'RASTERSIZE','125')
>>>> IupSetAttribute,(txt1,'MULTILINE','NO')
>>>> txt2 = IupText(NULL)
>>>> IupSetAttribute(txt2,'RASTERSIZE','125')
>>>> IupSetAttribute(txt2,'MULTILINE','NO')
>>>> btn1 = IupButton('SRC',NULL)
>>>> IupSetCallback(btn1,'ACTION',&fnSrcFile)
>>>> btn2 = IupButton('DST',NULL)
>>>> IupSetCallback(btn2,'ACTION',&fnDstFile)
>>>> lbl5 = IupLabel('')
>>>> lbl6 = IupLabel('')
>>>> btn3 = IupButton('OK',NULL)
>>>> IupSetCallback(btn3,'ACTION',&fnBtnOk)
>>>> btn4 = IupButton('QUIT',NULL)
>>>> IupSetCallback(btn4,'ACTION',&fnBtnQuit)
>>>>
>>>> ptrGui = &stGui;
>>>> gbox = IupGridBoxv(guiPtr)
>>>> IupSetAttribute(gbox,'ORIENTATION','HORIZONTAL')
>>>> IupSetAttribute(gbox,'NUMDIV','4')
>>>> IupSetAttribute(gbox,'SIZELIN','0')
>>>> IupSetAttribute(gbox,'SIZECOL','2')
>>>> IupSetAttribute(gbox,'MARGIN','5x5')
>>>> IupSetAttribute(gbox,'GAPCOL','5')
>>>> IupSetAttribute(gbox,'GAPLIN','5')
>>>> IupSetAttribute(gbox,'ALIGNMENTLIN','ACENTER')
>>>> IupSetAttribute(gbox,'ALIGNMENTCOL','ARIGHT')
>>>>
>>>> dlg = IupDialog(gbox)
>>>> IupSetAttribute(dlg,'TITLE','Hello World')
>>>> IupShowXY(dlg,IUP_CENTER,IUP_CENTER)
>>>>
>>>> IupMainLoop
>>>> IupClose
>>>>
>>>> Forgive me if there are some typos in translating this.
>>>>
>>>> On 1/9/2017 at 10:54 AM, Antonio Scuri <antonio.sc...@gmail.com>
>>>> wrote:
>>>>
>>>> Hi,
>>>>
>>>> Can you send me the code for that example. I may have an idea.
>>>>
>>>> Best,
>>>> Scuri
>>>>
>>>> On Sun, Jan 8, 2017 at 3:16 PM, Andrew Robinson <arobinso...@cox.net>
>>>> wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> This is just feedback of user satisfaction. It is not a complaint,
>>>>> it is just an opinion and requires no response. I'm hoping someone will
>>>>> understand what I am saying here and will think of a way to improve the
>>>>> container functionality to bring it up to a more state-of-the-art level.
>>>>>
>>>>> With the following parameters:
>>>>>
>>>>> MARGIN=5x5
>>>>> GAPCOL=5
>>>>> GAPLIN=5
>>>>>
>>>>> I get the following rendering:
>>>>>
>>>>> Note how GAPLIN has no effect. That's because IUP needs to be told
>>>>> which component in the entire grid is the the tallest component in the
>>>>> entire grid, so with that in mind, I used the following parameters,
>>>>>
>>>>> SIZELIN=1
>>>>> SIZECOL=2
>>>>> MARGIN=5x5
>>>>> GAPCOL=5
>>>>> GAPLIN=5
>>>>>
>>>>> and I get the following rendering:
>>>>>
>>>>> So now GAPLIN is working, but I have a problem with the GAPCOL
>>>>> ignoring the QUIT button's width because IUP hasn't been told that the
>>>>> QUIT
>>>>> button is the widest button in that column, but I cannot convey that
>>>>> information to IUP without screwing up the rest of the layout, since
>>>>> columns zero and one of line 2 are zero width and zero height:
>>>>>
>>>>>
>>>>> To get this to work, I tried inserting the GridBox inside of a Vbox or
>>>>> Hbox, but they too have no effect on the QUIT button margin. I could make
>>>>> this work by overriding the fault main window width by using USERSIZE, but
>>>>> why have containers if I typically will have to override them like this?
>>>>>
>>>>> That was only for a simplified user interface. Just spelling out the
>>>>> labels and flipping SRC with DST, I get this rendering,
>>>>>
>>>>>
>>>>> which is awful and not very fixable.
>>>>>
>>>>> Therefore the problem is this: I cannot choose a container that will
>>>>> let me align components both vertically and horizontally. It is either one
>>>>> or the other, but not both. GridBox comes close but it isn't very
>>>>> powerful,
>>>>> as you can see. There is no point in having any of these containers, if
>>>>> they can only do very simple "Hello World" interfaces and nothing beyond
>>>>> that, without having to compile a confusing slew of Vboxes, Hboxes, and
>>>>> GridBoxes into your user interface. As much as I hate JAVA, their version
>>>>> of the GridBox was very useful. As it stands, I need to resort to the
>>>>> cumbersome CX and CY attributes of each component to make anything more
>>>>> complicated than a "Hellow World" user interface work.
>>>>>
>>>>> What is really great about GridBox is that you only need to pass one
>>>>> parameter to the function to load your entire interface.
>>>>>
>>>>> Best Regards,
>>>>>
>>>>> Andrew
>>>>>
>>>>> ------------------------------------------------------------
>>>>> ------------------
>>>>> Check out the vibrant tech community on one of the world's most
>>>>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>>>>> _______________________________________________
>>>>> Iup-users mailing list
>>>>> Iup-users@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/iup-users
>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>>
>
>
#include <iup.h>
#include <stdlib.h>
int fnSrcFile(void) { return IUP_DEFAULT; }
int fnDstFile(void) { return IUP_DEFAULT; }
int fnBtnOk(void) { return IUP_DEFAULT; }
int fnBtnQuit(void) { return IUP_CLOSE; }
int main(int argc, char **argv)
{
Ihandle *dlg, *gbox;
Ihandle *lbl1;
Ihandle *lbl2;
Ihandle *txt1;
Ihandle *btn1;
Ihandle *lbl3;
Ihandle *lbl4;
Ihandle *txt2;
Ihandle *btn2;
Ihandle *lbl5;
Ihandle *lbl6;
Ihandle *btn3;
Ihandle *btn4;
IupOpen(&argc, &argv);
IupSetGlobal("GLOBALLAYOUTDLGKEY", "Yes");
lbl1 = IupLabel("SOURCE FILE");
lbl2 = IupLabel(":");
lbl3 = IupLabel("DST DIR");
lbl4 = IupLabel(":");
txt1 = IupText(NULL);
IupSetAttribute(txt1,"RASTERSIZE","125");
IupSetAttribute,(txt1,"MULTILINE","NO");
txt2 = IupText(NULL);
IupSetAttribute(txt2,"RASTERSIZE","125");
IupSetAttribute(txt2,"MULTILINE","NO");
btn1 = IupButton("SRC",NULL);
IupSetCallback(btn1,"ACTION",(Icallback)fnSrcFile);
btn2 = IupButton("DST",NULL);
IupSetCallback(btn2, "ACTION", (Icallback)fnDstFile);
lbl5 = IupLabel("");
lbl6 = IupLabel("");
btn3 = IupButton("OK",NULL);
IupSetCallback(btn3, "ACTION", (Icallback)fnBtnOk);
btn4 = IupButton("QUIT",NULL);
IupSetCallback(btn4, "ACTION", (Icallback)fnBtnQuit);
gbox = IupGridBox(lbl1,
lbl2,
txt1,
btn1,
lbl3,
lbl4,
txt2,
btn2,
lbl5,
lbl6,
btn3,
btn4,
NULL);
IupSetAttribute(gbox,"ORIENTATION","HORIZONTAL");
IupSetAttribute(gbox,"NUMDIV","4");
// IupSetAttribute(gbox,"SIZELIN","0");
// IupSetAttribute(gbox,"SIZECOL","2");
IupSetAttribute(gbox, "SIZELIN", "-1");
IupSetAttribute(gbox, "SIZECOL", "-1");
IupSetAttribute(gbox, "MARGIN", "30x30");
IupSetAttribute(gbox,"GAPCOL","30");
IupSetAttribute(gbox,"GAPLIN","30");
IupSetAttribute(gbox,"ALIGNMENTLIN","ACENTER");
IupSetAttribute(gbox,"ALIGNMENTCOL","ARIGHT");
// IupSetAttribute(gbox, "ALIGNMENTLIN", "ATOP");
// IupSetAttribute(gbox, "ALIGNMENTCOL", "ALEFT");
dlg = IupDialog(gbox);
IupSetAttribute(dlg,"TITLE","Hello World");
IupShowXY(dlg,IUP_CENTER,IUP_CENTER);
IupMainLoop();
IupClose();
}
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users