MakeButton ID of Nil to be usable for creating button again.

Feature requests for future versions of Hollywood can be voiced here
Bugala
Posts: 1181
Joined: Sun Feb 14, 2010 7:11 pm

MakeButton ID of Nil to be usable for creating button again.

Post by Bugala »

Example code that fails since this is not supported:

Code: Select all

ID = MakeButton(Nil, #SIMPLEBUTTON, 1, 1, 10, 10, {OnMouseUp = Function() EndFunction)
DeleteButton(ID)
MakeButton(ID, #SIMPLEBUTTON, 1, 1, 10, 10, {OnMouseUp = Function() EndFunction)
I have this SliderButton I am making currently, and since I am not using Layers, but drawing each brush every cycle again, this also means that when I mode the slider button (which is the button), I am Deleting the old button and creating a new button to the current location.

It would be handy to be able to use the NIL options and return the Nil value, but right now there is no need to return the Nil value, since it will stop existing right after using the slider button.


Anotehr option would be to be able to change Buttons values on the fly, in this case its x-location. but is this somehow doable already?
Flinx
Posts: 192
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Re: MakeButton ID of Nil to be usable for creating button again.

Post by Flinx »

Maybe this could be a workaround?

Code: Select all

ID = MakeButton(Nil, #SIMPLEBUTTON, 1, 1, 10, 10, {OnMouseUp = Function() EndFunction})
DeleteButton(ID)
ID=ToNumber(ID)
MakeButton(ID, #SIMPLEBUTTON, 1, 1, 10, 10, {OnMouseUp = Function() EndFunction})
Bugala
Posts: 1181
Joined: Sun Feb 14, 2010 7:11 pm

Re: MakeButton ID of Nil to be usable for creating button again.

Post by Bugala »

@flinx going to wait for Andreas to confirm this, but my guess is that wont work.

As example nil could result in: "UserData: 0000000002DE3D10" which by ToNumber would convert to number 48119056, but my guess is that if I use MakeButton(48119056, #SIMPLEBUTTON...)

Which is same as would happen in your line number 4 in practice.

It would result in something else than UserData: 0000000002DE3D10 does. But I am not sure, just my guess, hence waiting for Andreas to confirm one way or other.
Flinx
Posts: 192
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Re: MakeButton ID of Nil to be usable for creating button again.

Post by Flinx »

Bugala wrote: Sat Apr 15, 2023 6:48 pm It would result in something else than UserData: 0000000002DE3D10 does. But I am not sure, just my guess, hence waiting for Andreas to confirm one way or other.
You are right, my suggestion does not guarantee that you will get an unique ID.
User avatar
airsoftsoftwair
Posts: 5446
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: MakeButton ID of Nil to be usable for creating button again.

Post by airsoftsoftwair »

Flinx wrote: Sat Apr 15, 2023 4:59 pm Maybe this could be a workaround?

Code: Select all

ID = MakeButton(Nil, #SIMPLEBUTTON, 1, 1, 10, 10, {OnMouseUp = Function() EndFunction})
DeleteButton(ID)
ID=ToNumber(ID)
MakeButton(ID, #SIMPLEBUTTON, 1, 1, 10, 10, {OnMouseUp = Function() EndFunction})
That's a very bad idea because when passing Nil to MakeButton() what you will get in return is essentially a pointer and converting that to a number using ToNumber() will not work if the pointer address is larger than what can be stored in a number which is a 64-bit floating point value.

Apart from that, I don't really understand what is the problem here ;)
Bugala
Posts: 1181
Joined: Sun Feb 14, 2010 7:11 pm

Re: MakeButton ID of Nil to be usable for creating button again.

Post by Bugala »

@Andreas, Problem is that I am trying to make a Slider Button that I wouldn't need to worry about much.

Right now I cant figure out a way where I could use NIL for it, which means that I need to keep track of button IDs one way or other, to not accidentally using same ID for two buttons.

Idea is following (didnt test code, just wrote here)

Code: Select all


SliderButtonID
Function NewSliderButton(SliderX, SliderY, SliderW, SliderH)

SliderButtonID = MakeButton(NIL, #SIMPLEBUTTON, sliderX, SliderY, SliderW, SliderH, {OnMouseDown = Function()
																	SetInterval = (1, OnContinousMouseDown)
																	 EndFunction)
Return(SliderButtonID)
EndFunction


Function OnContinuousMouseDown()
	SliderX = MouseX
	SliderY = MouseY
	If IsMouseDown() = False
		ClearInterval(1)
		MakeButton(NIL, #SIMPLEBUTTON, SliderX, SliderY, SliderW, SliderH, {OnMouseDown = Function()
																	SetInterval = (1, OnContinousMouseDown)
																	EndFunction)
	EndIf
EndFunction				

ID = NewSliderButton(100, 100, 200, 200)
SetInterval(2, function()
			if IsRightMouseDown() = True then DeleteButton(ID)
			EndFunction)

Repeat
WaitEvent()
Forever
											 
This isnt enough in reality, but gives you the idea.

Now problem is, I want to delete that Slider Button, if Right mouse button is clicked (just example, not reality), But how do I know its ID, if I used NIL to create it, I don't.

problem here is that when I move sliders positions, buttons position will change too. Since I used #SIMPLEBUTTON option, it means that after Sliders position have changed, the button is in wrong place.

Therefore when I stop moving the slider button, I have to also delete the current button, and create new #SIMPLEBUTTON to new location, or otherwise button is in wrong place.

This once again alone isnt the problem, but problem is that when I use NIL to create a button, I also want to create that ID to the program flow, to be later used to Delete that button.

And this is where the problem comes. When I finally push that rightmouse button, there is already new NIL button created, with new address, and when I use DeleteBuotton, it wont work since that button was already deleted long ago.

Only way I can keep track of that button, is by using Numbers, which means that I then need to keep track of all the button numbers.


Notice also that this isnt a problem if I use Layers On approach, since then the buttons location moves as the layer moves, but since I am doing this without Layers, this is a problem, as I can only use #SIMPLEBUTTON option to create buttons, and therefore, every time location of that button changes, I have to recreate that #SIMPLEBUTTON.

Another solution to this problem would be if I could somehow change #SIMPLEBUTTONS location on the fly. Since instead of recreating the button, I could instead just change its X and Y location, but I couldn't figure out a way to do that.


In case you want to check the real case, here is copy-paste of the current version. However, notice this is not the final version yet. I am planning on putting the final version here to forum, but this is its current state:

Code: Select all

/* 

BUTTONS How to use:

there is more specific explanation for each Button type (currently SLIDERBUTTON and CHECKBOXBUTTON)

NOTICE: For each button you need to send a table that contains the buttons specifically named variable.

As Example: varTable.SliderVar

same table could contain Variables for more than one button type:
Example: VarTable = {SliderVar, CheckBoxVar}

however, each Table can contain only one Variable of each type. If you want to have two different Sliders, you need two different Tables both containing SliderVar in them.
	
This is due to a limit in Hollywood in that you cant send reference of a variable to a function.
You however can get around this by sending a table containing a variable into a function, since when you send a table, it will send a reference to a table.
Therefore touching variables inside that table reference will do same as having sent a reference to a variable had done, meaning that if you change the value of variable SliderVar inside Sliderbutton, it will also change the value of the variable SliderVar in the original table. (or technically speaking, only the original tables SliderVar ever changes, since Sliderbuttons SliderVar is only a reference to that one)



For Buttons to draw themselves, you need to do something like: 
SetInterval(1, Function()
	Cls(0)
	Buttons.Draw(Buttons)
		EndFunction, 10)
			
Repeat


It is currently assumed you will simply get rid of all buttons at once one way or other yourself, therefore there are no functions which would delete button or even keep track of them.

There is however an option to empty the list to stop drawing all the buttons: Buttons.EmptyList


SLIDERBUTTON: (VarTable, X, Y, SliderBrushID, ButtonID, OptionalArguments)

	VarTable - Contains variable SliderVar inside it, ie. MyTbl.SliderVar
	X and Y - normally BGBrush X and Y, but if there is no BGBrush, then Sliders X and Y without taking into consideration XOffset or YOffset or Sliders current position.
	SliderBrushID - ID of the Brush to use for Slider image.
	ButtonID - ID to be used for the Button that is going to be created now, notice that you cant use NIL for this in Sliders case, this is due to Slider recreating new button each time slider is moved for buttons location to change, and Hollywood doesnt let you use NILs userdata for new buttons ID, therefore in current system I couldnt figure out a sensible way to keep track of NIL id.

OptionalArguments:

	SliderXMinXOffset, how much + or - will Slider X be able to go from the beginning (usually from BGBrush) -  if not using BGBrush, then this in practice decides how much SliderX can move
	SliderXMaxXOffset, how much + or - will Slider X be able to go from the end (usually from BGBrush) - of not using BGBrush, then this in practice decides how much SliderX can move
	BGBrushID, If you want to use BGBrush graphics to determine where sliedr will be moving at, then use this.
	SliderYRelatevitoBGBrush, this lets you set the Slider Y Relative to BGBrush, only useful if there is BGBrush, and makes it possible to have for example oversized button in Height to look properly relative to BGBrush
	VariableAccuracy, usually Variables accuracy is based upon 0-100 (100), but using this accuracy can be changed to be something else from 0 to accuracy.
	FuncContinuousMouseDown, this lets you set a Function that will be executed as long as left mouse is down on top of the slider.
	FuncDraw, this lets you set a Function that will be executed everytime this slider is drawn - meaning in practice a function that will be executed all the time as long as the Slider exists.
 

To Use:

	SliderButton is meant to be created in one of two ways: Either by using just the Slider, or with Slider and BGBrush.
	
	Although OptionalArguments are Optional, in practice some of them are necessary, and necessary ones depend upon which of the before mentioned ways you are making the SliderButton.
	
	What every SliderButton needs is following:
	BeforeMentioned Table containing SliderVar variable.
	X-spot you wish SliderButton to appear
	Y-spot location you wish Sliderbutton to appear
	
	Notice about X and Y-location that if BGBrush is used, then X and Y refer to X and Y location of BGBrush, not the Slider.
	If no BGBrush is used, then X and Y location refer to the minimum X and Y location that Slidebutton can appear at. (notice that SliderButton will be set to the position reflecting its current valuke)
	
	
	SliderBrushID, this is the Brush used for the SliderButton image, you always have to use Brush for that.
	ButtonID, notice this doesnt automatically take care of the ButtonID, but you need to take care of it yourself, and sending "nil" wont work.
	
	If using BGBrush, then only OptionalArgument needed is "BGBrushID", which will be the Brush used for Sliders Background image.
	
	If not using BGBrush, then you have to set SliderXMinXOffset or SliderXMaxXOffset at minimum for Slider to have some movement space, otherwise Slider will be still.	


CHECKBOXBUTTON: (VarTable, X, Y, OffBrushID, OnBrushID, ButtonID, OptionalArguments)

	VarTable - Contains variable CheckBoxVar inside it, ie. MyTbl.CheckBoxVar 
	X and Y - Location where CheckboxButton when OFF/FALSE will be displayed at
	OFFBrushID and ONBrushID - IDs for Brushes to use as ON/TRUE and OFF/FALSE images.
	ButtonID - ID to be used for the Button that is going to be created now, you can use NIL as well to create a uniqueID which will be returned.
		example: ButtonID = CheckBoxButton.New(Vartable2, 500, 400, 3, 4, 4, {})

	OptionalArguments:
	
	XOnOffSet and YOnOffSet, if these are used, then Button on "ON/TRUE" state will be displayed in location X + XOnOffSet, notice that XOnOffSet can be negative value, and usually is.
	
	Notice also that if OffBrush and OnBrush are of different Width and/or Height, it will automatically be assumed that XOnOffSet and YOnOffSet are wanted.
	This XOnOffSet value is then determined by (OnBrushWidth - OffBrushWidth) / 2, which usually results in a negative value.
	If XOnOffset or YOnOffSet is determined in OptionalArguments, then these values will be used instead of the automatically calculated value.
	
	FuncDraw, this lets you set a Function that will be executed everytime this Button is drawn - meaning in practice a function that will be executed all the time as long as the Button exists.
*/




Buttons = { List = {} }

SliderButton = {}
CheckBoxButton = {}

Function Buttons.Draw(Self)
	ForEach(self.list, Function (Notused, SingleButton)
		SingleButton.Draw(SingleButton)
			   EndFunction)
EndFunction


Function Buttons.Emptylist(self)
	self.list = {}
EndFunction


Function CheckBoxButton.New(VarTable, X, Y, OffBrushID, OnBrushID, ButtonID, OptionalArguments)
	Local o = {x = X, y = Y, SliderX = X, SliderY = Y, VarTable = Vartable, OffBrushID = OffBrushID, OnBrushID = OnBrushID, ButtonID = ButtonID}
	
	If GetType(OptionalArguments) = #NIL Then OptionalArguments = {}	
	o.Draw = CheckBoxButton.Draw
	o.Vartable = VarTable
	
	o.OffBrushWidth = GetAttribute(#BRUSH, o.OffBrushID, #ATTRWIDTH)
	o.OffBrushHeight = GetAttribute(#BRUSH, o.OffBrushID, #ATTRHEIGHT)
	o.OnBrushWidth = GetAttribute(#BRUSH, o.OnBrushID, #ATTRWIDTH)
	o.OnBrushHeight = GetAttribute(#BRUSH, o.OnBrushID, #ATTRHEIGHT)

	Local WidthToUse = o.OffBrushWidth
	Local HeightToUse = o.OffBrushHeight
	If o.VarTable.CheckBoxVar = True
		WidthToUse = o.OnBrushWidth
		HeightToUse = o.OnBrushHeight
	EndIf
	
	o.XOnOffSet = 0
	o.YOnOffSet = 0
	
	If o.OffBrushWidth <> o.OnBrushWidth
		If HasItem(OptionalArguments, "xonoffset") 
			o.XOnOffset = OptionalArguments.XOnOffset 
		Else
			o.XOnOffset = (o.OffBrushWidth - o.OnBrushWidth) / 2
		EndIf
	EndIf
	
	If o.OffBrushHeight <> o.OnBrushHeight
		If HasItem(OptionalArguments, "yonoffset") 
			o.YOnOffset = OptionalArguments.YOnOffset
		Else
			o.YOnOffset = (o.OffBrushHeight - o.OnBrushHeight) / 2
		EndIf 
	EndIf
	
	If HasItem(OptionalArguments, "funcdraw") Then o.funcdraw = OptionalArguments.funcdraw
	
ToReturnButtonID = MakeButton(ButtonID, #SIMPLEBUTTON, o.X, o.Y, WidthToUse, HeightToUse, {OnMouseDown = Function ()
									CheckBoxButton.OnMouseDown(o)
								EndFunction})
If GetType(ToReturnButtonID) = #NIL
	ToReturnButtonID = ButtonID
Else
	o.ButtonID = ToReturnButtonID
EndIf

InsertItem(Buttons.list, o)

Return(ToReturnButtonID)
EndFunction



Function CheckBoxButton.OnMouseDown(self)
	Self.Vartable.CheckBoxVar = 1 - Self.Vartable.CheckBoxVar
EndFunction



Function CheckBoxButton.Draw(self)
	Local BrushIDtoDraw = self.OffBrushID
	If self.Vartable.CheckBoxVar = True Then BrushIDtoDraw = self.OnBrushID
	
	Local XtoUse = self.x
	Local YtoUse = self.y
	
	If Self.VarTable.CheckBoxVar = True
		XtoUse = self.x + self.XOnOffset
		YtoUse = self.y + self.YOnOffset
	EndIf
		
	DisplayBrush(BrushIDtoDraw, XtoUse, YtoUse)
	If HasItem(self, "funcdraw") Then self.FuncDraw
EndFunction





Function SliderButton.New(VarTable, X, Y, SliderBrushID, ButtonID, OptionalArguments)

Local o = {x = X, y = Y, SliderX = X, SliderY = Y, VarTable = VarTable, SliderBrushID = SliderBrushID, ButtonID = ButtonID}


o.SliderWidth = GetAttribute(#BRUSH, SliderBrushID, #ATTRWIDTH)
o.SliderHeight = GetAttribute(#BRUSH, SliderBrushID, #ATTRHEIGHT)

o.SliderXMinValue = 0
o.SliderXMaxValue = o.SliderWidth

If HasItem(OptionalArguments, "bgbrushid")
	o.BGBrushID = OptionalArguments.BGBrushID
	o.BGBrushWidth = GetAttribute(#BRUSH, OptionalArguments.BGBrushID, #ATTRWIDTH)
	o.SliderXMaxValue = o.BGBrushWidth - o.SliderWidth
EndIf

o.SliderXMinOffset = 0
o.SliderXMaxOffset = 0
If HasItem(OptionalArguments, "sliderxminoffset") Then o.SliderXMinValue = o.SliderXMinValue + OptionalArguments.SliderXMinOffset
If HasItem(OptionalArguments, "sliderxmaxoffset") Then o.SliderXMaxValue = o.SliderXMaxValue + OptionalArguments.SliderXMaxOffset

o.VariableAccuracy = 100
If HasItem(OptionalArguments, "variableaccuracy") Then o.VariableAccuracy = OptionalArguments.VariableAccuracy

Local TotalLength = o.SliderXMaxValue - o.SliderXMinValue
Local CurrentX = (TotalLength/o.VariableAccuracy) * o.VarTable.SliderVar

o.SliderX = CurrentX + o.SliderXMinvalue + o.X
If HasItem(OptionalArguments, "slideryrelativetobgbrush") 
	o.SliderYRelativeToBGBrush = OptionalArguments.SliderYRelativeToBGBrush
	o.SliderY = o.SliderY + o.SliderYRelativeToBGBrush
EndIf

If HasItem(OptionalArguments, "funccontinuousmousedown") Then o.funccontinuousmousedown = OptionalArguments.funccontinuousmousedown
If HasItem(OptionalArguments, "funcdraw") Then o.funcdraw = OptionalArguments.funcdraw

o.Draw = SliderButton.Draw

ToReturnButtonID = MakeButton(o.ButtonID, #SIMPLEBUTTON, o.SliderX, o.SliderY, o.SliderWidth, o.SliderHeight, {OnMouseDown = Function ()
									SliderButton.OnMouseDown(o)
								EndFunction})

InsertItem(Buttons.list, o)

Return(ToReturnButtonID)
EndFunction



Function SliderButton.Draw(self)
	If HasItem(self, "bgbrushid") Then DisplayBrush(self.BgBrushID, self.X, self.Y)
	DisplayBrush(self.SliderBrushID, self.SliderX, self.SliderY)
	If HasItem(self, "funcdraw") Then self.FuncDraw()
EndFunction



Function SliderButton.Update(self)


Return(	Function(IntervalData)
				Local MX = MouseX() - Self.MouseXEXtra
				If MX < self.X + Self.SliderXMinValue Then MX = self.X + Self.SliderXMinValue
				If MX > Self.X + Self.SliderXMaxValue Then MX = Self.X + Self.SliderXMaxValue
				Self.SliderX = MX 
				
				Local TotalLength = Self.SliderXMaxValue - Self.SliderXMinValue
				Local CurrentX = Self.SliderX - Self.X - Self.SliderXMinvalue
				Self.VarTable.SliderVar = (CurrentX / TotalLength) * Self.VariableAccuracy
				
				If HasItem(self, "funccontinuousmousedown") Then self.funccontinuousmousedown()

				If IsLeftMouse() = False
					ClearInterval(IntervalData.ID)
					
					DeleteButton(Self.ButtonID)
					
					MakeButton(Self.ButtonID, #SIMPLEBUTTON, self.SliderX, self.SliderY, Self.SliderWidth, Self.SliderHeight, {OnMouseDown = Function ()
									SliderButton.OnMouseDown(self)
								EndFunction})
				EndIf
			EndFunction	)					
EndFunction


Function SliderButton.OnMouseDown(Self, ButtonID)
	self.MouseXExtra = MouseX() - self.SliderX
	SetInterval(Nil, SliderButton.Update(self), 10)	
EndFunction


CreateBrush(1, 50, 160, #RED)
CreateBrush(2, 300, 100, #BLUE)

CreateBrush(3, 100, 100, #YELLOW)
CreateBrush(4, 120, 120, #GREEN)

VarTable = {}
VarTable.SliderVar = 30
VarTable.CheckBoxVar = False
VarTable2 = {}
VarTable2.SliderVar = 10
Vartable2.CheckBoxVar = True

SliderButton.New(VarTable, 100, 100, 1, 1, {SliderXMinOffset = -20, SliderXMaxOffset = 20, BGBrushID=2, SliderYRelativeToBGBrush = -30, funcmousedown=Function() TextOut(100, 200, "Volume:"..Vartable.SliderVar) EndFunction}) 
CheckBoxButton.New(Vartable, 300, 400, 3, 4, 2, {})
SliderButton.New(VarTable2, 100, 250, 1, 3, {SliderXMinOffset = -20, SliderXMaxOffset = 20, BGBrushID=2, SliderYRelativeToBGBrush = -30}) 
CheckBoxButton.New(Vartable2, 500, 400, 3, 4, Nil, {})

SetInterval(1, Function()
	Cls(0)
	Buttons.Draw(Buttons)
		EndFunction, 10)
			
Repeat
WaitEvent()
Forever
User avatar
jPV
Posts: 604
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: MakeButton ID of Nil to be usable for creating button again.

Post by jPV »

It would need a bit too much time/reading to understand what you're after, but couple of questions:

1) Are you going to move a button with a graphical knob? Why just don't let the button cover the whole sliding area and then it could stick in one position?

2) Shouldn't you make this events based and then you would get the button id in the callback function?
Bugala
Posts: 1181
Joined: Sun Feb 14, 2010 7:11 pm

Re: MakeButton ID of Nil to be usable for creating button again.

Post by Bugala »

1) I have considered this option but currently have not done so. It is doable, but lots of things to take into consideration. That basically for example one thing is that I want onmousedown to react only when mouse is on top of the slider. This could be done by doing a check of Mouse(X) and Mouse(Y) (normally X check is enough) to check that they actually are on top of Slider to actually activate the mousebuttondown-function.

Another thing is that Sometimes button might go over the area actually. like slider can be big sized enough to go past the background gfx area. Of course this isnt much of a problem in practice again in sense of that it still normally is used in rectangle area, but once again, would need to be taken into consideration in the code.

Also, while I am not really worried of this much, but there could be situation where two sliders actually overlap each other in case of oversized sliders for artistic reasons, in which case using rectangles for whole area could mean that only one of them is working properly, but that is something I don't have a plan to use, but would like to keep that option open too just in case I do decide to make something like that in future.

That main point is, I am trying to look for simple and not too complex solution to the problem, and right now it seems I can figure out only complex solutions due to Hollywoods limitations.


2) I don't understand what you mean. I thought I already am using Events approach.
User avatar
jPV
Posts: 604
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: MakeButton ID of Nil to be usable for creating button again.

Post by jPV »

Bugala wrote: Mon Apr 24, 2023 4:48 pm 2) I don't understand what you mean. I thought I already am using Events approach.
With a quick glance it looked like you're more like polling things with intervals, but ok, haven't looked that thorough :) But what you don't seem to do is to use message tables with event callback functions. Maybe you could carry button ids with them if that's the problem. Like OnMouseDown = Function(msg) and then do something with msg.ID.
Bugala
Posts: 1181
Joined: Sun Feb 14, 2010 7:11 pm

Re: MakeButton ID of Nil to be usable for creating button again.

Post by Bugala »

I actually tried that but it didnt have any use in the end.

What I did was use the msg part to get the buttons X and Y, and then was hoping to be able to change X-location by changing that X:s value, but unfortunately it is a variable, not a reference to a variable, and hence didnt work.

Problem is with being in need of redoing that button. There are some solutions, but none is ideal.

one possibility, which I am most leaning towards, is that I will do same as I am doing with Sliders variable, that variable is table.var, meaning I am in practice able to use reference.

in this case even when redoing the button, I can always save that Button ID into that variable and be able to access it from outside to be able to use DeleteButton to delete the button.

I do very much dislike the idea to having to use that system for that, which means that either I need to treat it as exception from rest of the buttons, or I need to start using same system with rest of the buttons too.

Like I can have ButtonsList = { ["mainmenubutton"] = 1, ["quitbutton"] = 2 } and this would be quite simple, but to use it on sliderbutton, I would need to do instead ButtonsList = { ["mainmenubutton"] = { var = 1 }, ["quitbutton"] = { var=2 } }

But at least that way I could always update the ButtonsList["sliderbutton"].var and be able to have the most recent NIL return in it.

I guess that is probably the best option to fix the problem.


Also, another drawback is that since I plan on putting the final version to others in this Forum too, and I also plan on having LayersOn version, then there comes the compatibility question.

Do I use Table.Var on both, or only on the Non Layer approach. Since there is no need to use that system in Layers On approach, and it is even bit strange to make it unnecessarily complicated when there is no need for such. But if I don't, then those two different versions would have two different approaches, making them not compatible with each other.

That if someone first uses no layers approach, and then decides to change into layers approach, then that means he needs to rewrite his buttonslist code too.

By other words, more moving pieces, when should try to minimize the amount of moving pieces to minimum.
Post Reply