Re: [Iup-users] How do you get Flat controls to work in Lua?

2021-12-05 Thread Kaz Foxsen
> "Node" should only be used when generically referring to branches, leaves, 
> and root.

Exactly. When I said “adding nodes,” I was talking about potentially
adding both branches and leaves. My sample code was a small section of
a larger one with more branches.


> I don't see anywhere in the documentation where ADDBRANCH-1 is a valid term,

Me neither, which is why I couldn't figure out why my flattree was a
blank until I started this thread and was told about it by others. I
tried looking for sample code, but the
flattree was only in C, not Lua. Looking at the documentation now, I
found a mention in iupflattree > attributes > hierarchy:

"ADDLEAFid (write only): Adds a new leaf after the reference node,
where id is the reference node identifier. Use id=-1 to add before the
first node."

Then it says that ADDBRANCHid works like ADDLEAFid, but I didn't make
the connection that to solve my problem, I had to create a branch to
serve as the first root, and to do that,
use ADDBRANCH-1. I think a note that explicitly says this in the
documentation would be helpful. Another thing I didn't realize right
away was that the root node's id is 0 and not -1.

You can find the earlier emails discussing it here:
https://sourceforge.net/p/iup/mailman/iup-users/thread/28CE84F4-E49B-4EB7-9E3F-307725A9AB4A%40hxcore.ol/#msg37390775
By the way, does anyone know what's wrong with my emails when they get
reposted to SourceForge? Do they come to other people's inboxes
looking that horrible with
code I didn't add? If not, I sent a support ticket and can hopefully
get that sorted out.

> I think the focus node should be the root node

I believe the focus node is whatever is currently selected.


___
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users


Re: [Iup-users] How do you get Flat controls to work in Lua?

2021-12-05 Thread Andrew Robinson
>  I'm not sure if when you are saying "nodes" that you really mean "leaves".

"Node” is the general term that includes both “branches” and “leaves”.
https://www.tecgraf.puc-rio.br/iup/en/elem/iuptree_attrib.html#nodes



But branches and leaves are not the same thing. "Node" should only be used
when generically referring to branches, leaves, and root. When referring to
just a branch or a leaf or root, "node" should not be used to reduce
confusion.



> I see TITLEFONTSTYLEid is used for nodes and titlefont for leaves





  They can be used with either kind of node.

TITLEFONTid is like what you did with TITLEFONT (but “id” is the number of the
node you want to change) where you specify font face, style, and size.

TITLEFONTSTYLEid lets you set the style (like “Bold” or “Italic”) without
changing other aspects of the font.


I can see that since TITLEFONTSTYLEid and titlefont are used for nodes (read:
branches and leaves and the root), they are universal functions. That should
mean whatever you can do with a branch and it's text, you can do the same
thing with a leaf or root using that same function and syntax.




Now with terminology out of the way, I looked at your code for flattree and I
don't see anywhere in the documentation where ADDBRANCH-1 is a valid term,
since the "id" in ADDBRANCHid is always a positive whole number. "If id is
empty or invalid, then the focus node is used as reference node" and I think
the focus node should be the root node, but that just means nothing should
happen. To address the root node it looks like ADDBRANCH with no id should be
used and not ADDBRANCH-1.




Hope this helps,

Andrew
___
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users


Re: [Iup-users] How do you get Flat controls to work in Lua?

2021-12-04 Thread Andrew Robinson
I monitor conversations here because I presume that if someone brings up an
issue, no matter how simple or complicated, that I will have the same issue
unless I pay attention to what it being said. I think one of my problems with
this particular conversation is the terminology. I'm not sure if when you are
saying "nodes" that you really mean "leaves". Looking at the documentation for
setting font style, I see TITLEFONTSTYLEid is used for nodes and titlefont for
leaves. I'm too busy to experiment with IupTree at this time, and I have no
experience (yet) with IupTree, so I want to understand this before I do.


On 2021-12-03 at 8:59 PM, Kaz F  wrote:



I don’t oppose more help! :)



Something like that, but that works better if you’re setting it up as a table
to begin with rather than adding nodes.

I was hoping there was a way to set it for this:



modtree["addbranch-1"] = "MODULES"




From: Andrew Robinson
Sent: Friday, December 3, 2021 8:15 PM
To: IUP discussion list.
Cc: IUP discussion list.
Subject: Re: [Iup-users] How do you get Flat controls to work in Lua?




I'm probably going to get in trouble for butting into someone else's
conversation, but do you mean something like this:





{

  "Red","Orange","Yellow","Green","Blue","Purple";

  branchname = "COLOR"

  leafname = "yellow", titlefont = "Courier, Bold, 14"

};





On 2021-12-03 at 4:38 PM, Kaz F  wrote:


What I meant was, is it possible to set the style during the same step as
creation, like how one can create a button that has bold text with this code:



iup.button{title = ”button”, fontstyle = "Bold"}



I’m guessing not, since the code format for creating a branch is different
from creating a button, but I figured I might as well ask.








From: Antonio Scuri
Sent: Friday, December 3, 2021 7:57 AM
To: IUP discussion list.
Subject: Re: [Iup-users] How do you get Flat controls to work in Lua?




  What do you mean? I run your code and this is the result:











  It is bold...





