Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does fltkhs support Tables from fuild? #76

Closed
dixie opened this issue Jan 29, 2018 · 6 comments
Closed

Does fltkhs support Tables from fuild? #76

dixie opened this issue Jan 29, 2018 · 6 comments

Comments

@dixie
Copy link

dixie commented Jan 29, 2018

Hello!

Thank you for very nice GUI library, which is easy to compile both on Linux and Windows.

Does fltkhs support Tables from fuild? I included simple table in fltkhs-fluid-hello-world (see attached HelloWorld.fl) but it produces not-working code, something like:

setCallback helloWorldButton buttonCb;
-- Fl_Table table0 (25,25,175,100);
setLabel table0 "Table1";
 -- unknown attribute: Open;
 -- unknown attribute: Selected;
begin table0;
end table0;

HelloWorld.zip

@deech
Copy link
Owner

deech commented Jan 31, 2018

Hi!
Unfortunately Tables are not supported from Fluid because they are a very low level widget that require you to override its draw function. Fl_Tree is like that too. I wish they were supported. You can add a custom table to the main window's group from whatever function is using the Fluid module if you want.
HTH

@dixie
Copy link
Author

dixie commented Feb 12, 2018

Hi!

Actually I would like to use in my application that two widgets - Tree and Table :) + some menus.
I'm not sure if I understood your suggestion. Is it an approach, which is used in Tree.fl example from fltkhs-fluid-demos? There are many other widgets in that demo code and I'm little bit lost what is exactly essential for working Tree widget. Maybe I need to study a code more till I get a better understanding of fluid/fltkhs interworking.

dixie

@dixie
Copy link
Author

dixie commented Feb 21, 2018

I read the documentation for fltkhs again, and I understood. So it is possible to combine fluid generated code with manually written. I'll try to do that.

@dixie dixie closed this as completed Feb 21, 2018
@dixie
Copy link
Author

dixie commented Jun 23, 2018

minor update related to the topic: in the end I'm using fltkhs without fluid. I was little bit afraid of writting UI-layout directly into code, but it seems to be quite simple with FLTK. Finally I have in the toolbox a GUI library, which is soooooo simple to build on Windows :) Thanks a lot!

@deech
Copy link
Owner

deech commented Jun 23, 2018

Glad it's working out for you. Thanks for the feedback!

@mikeplus64
Copy link

Could we paramaterise the makeWindow (or whatever name) function by the required callbacks?

e.g. instead of

makeWindow :: IO ()
-- define helper types like these in Graphics.UI.FLTK.Fluid or something
data TableParams = TableParams
  { drawCell :: Ref Table -> TableContext -> TableCoordinate -> Rectangle -> IO ()
  , widgetOverrides :: CustomWidgetFuncs Table
  , tableFuncs :: CustomTableFuncs Table
  }

-- then maybe define some helper-helpers like `showCells :: Show a => Array (Int, Int) a -> TableParams` etc

-- "foo" being the name given to the table in fluid
data WindowInfo = WindowInfo
  { foo :: TableParams
  }

makeWindow :: WindowInfo -> IO ()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants