FLTK logo

Re: [fltk.general] Order of variables in FLUID

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Order of variables in FLUID Greg Ercolano Oct 07, 2020  
 
On 2020-10-07 03:45, anmol....@gmail.com wrote:
> Hi Greg. I took the morning to do lots more reading to understand what you were referring to in terms of solutions - I have to save data from different tabs, and one widget in one tab can set the output of another widget.
> When the user clicks on Group 4, it must summarize in text form all the choices made in Group 1-3.

	OK, so assuming you have a single callback for the tab widget which is fired
	when someone clicks the group4 tab, it can access the data from the other 3 groups
	and apply it to group 4's browser.

	Set names for the different widgets so they are each assigned variables, and access
	the variables to read from/write to the widgets to update their data.

	To assign variable names to e.g. the browser widget, open the properties for that
	widget, and under C++ -> Name: type in a variable name to use for it. That will be
	assigned by fluid's code that sets up the widget, and those names can be accessed
	from your tab callback. Be sure the pulldown to the right of the above descibed
	Name: prompt is set to "global", so the variable is defined as a global.

> If a widget A sets the value of widget B - is the callback for widget B invoked ? Or can it be invoked ?

	For this the only callback you'd need is the one you have already for the tab,
	and just have that callback directly access the widgets to read/write them.

	You could get more complicated and make the tab group widgets modular subclasses
	that don't use globals. In that case, make an API in each class that lets you
	access the data within each group and return it as an array of strings in the
	format you want, and then your tab callback would invoke your subclass methods
	to accumulate the array of strings, and then pass that array to the group 4
	widget that would apply those strings in whatever way to the browser.
	Presumably each subclass would have a way to save out its widget's settings
	into text, and if need be, each could also have a way to apply those strings
	to the widgets, updating them based on the array's contents. This is basically
	"messaging", just without the formal structure of a centralized messaging system.

-- 
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/8d3a6a17-0d4a-18d4-177a-a6ed5b64f144%40seriss.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.