Best,


Scuri








Em qui., 25 de nov. de 2021 às 02:51, Kaz F  escreveu:




I was able to get the following code to work, but is there a way to set the
“ICONS” branch to display in bold text when the branch is created?



--CODE

require("iuplua")



local tree = iup.flattree{rastersize="400x500"}



tree["addbranch-1"] = "ICONS" -- add root node

tree:SetNodeAttributes(0,{titlefontstyle = "Bold"}) --make root node bold.



local tlist = {

{

  "Red","Orange","Yellow","Green","Blue","Purple";

  branchname = "COLOR"

};

{

  "Ranged","Melee","Summon","Heal";

  branchname = "POWERS"

};

}

iup.TreeAddNodes(tree, tlist)



local testdlg = iup.dialog{iup.vbox{tree;ncmargin = "25 x 25"}; title = "Test
Window"}

testdlg:showxy(iup.CENTER, iup.CENTER)



if (iup.MainLoopLevel()==0) then

iup.MainLoop()

end




From: Ola Zetterqvist
Sent: Saturday, November 20, 2021 9:58 AM
To: iup-users@lists.sourceforge.net
Subject: Re: [Iup-users] How do you get Flat controls to work in Lua?



Thanks for the clarification, I needed that. 



Best,

Ola Zetterqvist








Den 2021-11-20 kl. 14:40, skrev Antonio Scuri:



  One very important difference between IupTree andIpFlatTre is that the flat
version does not include a default root node. That's why the solution proposed
by Ola works.





  Regarding the error in Lua this can be done:





--tree.ADDBRANCH-1 = "NFL"; -- Error in lua


tree["ADDBRANCH-1"] = "NFL";





Best,


Scuri








Em sáb., 20 de nov. de 2021 às 08:33, Ola Zetterqvist 
escreveu:



Hello,

Have found a solution that works.
Used flattree in C and it has worked,  where "ADDBRANCH-1" is used for the
first node but lua does not understand the syntax, one must use

iup.SetAttribute(tree, "ADDBRANCH-1", "Lua tree");


require("iuplua")
tree = iup.flattree{}

local dlg = iup.dialog{tree; size = "200x150",title = "Test Window"}

iup.SetAttribute(tree, "ADDBRANCH-1", "Lua tree");

--tree.ADDBRANCH-1 = "NFL"; -- Error in lua

tree.TITLE ="Test tree" -- Change "Lua tree" title
tree.ADDBRANCH0 = "AFC";
tree.ADDBRANCH1 = "EAST";
tree.ADDLEAF2 = "Patriots";
tree.ADDLEAF3 = "Bills";
tree.ADDLEAF4 = "Jets";
tree.ADDLEAF5 = "Dolphins";
tree.INSERTBRANCH2 = "North";
tree.ADDLEAF7 = "Ravens";
tree.ADDLEAF8 = "Steelers";
tree.ADDLEAF9 = "Browns"

Re: [Iup-users] How do you get Flat controls to work in Lua?

2021-12-04 Thread Antonio Scuri
>  I’m guessing not, since the code format for creating a branch is
different from creating a button, but I figured I might as well ask.

  Yes. The IupTree node only exists after the tree is mapped (created) in
the native system. IupFlatTree, because it is drawn by IUP, doesn't have
that limitation.

Best,
Scuri


Em sáb., 4 de dez. de 2021 às 00:59, Kaz F  escreveu:

> I don’t oppose more help! :)
>
>
>
> Something like that, but that works better if you’re setting it up as a
> table to begin with rather than adding nodes.
>
> I was hoping there was a way to set it for this:
>
>
>
> modtree["addbranch-1"] = "MODULES"
>
>
>
> *From: *Andrew Robinson 
> *Sent: *Friday, December 3, 2021 8:15 PM
> *To: *IUP discussion list. 
> *Cc: *IUP discussion list. 
> *Subject: *Re: [Iup-users] How do you get Flat controls to work in Lua?
>
>
>
> I'm probably going to get in trouble for butting into someone else's
> conversation, but do you mean something like this:
>
>
>
> {
>
>   "Red","Orange","Yellow","Green","Blue","Purple";
>
>   branchname = "COLOR"
>
>   leafname = "yellow", titlefont = "Courier, *Bold*, 14"
>
> };
>
>
>
> On 2021-12-03 at 4:38 PM, Kaz F  wrote:
>
> What I meant was, is it possible to set the style during the same step as
> creation, like how one can create a button that has bold text with this
> code:
>
>
>
> iup.button{title = ”button”, fontstyle = "Bold"}
>
>
>
> I’m guessing not, since the code format for creating a branch is different
> from creating a button, but I figured I might as well ask.
>
>
>
>
>
>
>
> *From: *Antonio Scuri 
> *Sent: *Friday, December 3, 2021 7:57 AM
> *To: *IUP discussion list. 
> *Subject: *Re: [Iup-users] How do you get Flat controls to work in Lua?
>
>
>
>   What do you mean? I run your code and this is the result:
>
>
>
>
>
>   It is bold...
>
>
>
> Best,
>
> Scuri
>
>
>
>
>
> Em qui., 25 de nov. de 2021 às 02:51, Kaz F 
> escreveu:
>
> I was able to get the following code to work, but is there a way to set
> the “ICONS” branch to display in bold text when the branch is created?
>
>
>
> --CODE
>
> require("iuplua")
>
>
>
> local tree = iup.flattree{rastersize="400x500"}
>
>
>
> tree["addbranch-1"] = "ICONS" -- add root node
>
> tree:SetNodeAttributes(0,{titlefontstyle = "Bold"}) --make root node bold.
>
>
>
> local tlist = {
>
> {
>
>   "Red","Orange","Yellow","Green","Blue","Purple";
>
>   branchname = "COLOR"
>
> };
>
> {
>
>   "Ranged","Melee","Summon","Heal";
>
>   branchname = "POWERS"
>
> };
>
> }
>
> iup.TreeAddNodes(tree, tlist)
>
>
>
> local testdlg = iup.dialog{iup.vbox{tree;ncmargin = "25 x 25"}; title =
> "Test Window"}
>
> testdlg:showxy(iup.CENTER, iup.CENTER)
>
>
>
> if (iup.MainLoopLevel()==0) then
>
> iup.MainLoop()
>
> end
>
>
>
> *From: *Ola Zetterqvist 
> *Sent: *Saturday, November 20, 2021 9:58 AM
> *To: *iup-users@lists.sourceforge.net
> *Subject: *Re: [Iup-users] How do you get Flat controls to work in Lua?
>
>
>
> Thanks for the clarification, I needed that.
>
> Best,
>
> Ola Zetterqvist
>
>
>
>
>
> Den 2021-11-20 kl. 14:40, skrev Antonio Scuri:
>
>   One very important difference between IupTree andIpFlatTre is that the
> flat version does not include a default root node. That's why the solution
> proposed by Ola works.
>
>
>
>   Regarding the error in Lua this can be done:
>
>
>
> --tree.ADDBRANCH-1 = "NFL"; -- Error in lua
>
> tree["ADDBRANCH-1"] = "NFL";
>
>
>
> Best,
>
> Scuri
>
>
>
>
>
> Em sáb., 20 de nov. de 2021 às 08:33, Ola Zetterqvist 
> escreveu:
>
> Hello,
>
> Have found a solution that works.
> Used flattree in C and it has worked,  where "ADDBRANCH-1" is used for the
> first node but lua does not understand the syntax, one must use
>
> iup.SetAttribute(tree, "ADDBRANCH-1", "Lua tree");
>
> require("iuplua")
> tree = iup.flattree{}
>
> local dlg = iup.dialog{tree; size = "200x150",title = "Test Wi

Re: [Iup-users] How do you get Flat controls to work in Lua?

2021-12-03 Thread Kaz F
I don’t oppose more help! :) Something like that, but that works better if you’re setting it up as a table to begin with rather than adding nodes.I was hoping there was a way to set it for this:  modtree["addbranch-1"] = "MODULES" From: Andrew RobinsonSent: Friday, December 3, 2021 8:15 PMTo: IUP discussion list.Cc: IUP discussion list.Subject: Re: [Iup-users] How do you get Flat controls to work in Lua? I'm probably going to get in trouble for butting into someone else's conversation, but do you mean something like this: {  "Red","Orange","Yellow","Green","Blue","Purple";  branchname = "COLOR"  leafname = "yellow", titlefont = "Courier, Bold, 14"    }; On 2021-12-03 at 4:38 PM, Kaz F <kaz.fox...@gmail.com> wrote:What I meant was, is it possible to set the style during the same step as creation, like how one can create a button that has bold text with this code: iup.button{title = ”button”, fontstyle = "Bold"} I’m guessing not, since the code format for creating a branch is different from creating a button, but I figured I might as well ask.   From: Antonio ScuriSent: Friday, December 3, 2021 7:57 AMTo: IUP discussion list.Subject: Re: [Iup-users] How do you get Flat controls to work in Lua?   What do you mean? I run your code and this is the result:    It is bold... Best,Scuri  Em qui., 25 de nov. de 2021 às 02:51, Kaz F <kaz.fox...@gmail.com> escreveu:I was able to get the following code to work, but is there a way to set the “ICONS” branch to display in bold text when the branch is created? --CODErequire("iuplua") local tree = iup.flattree{rastersize="400x500"} tree["addbranch-1"] = "ICONS" -- add root nodetree:SetNodeAttributes(0,{titlefontstyle = "Bold"}) --make root node bold. local tlist = {    {  "Red","Orange","Yellow","Green","Blue","Purple";  branchname = "COLOR"    };    {  "Ranged","Melee","Summon","Heal";  branchname = "POWERS"    };}iup.TreeAddNodes(tree, tlist) local testdlg = iup.dialog{iup.vbox{tree;ncmargin = "25 x 25"}; title = "Test Window"}testdlg:showxy(iup.CENTER, iup.CENTER) if (iup.MainLoopLevel()==0) then    iup.MainLoop()end From: Ola ZetterqvistSent: Saturday, November 20, 2021 9:58 AMTo: iup-users@lists.sourceforge.netSubject: Re: [Iup-users] How do you get Flat controls to work in Lua? Thanks for the clarification, I needed that.  Best,Ola Zetterqvist  Den 2021-11-20 kl. 14:40, skrev Antonio Scuri:  One very important difference between IupTree andIpFlatTre is that the flat version does not include a default root node. That's why the solution proposed by Ola works.    Regarding the error in Lua this can be done: --tree.ADDBRANCH-1 = "NFL"; -- Error in luatree["ADDBRANCH-1"] = "NFL"; Best,Scuri  Em sáb., 20 de nov. de 2021 às 08:33, Ola Zetterqvist <o...@zetterqvist.nu> escreveu:Hello,Have found a solution that works. Used flattree in C and it has worked,  where "ADDBRANCH-1" is used for the first node but lua does not understand the syntax, one must useiup.SetAttribute(tree, "ADDBRANCH-1", "Lua tree");require("iuplua")tree = iup.flattree{} local dlg = iup.dialog{tree; size = "200x150",title = "Test Window"}iup.SetAttribute(tree, "ADDBRANCH-1", "Lua tree");--tree.ADDBRANCH-1 = "NFL"; -- Error in luatree.TITLE ="Test tree" -- Change "Lua tree" titletree.ADDBRANCH0 = "AFC";tree.ADDBRANCH1 = "EAST";tree.ADDLEAF2 = "Patriots";tree.ADDLEAF3 = "Bills";tree.ADDLEAF4 = "Jets";tree.ADDLEAF5 = "Dolphins"; tree.INSERTBRANCH2 = "North";tree.ADDLEAF7 = "Ravens";tree.ADDLEAF8 = "Steelers";tree.ADDLEAF9 = "Browns";tree.ADDLEAF10 = "Bengals";dlg:map()dlg:showxy(iup.CENTER, iup.CENTER)if (iup.MainLoopLevel()==0) then    iup.MainLoop()end  Best,Ola Zetterqvist  Den 2021-11-20 kl. 08:24, skrev Kaz F:Hello,I can’t figure out how to get iup.flattree to work and couldn’t find any examples in Lua. I can get iup.tree to work just fine, but changing it to iup.flattree leaves me with an empty square in my dialog.Is there an additional “require” that I’m missing?Thanks,Kaz Iup-users mailing listIup-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/iup-users ___Iup-users mailing listIup-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/iup-users   ___
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users


