Discussion:
[Iup-users] IupGridBox, Part II
Andrew Robinson
2017-01-08 17:16:42 UTC
Permalink
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
John Spikowski
2017-01-08 18:21:37 UTC
Permalink
Just curious. Are you using any IupHBox or IupVBox containers in your
design?
Post by Andrew Robinson
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.
 
 
    MARGIN=5x5
    GAPCOL=5
    GAPLIN=5
 
 
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
 
 
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
 
 
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
https://lists.sourceforge.net/lists/listinfo/iup-users
Andrew Robinson
2017-01-08 19:23:39 UTC
Permalink
Hi John,

Was I really not that clear? I thought from the title and text that you would
realize that I was only speaking of using an IupGridBox for this
demonstration. I did try using IupHbox and IupVbox but like I said, they won't
allow to you simultaneously align controls both vertically and horizontally,
nor will they make up for the shortcomings if IupGridBox. While IupGridBox
will let you simultaneously align controls both vertically and horizontally,
it will not detect the many different widths and heights of various controls
in a complicated interface and properly place the components.

Hope this helps,

Andrew

On 1/8/2017 at 11:21 AM, John Spikowski <***@scriptbasic.org> wrote:
Just curious. Are you using any IupHBox or IupVBox containers in your design?


On Sun, 2017-01-08 at 10:16 -0700, Andrew Robinson 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
Hernan Cano
2017-01-08 23:00:23 UTC
Permalink
Hi, Andrew.

Yes, I understand you. I also have tryed IUP with its "automatically
positioning and sizing"... but I prefered to use CX and CY (and
related expand, floating, rastersize in a CBOX container).

Although I confirm that Antonio has recommended me only use the standard
... "iup.hbox and iup.vbox to automatically position the labels and texts
without setting any sizes of positions".
Post by Andrew Robinson
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.
MARGIN=5x5
GAPCOL=5
GAPLIN=5
Andrew Robinson
2017-01-09 01:29:18 UTC
Permalink
Hello,

I decided that I wanted to make my own layout handler, but I'm running into
some snags. I set the following attributes of a gbox:

'ORIENTATION','HORIZONTAL'
'NUMDIV','4'
'SIZELIN','0'
'SIZECOL','2'
'MARGIN','5x5'
'GAPCOL','5'
'GAPLIN','5'
'ALIGNMENTLIN','ACENTER'
'ALIGNMENTCOL','ARIGHT'

I wanted to get the height of an IupText, so I used iupAttribGetStr, but
iupAttribGetStr returns the following values:

'ORIENTATION',''
'NUMDIV','AUTO'
'SIZELIN','0'
'SIZECOL','2'
'MARGIN','5x5'
'GAPCOL','5'
'GAPLIN','5'
'ALIGNMENTLIN','ATOP'
'ALIGNMENTCOL','ALEFT'

So iupAttribGetStr really doesn't seem to work reliably. It is a small bug
that I ran into that you might be interested in but what I am most interested
in, is getting the height of a component. Does anyone know an IUP function
that will do that?

Best Regards,

Andrew
Hernan Cano
2017-01-09 06:42:05 UTC
Permalink
Andrew:
I consider you can use the SIZE and RASTERSIZE attributes in the way I show
you in the attached file.
Tell me if this help you.

By.

HERNAN C


​
Andrew Robinson
2017-01-09 17:10:45 UTC
Permalink
Hello Hernan,

Yes, it did.

Thanks,

Andrew


On 1/8/2017 at 11:42 PM, Hernan Cano <***@gmail.com> wrote:
Andrew:
I consider you can use the SIZE and RASTERSIZE attributes in the way I show
you in the attached file.
Tell me if this help you.
Antonio Scuri
2017-01-09 17:54:38 UTC
Permalink
Hi,

Can you send me the code for that example. I may have an idea.

Best,
Scuri
Post by Andrew Robinson
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.
MARGIN=5x5
GAPCOL=5
GAPLIN=5
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
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
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
https://lists.sourceforge.net/lists/listinfo/iup-users
Andrew Robinson
2017-01-15 15:11:30 UTC
Permalink
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 <***@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 <***@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
Antonio Scuri
2017-01-15 16:04:46 UTC
Permalink
Ok. Got it.

