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 06, 2020  
 
On 2020-10-06 08:25, anmol....@gmail.com wrote:
> I've run into a problem multiple times. Essentially I have a double_window with derived tab and in the tab there are groups with widgets.
> The order of definition of groups decides the display order of tabs.
> So I need to have a particular order there.
> 
> As a result I have issues with static defined widgets defined after they are first called.
> 
> For instance a widget in Tab 1 may need to initialize or obtain values from a widget in Tab 2.
> 
> Is there a way to specify the order of static widget declaration? Or a way to tell the compiler to parse all the statics first and then the code?

	Since each tab is usually a group, let's call these 'tab group widgets',
	where each contains the layout for a particular tab.

	Normally I'd say change the design so that any dependence between the
	"tab group widgets" is done AFTER they're created. This way they can
	be instanced in whatever order makes sense to create the tabs (from left
	to right), and then /after/ they're all created, call a method in each
	tab group widget that lets interact.

	I assume the interaction is perhaps widget positioning (?), where
	maybe one "tab widget group"'s contents defines where the other's
	positions should be, so create a default layout in fluid for each
	"tab group widget", and then the above described method just uses
	position() or resize() to lock the widgets to one another.

	You can create each "tab group widget" in fluid as a separate New -> Window,
	and change the class type (in properties; C++ -> Class:) to Fl_Group,
	and then layout each tab group widget's contents the way you want,
	then use New -> Code -> Group in the tab widget's constructor that
	creates the instances of each tab group widget (using "new YourWidget(..)")
	and calls the above described method.

-- 
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/fadf3a43-caeb-5ae8-fe30-4641f3523f91%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'.