Re: [Iup-users] How do you get Flat controls to work in Lua?

2021-12-03 Thread Andrew Robinson
I'm probably going to get in trouble for butting into someone else's
conversation, but do you mean something like this:





{

  "Red","Orange","Yellow","Green","Blue","Purple";

  branchname = "COLOR"

  leafname = "yellow", titlefont = "Courier, Bold, 14"

};




On 2021-12-03 at 4:38 PM, Kaz F  wrote:



What I meant was, is it possible to set the style during the same step as
creation, like how one can create a button that has bold text with this code:



iup.button{title = ”button”, fontstyle = "Bold"}



I’m guessing not, since the code format for creating a branch is different
from creating a button, but I figured I might as well ask.








From: Antonio Scuri
Sent: Friday, December 3, 2021 7:57 AM
To: IUP discussion list.
Subject: Re: [Iup-users] How do you get Flat controls to work in Lua?




  What do you mean? I run your code and this is the result:











  It is bold...





Best,


Scuri








Em qui., 25 de nov. de 2021 às 02:51, Kaz F  escreveu:




I was able to get the following code to work, but is there a way to set the
“ICONS” branch to display in bold text when the branch is created?



--CODE

require("iuplua")



local tree = iup.flattree{rastersize="400x500"}



tree["addbranch-1"] = "ICONS" -- add root node