Best,
Scuri
Post by Andrew Robinson
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.
Hi,
Can you send me the code for that example. I may have an idea.
Best,
Scuri
Post by Andrew Robinson
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.
MARGIN=5x5
GAPCOL=5
GAPLIN=5
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
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
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
https://lists.sourceforge.net/lists/listinfo/iup-users
Antonio Scuri
2017-01-19 17:26:54 UTC
Permalink
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
Post by Antonio Scuri
Ok. Got it.
Best,
Scuri
Post by Andrew Robinson
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.
Hi,
Can you send me the code for that example. I may have an idea.
Best,
Scuri
Post by Andrew Robinson
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.
MARGIN=5x5
GAPCOL=5
GAPLIN=5
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
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
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
https://lists.sourceforge.net/lists/listinfo/iup-users
Andrew Robinson
2017-01-19 18:03:14 UTC
Permalink
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/questions/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 <***@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 <***@gmail.com>
wrote:

Ok. Got it.


Best,
Scuri




On Sun, Jan 15, 2017 at 1:11 PM, Andrew Robinson <***@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 <***@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 <***@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
Antonio Scuri
2017-01-19 20:10:23 UTC
Permalink
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
Post by Andrew Robinson
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
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/questions/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
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
Post by Antonio Scuri
Ok. Got it.
Best,
Scuri
Post by Andrew Robinson
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.
Hi,
Can you send me the code for that example. I may have an idea.
Best,
Scuri
Post by Andrew Robinson
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.
MARGIN=5x5
GAPCOL=5
GAPLIN=5
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
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
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
https://lists.sourceforge.net/lists/listinfo/iup-users
Andrew Robinson
2017-01-19 21:37:05 UTC
Permalink
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 <***@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 <***@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/questions/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 <***@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 <***@gmail.com>
wrote:

Ok. Got it.


Best,
Scuri




On Sun, Jan 15, 2017 at 1:11 PM, Andrew Robinson <***@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 <***@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 <***@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
Antonio Scuri
2017-01-19 22:18:07 UTC
Permalink
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
Post by Andrew Robinson
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
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
Post by Andrew Robinson
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
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
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
Post by Antonio Scuri
Ok. Got it.
Best,
Scuri
Post by Andrew Robinson
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.
Hi,
Can you send me the code for that example. I may have an idea.
Best,
Scuri
Post by Andrew Robinson
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.
MARGIN=5x5
GAPCOL=5
GAPLIN=5
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
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
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
https://lists.sourceforge.net/lists/listinfo/iup-users
Andrew Robinson
2017-01-20 23:27:07 UTC
Permalink
Hello Antonio,

I just changed IupSetAttribute(gbox,'SIZELIN','0'); and
IupSetAttribute(gbox,'SIZECOL','2'); to IupSetAttribute(gbox,'SIZELIN','-1');
and IupSetAttribute(gbox,'SIZECOL','-1'); and it will not render anything. I
tried different things but nothing works except the original code.

Thanks,

Andrew



On 1/19/2017 at 10:26 AM, Antonio Scuri <***@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 <***@gmail.com>
wrote:

Ok. Got it.


Best,
Scuri




On Sun, Jan 15, 2017 at 1:11 PM, Andrew Robinson <***@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 <***@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 <***@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
Antonio Scuri
2017-01-21 13:22:38 UTC
Permalink
Have you tried with the new IUP version?

Best,
Scuri
Post by Andrew Robinson
Hello Antonio,
I just changed IupSetAttribute(gbox,'SIZELIN','0');
and IupSetAttribute(gbox,'SIZECOL','2'); to IupSetAttribute(gbox,'SIZELIN','-1');
and IupSetAttribute(gbox,'SIZECOL','-1'); and it will not render
anything. I tried different things but nothing works except the original
code.
Thanks,
Andrew
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
Post by Antonio Scuri
Ok. Got it.
Best,
Scuri
Post by Andrew Robinson
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.
Hi,
Can you send me the code for that example. I may have an idea.
Best,
Scuri
Post by Andrew Robinson
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.
MARGIN=5x5
GAPCOL=5
GAPLIN=5
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
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
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
https://lists.sourceforge.net/lists/listinfo/iup-users
Loading...