tree:SetNodeAttributes(0,{titlefontstyle = "Bold"}) --make root node bold.



local tlist = {

{

  "Red","Orange","Yellow","Green","Blue","Purple";

  branchname = "COLOR"

};

{

  "Ranged","Melee","Summon","Heal";

  branchname = "POWERS"

};

}

iup.TreeAddNodes(tree, tlist)



local testdlg = iup.dialog{iup.vbox{tree;ncmargin = "25 x 25"}; title = "Test
Window"}

testdlg:showxy(iup.CENTER, iup.CENTER)



if (iup.MainLoopLevel()==0) then

iup.MainLoop()

end




From: Ola Zetterqvist
Sent: Saturday, November 20, 2021 9:58 AM
To: iup-users@lists.sourceforge.net
Subject: Re: [Iup-users] How do you get Flat controls to work in Lua?



Thanks for the clarification, I needed that. 



Best,

Ola Zetterqvist








Den 2021-11-20 kl. 14:40, skrev Antonio Scuri:



  One very important difference between IupTree andIpFlatTre is that the flat
version does not include a default root node. That's why the solution proposed
by Ola works.





  Regarding the error in Lua this can be done:





--tree.ADDBRANCH-1 = "NFL"; -- Error in lua


tree["ADDBRANCH-1"] = "NFL";





Best,


Scuri








Em sáb., 20 de nov. de 2021 às 08:33, Ola Zetterqvist 
escreveu:



Hello,

Have found a solution that works.
Used flattree in C and it has worked,  where "ADDBRANCH-1" is used for the
first node but lua does not understand the syntax, one must use

iup.SetAttribute(tree, "ADDBRANCH-1", "Lua tree");


require("iuplua")
tree = iup.flattree{}

local dlg = iup.dialog{tree; size = "200x150",title = "Test Window"}

iup.SetAttribute(tree, "ADDBRANCH-1", "Lua tree");

--tree.ADDBRANCH-1 = "NFL"; -- Error in lua

tree.TITLE ="Test tree" -- Change "Lua tree" title
tree.ADDBRANCH0 = "AFC";
tree.ADDBRANCH1 = "EAST";
tree.ADDLEAF2 = "Patriots";
tree.ADDLEAF3 = "Bills";
tree.ADDLEAF4 = "Jets";
tree.ADDLEAF5 = "Dolphins";
tree.INSERTBRANCH2 = "North";
tree.ADDLEAF7 = "Ravens";
tree.ADDLEAF8 = "Steelers";
tree.ADDLEAF9 = "Browns";
tree.ADDLEAF10 = "Bengals";

dlg:map()
dlg:showxy(iup.CENTER, iup.CENTER)

if (iup.MainLoopLevel()==0) then
iup.MainLoop()
end








Best,

Ola Zetterqvist








Den 2021-11-20 kl. 08:24, skrev Kaz F:



Hello,
I can’t figure out how to get iup.flattree to work and couldn’t find any
examples in Lua.
I can get iup.tree to work just fine, but changing it to iup.flattree leaves
me with an empty square in my dialog.
Is there an additional “require” that I’m missing?
Thanks,
Kaz


Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users



___
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

 
___
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users


Re: [Iup-users] How do you get Flat controls to work in Lua?

2021-12-03 Thread Kaz F
What I meant was, is it possible to set the style during the same step as creation, like how one can create a button that has bold text with this code: iup.button{title = ”button”, fontstyle = "Bold"} I’m guessing not, since the code format for creating a branch is different from creating a button, but I figured I might as well ask.   From: Antonio ScuriSent: Friday, December 3, 2021 7:57 AMTo: IUP discussion list.Subject: Re: [Iup-users] How do you get Flat controls to work in Lua?   What do you mean? I run your code and this is the result:    It is bold... Best,Scuri  Em qui., 25 de nov. de 2021 às 02:51, Kaz F <kaz.fox...@gmail.com> escreveu:I was able to get the following code to work, but is there a way to set the “ICONS” branch to display in bold text when the branch is created? --CODErequire("iuplua") local tree = iup.flattree{rastersize="400x500"} tree["addbranch-1"] = "ICONS" -- add root nodetree:SetNodeAttributes(0,{titlefontstyle = "Bold"}) --make root node bold. local tlist = {    {  "Red","Orange","Yellow","Green","Blue","Purple";  branchname = "COLOR"    };    {  "Ranged","Melee","Summon","Heal";  branchname = "POWERS"    };}iup.TreeAddNodes(tree, tlist) local testdlg = iup.dialog{iup.vbox{tree;ncmargin = "25 x 25"}; title = "Test Window"}testdlg:showxy(iup.CENTER, iup.CENTER) if (iup.MainLoopLevel()==0) then    iup.MainLoop()end From: Ola ZetterqvistSent: Saturday, November 20, 2021 9:58 AMTo: iup-users@lists.sourceforge.netSubject: Re: [Iup-users] How do you get Flat controls to work in Lua? Thanks for the clarification, I needed that.  Best,Ola Zetterqvist  Den 2021-11-20 kl. 14:40, skrev Antonio Scuri:  One very important difference between IupTree andIpFlatTre is that the flat version does not include a default root node. That's why the solution proposed by Ola works.    Regarding the error in Lua this can be done: --tree.ADDBRANCH-1 = "NFL"; -- Error in luatree["ADDBRANCH-1"] = "NFL"; Best,Scuri  Em sáb., 20 de nov. de 2021 às 08:33, Ola Zetterqvist <o...@zetterqvist.nu> escreveu:Hello,Have found a solution that works. Used flattree in C and it has worked,  where "ADDBRANCH-1" is used for the first node but lua does not understand the syntax, one must useiup.SetAttribute(tree, "ADDBRANCH-1", "Lua tree");require("iuplua")tree = iup.flattree{} local dlg = iup.dialog{tree; size = "200x150",title = "Test Window"}iup.SetAttribute(tree, "ADDBRANCH-1", "Lua tree");--tree.ADDBRANCH-1 = "NFL"; -- Error in luatree.TITLE ="Test tree" -- Change "Lua tree" titletree.ADDBRANCH0 = "AFC";tree.ADDBRANCH1 = "EAST";tree.ADDLEAF2 = "Patriots";tree.ADDLEAF3 = "Bills";tree.ADDLEAF4 = "Jets";tree.ADDLEAF5 = "Dolphins"; tree.INSERTBRANCH2 = "North";tree.ADDLEAF7 = "Ravens";tree.ADDLEAF8 = "Steelers";tree.ADDLEAF9 = "Browns";tree.ADDLEAF10 = "Bengals";dlg:map()dlg:showxy(iup.CENTER, iup.CENTER)if (iup.MainLoopLevel()==0) then    iup.MainLoop()end  Best,Ola Zetterqvist  Den 2021-11-20 kl. 08:24, skrev Kaz F:Hello,I can’t figure out how to get iup.flattree to work and couldn’t find any examples in Lua. I can get iup.tree to work just fine, but changing it to iup.flattree leaves me with an empty square in my dialog.Is there an additional “require” that I’m missing?Thanks,Kaz Iup-users mailing listIup-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/iup-users ___Iup-users mailing listIup-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/iup-users ___
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users


Re: [Iup-users] How do you get Flat controls to work in Lua?

2021-12-03 Thread Antonio Scuri
  What do you mean? I run your code and this is the result:

[image: image.png]

  It is bold...

Best,
Scuri


Em qui., 25 de nov. de 2021 às 02:51, Kaz F  escreveu:

> I was able to get the following code to work, but is there a way to set
> the “ICONS” branch to display in bold text when the branch is created?
>
>
>
> --CODE
>
> require("iuplua")
>
>
>
> local tree = iup.flattree{rastersize="400x500"}
>
>
>
> tree["addbranch-1"] = "ICONS" -- add root node
>
> tree:SetNodeAttributes(0,{titlefontstyle = "Bold"}) --make root node bold.
>
>
>
> local tlist = {
>
> {
>
>   "Red","Orange","Yellow","Green","Blue","Purple";
>
>   branchname = "COLOR"
>
> };
>
> {
>
>   "Ranged","Melee","Summon","Heal";
>
>   branchname = "POWERS"
>
> };
>
> }
>
> iup.TreeAddNodes(tree, tlist)
>
>
>
> local testdlg = iup.dialog{iup.vbox{tree;ncmargin = "25 x 25"}; title =
> "Test Window"}
>
> testdlg:showxy(iup.CENTER, iup.CENTER)
>
>
>
> if (iup.MainLoopLevel()==0) then
>
> iup.MainLoop()
>
> end
>
>
>
> *From: *Ola Zetterqvist 
> *Sent: *Saturday, November 20, 2021 9:58 AM
> *To: *iup-users@lists.sourceforge.net
> *Subject: *Re: [Iup-users] How do you get Flat controls to work in Lua?
>
>
>
> Thanks for the clarification, I needed that.
>
> Best,
>
> Ola Zetterqvist
>
>
>
>
>
> Den 2021-11-20 kl. 14:40, skrev Antonio Scuri:
>
>   One very important difference between IupTree andIpFlatTre is that the
> flat version does not include a default root node. That's why the solution
> proposed by Ola works.
>
>
>
>   Regarding the error in Lua this can be done:
>
>
>
> --tree.ADDBRANCH-1 = "NFL"; -- Error in lua
>
> tree["ADDBRANCH-1"] = "NFL";
>
>
>
> Best,
>
> Scuri
>
>
>
>
>
> Em sáb., 20 de nov. de 2021 às 08:33, Ola Zetterqvist 
> escreveu:
>
> Hello,
>
> Have found a solution that works.
> Used flattree in C and it has worked,  where "ADDBRANCH-1" is used for the
> first node but lua does not understand the syntax, one must use
>
> iup.SetAttribute(tree, "ADDBRANCH-1", "Lua tree");
>
> require("iuplua")
> tree = iup.flattree{}
>
> local dlg = iup.dialog{tree; size = "200x150",title = "Test Window"}
>
> iup.SetAttribute(tree, "ADDBRANCH-1", "Lua tree");
>
> --tree.ADDBRANCH-1 = "NFL"; -- Error in lua
>
> tree.TITLE ="Test tree" -- Change "Lua tree" title
> tree.ADDBRANCH0 = "AFC";
> tree.ADDBRANCH1 = "EAST";
> tree.ADDLEAF2 = "Patriots";
> tree.ADDLEAF3 = "Bills";
> tree.ADDLEAF4 = "Jets";
> tree.ADDLEAF5 = "Dolphins";
> tree.INSERTBRANCH2 = "North";
> tree.ADDLEAF7 = "Ravens";
> tree.ADDLEAF8 = "Steelers";
> tree.ADDLEAF9 = "Browns";
> tree.ADDLEAF10 = "Bengals";
>
> dlg:map()
> dlg:showxy(iup.CENTER, iup.CENTER)
>
> if (iup.MainLoopLevel()==0) then
> iup.MainLoop()
> end
>
>
>
>
>
> Best,
>
> Ola Zetterqvist
>
>
>
>
>
> Den 2021-11-20 kl. 08:24, skrev Kaz F:
>
> Hello,
> I can’t figure out how to get iup.flattree to work and couldn’t find any
> examples in Lua.
> I can get iup.tree to work just fine, but changing it to iup.flattree
> leaves me with an empty square in my dialog.
> Is there an additional “require” that I’m missing?
> Thanks,
> Kaz
>
>
>
> Iup-users mailing list
>
> Iup-users@lists.sourceforge.net
>
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
>
> ___
> Iup-users mailing list
> Iup-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
___
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users


Re: [Iup-users] How do you get Flat controls to work in Lua?

2021-11-24 Thread Kaz F
I was able to get the following code to work, but is there a way to set the “ICONS” branch to display in bold text when the branch is created? --CODErequire("iuplua") local tree = iup.flattree{rastersize="400x500"} tree["addbranch-1"] = "ICONS" -- add root nodetree:SetNodeAttributes(0,{titlefontstyle = "Bold"}) --make root node bold. local tlist = {    {  "Red","Orange","Yellow","Green","Blue","Purple";  branchname = "COLOR"    };    {  "Ranged","Melee","Summon","Heal";  branchname = "POWERS"    };}iup.TreeAddNodes(tree, tlist) local testdlg = iup.dialog{iup.vbox{tree;ncmargin = "25 x 25"}; title = "Test Window"}testdlg:showxy(iup.CENTER, iup.CENTER) if (iup.MainLoopLevel()==0) then    iup.MainLoop()end From: Ola ZetterqvistSent: Saturday, November 20, 2021 9:58 AMTo: iup-users@lists.sourceforge.netSubject: Re: [Iup-users] How do you get Flat controls to work in Lua? Thanks for the clarification, I needed that.  Best,Ola Zetterqvist  Den 2021-11-20 kl. 14:40, skrev Antonio Scuri:  One very important difference between IupTree andIpFlatTre is that the flat version does not include a default root node. That's why the solution proposed by Ola works.    Regarding the error in Lua this can be done: --tree.ADDBRANCH-1 = "NFL"; -- Error in luatree["ADDBRANCH-1"] = "NFL"; Best,Scuri  Em sáb., 20 de nov. de 2021 às 08:33, Ola Zetterqvist <o...@zetterqvist.nu> escreveu:Hello,Have found a solution that works. Used flattree in C and it has worked,  where "ADDBRANCH-1" is used for the first node but lua does not understand the syntax, one must useiup.SetAttribute(tree, "ADDBRANCH-1", "Lua tree");require("iuplua")tree = iup.flattree{} local dlg = iup.dialog{tree; size = "200x150",title = "Test Window"}iup.SetAttribute(tree, "ADDBRANCH-1", "Lua tree");--tree.ADDBRANCH-1 = "NFL"; -- Error in luatree.TITLE ="Test tree" -- Change "Lua tree" titletree.ADDBRANCH0 = "AFC";tree.ADDBRANCH1 = "EAST";tree.ADDLEAF2 = "Patriots";tree.ADDLEAF3 = "Bills";tree.ADDLEAF4 = "Jets";tree.ADDLEAF5 = "Dolphins"; tree.INSERTBRANCH2 = "North";tree.ADDLEAF7 = "Ravens";tree.ADDLEAF8 = "Steelers";tree.ADDLEAF9 = "Browns";tree.ADDLEAF10 = "Bengals";dlg:map()dlg:showxy(iup.CENTER, iup.CENTER)if (iup.MainLoopLevel()==0) then    iup.MainLoop()end  Best,Ola Zetterqvist  Den 2021-11-20 kl. 08:24, skrev Kaz F:Hello,I can’t figure out how to get iup.flattree to work and couldn’t find any examples in Lua. I can get iup.tree to work just fine, but changing it to iup.flattree leaves me with an empty square in my dialog.Is there an additional “require” that I’m missing?Thanks,Kaz Iup-users mailing listIup-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/iup-users 

___
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users


Re: [Iup-users] How do you get Flat controls to work in Lua?

2021-11-20 Thread Ola Zetterqvist

Thanks for the clarification, I needed that.

Best,
Ola Zetterqvist


Den 2021-11-20 kl. 14:40, skrev Antonio Scuri:
  One very important difference between IupTree andIpFlatTre is that 
the flat version does not include a default root node. That's why the 
solution proposed by Ola works.


  Regarding the error in Lua this can be done:

--tree.ADDBRANCH-1 = "NFL"; -- Error in lua
tree["ADDBRANCH-1"] = "NFL";

Best,
Scuri


Em sáb., 20 de nov. de 2021 às 08:33, Ola Zetterqvist 
 escreveu:


Hello,

Have found a solution that works.
Used flattree in C and it has worked,  where "ADDBRANCH-1" is used
for the first node but lua does not understand the syntax, one
must use

iup.SetAttribute(tree, "ADDBRANCH-1", "Lua tree");

require("iuplua")
tree = iup.flattree{}

local dlg = iup.dialog{tree; size = "200x150",title = "Test Window"}

iup.SetAttribute(tree, "ADDBRANCH-1", "Lua tree");

--tree.ADDBRANCH-1 = "NFL"; -- Error in lua

tree.TITLE ="Test tree" -- Change "Lua tree" title
tree.ADDBRANCH0 = "AFC";
tree.ADDBRANCH1 = "EAST";
tree.ADDLEAF2 = "Patriots";
tree.ADDLEAF3 = "Bills";
tree.ADDLEAF4 = "Jets";
tree.ADDLEAF5 = "Dolphins";
tree.INSERTBRANCH2 = "North";
tree.ADDLEAF7 = "Ravens";
tree.ADDLEAF8 = "Steelers";
tree.ADDLEAF9 = "Browns";
tree.ADDLEAF10 = "Bengals";

dlg:map()
dlg:showxy(iup.CENTER, iup.CENTER)

if (iup.MainLoopLevel()==0) then
    iup.MainLoop()
end


Best,
Ola Zetterqvist


Den 2021-11-20 kl. 08:24, skrev Kaz F:

Hello,
I can’t figure out how to get iup.flattree to work and couldn’t
find any examples in Lua.
I can get iup.tree to work just fine, but changing it to
iup.flattree leaves me with an empty square in my dialog.
Is there an additional “require” that I’m missing?
Thanks,
Kaz



Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users___
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users


Re: [Iup-users] How do you get Flat controls to work in Lua?

2021-11-20 Thread Antonio Scuri
  One very important difference between IupTree andIpFlatTre is that the
flat version does not include a default root node. That's why the solution
proposed by Ola works.

  Regarding the error in Lua this can be done:

--tree.ADDBRANCH-1 = "NFL"; -- Error in lua
tree["ADDBRANCH-1"] = "NFL";

Best,
Scuri


Em sáb., 20 de nov. de 2021 às 08:33, Ola Zetterqvist 
escreveu:

> Hello,
>
> Have found a solution that works.
> Used flattree in C and it has worked,  where "ADDBRANCH-1" is used for the
> first node but lua does not understand the syntax, one must use
>
> iup.SetAttribute(tree, "ADDBRANCH-1", "Lua tree");
>
> require("iuplua")
> tree = iup.flattree{}
>
> local dlg = iup.dialog{tree; size = "200x150",title = "Test Window"}
>
> iup.SetAttribute(tree, "ADDBRANCH-1", "Lua tree");
>
> --tree.ADDBRANCH-1 = "NFL"; -- Error in lua
>
> tree.TITLE ="Test tree" -- Change "Lua tree" title
> tree.ADDBRANCH0 = "AFC";
> tree.ADDBRANCH1 = "EAST";
> tree.ADDLEAF2 = "Patriots";
> tree.ADDLEAF3 = "Bills";
> tree.ADDLEAF4 = "Jets";
> tree.ADDLEAF5 = "Dolphins";
> tree.INSERTBRANCH2 = "North";
> tree.ADDLEAF7 = "Ravens";
> tree.ADDLEAF8 = "Steelers";
> tree.ADDLEAF9 = "Browns";
> tree.ADDLEAF10 = "Bengals";
>
> dlg:map()
> dlg:showxy(iup.CENTER, iup.CENTER)
>
> if (iup.MainLoopLevel()==0) then
> iup.MainLoop()
> end
>
>
>
> Best,
> Ola Zetterqvist
>
>
> Den 2021-11-20 kl. 08:24, skrev Kaz F:
>
> Hello,
>
> I can’t figure out how to get iup.flattree to work and couldn’t find any
> examples in Lua.
>
> I can get iup.tree to work just fine, but changing it to iup.flattree
> leaves me with an empty square in my dialog.
>
> Is there an additional “require” that I’m missing?
> Thanks,
> Kaz
>
>
>
> ___ Iup-users mailing list
> Iup-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
>
> ___
> Iup-users mailing list
> Iup-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
___
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users


Re: [Iup-users] How do you get Flat controls to work in Lua?

2021-11-20 Thread Ola Zetterqvist

Hello,

Have found a solution that works.
Used flattree in C and it has worked,  where "ADDBRANCH-1" is used for 
the first node but lua does not understand the syntax, one must use


iup.SetAttribute(tree, "ADDBRANCH-1", "Lua tree");


require("iuplua")
tree = iup.flattree{}

local dlg = iup.dialog{tree; size = "200x150",title = "Test Window"}

iup.SetAttribute(tree, "ADDBRANCH-1", "Lua tree");

--tree.ADDBRANCH-1 = "NFL"; -- Error in lua

tree.TITLE ="Test tree" -- Change "Lua tree" title
tree.ADDBRANCH0 = "AFC";
tree.ADDBRANCH1 = "EAST";
tree.ADDLEAF2 = "Patriots";
tree.ADDLEAF3 = "Bills";
tree.ADDLEAF4 = "Jets";
tree.ADDLEAF5 = "Dolphins";
tree.INSERTBRANCH2 = "North";
tree.ADDLEAF7 = "Ravens";
tree.ADDLEAF8 = "Steelers";
tree.ADDLEAF9 = "Browns";
tree.ADDLEAF10 = "Bengals";

dlg:map()
dlg:showxy(iup.CENTER, iup.CENTER)

if (iup.MainLoopLevel()==0) then
    iup.MainLoop()
end



Best,
Ola Zetterqvist


Den 2021-11-20 kl. 08:24, skrev Kaz F:

Hello,

I can’t figure out how to get iup.flattree to work and couldn’t find 
any examples in Lua.


I can get iup.tree to work just fine, but changing it to iup.flattree 
leaves me with an empty square in my dialog.


Is there an additional “require” that I’m missing?
Thanks,
Kaz



___ Iup-users mailing list 
Iup-users@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/iup-users
___
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users


[Iup-users] How do you get Flat controls to work in Lua?

2021-11-19 Thread Kaz F
Hello, I can’t figure out how to get iup.flattree to work and couldn’t find any examples in Lua.  I can get iup.tree to work just fine, but changing it to iup.flattree leaves me with an empty square in my dialog. Is there an additional “require” that I’m missing? Thanks,Kaz

___
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users