##Things to keep in mind when developing complex GUI in Mathematica:
- ###Styles management/inheritance system (StyleSheets and friend)
It is complicated, full of exceptions and only a tip of the iceberg is documented. Those 3 features are limiting the usage of it, which##What is a pity because it has a potential to give a lot. I'm also missing guidelines about common/basic activities related to stylesheets.
How is the cell style of a given cell resolved.
Updating styles based on styles changed in a private stylesheet
How to inspect selected text's style origin?
Not needed Stylesheet locked by the FrontEnd
- ###Mathematica assumes your
dpi == 72
on Windows whether it is so or not.
You can force proper handling of printer's points on HiDPI screens, but are you allowed to do this for the customer's front end? It isn't fully documented and self inconsistent documentation won't help you understand what's going on.
What is a printer's point?
Fontsize is too small
Magnification, ScreenResolution, ScreenInformation and Printing: Please shine some Light into it!
Printer points and font size units (good luck with tracking what is the current one) are only options. And not both but you have to align two different worlds.
How to convert between various ItemSize/ImageSize units?
- ###Lack of full control/documentation of Kernel initialization/deinitialization:
Handling Kernel start. Autoload place in init stack.
Handling Kernel quit
How to clean up after a package?
[...] What you cannot do is to make assumptions about the order in which subsequent DynamicModule or Dynamic expressions will fire, or even if they will fire (if they're not in the same position). [...] [...] NotebookDynamicExpression not firing in new kernel sessions [...]
- ###Issues of a dynamic GUI
Dynamic cells after Kernel restart/quit: Dynamic based GUI will not digest kernel quit well, and you can't do much about that because of the previous section.
Evaluation order of DynamicModule and Manipulate: Particularly handy to know when deciding about when to load static functions and packages.
How Initialization works in DynamicModule
Nesting DynamicModules to properly divide Front-end and Kernel functionality
Create a notebook and save it without prompting Dynamics
In many gui objects, certain options are ignored.
Grid - problem with ItemSize being ignored
`SetOptions[GraphicsGrid, Frame -> True]; GraphicsGrid@Array[Graphics@Circle[] &, {2, 2}]`
- ###Misaligned frames, additional pixels, imprecise dimensions
Extra pixels are introduced in many cases, leading to improper dimensions and misalignments.
`test = Framed["TEST", Background -> Red, FrameStyle -> Blue, ImageSize -> {100, 100}]`
`Column[{#, #, Column[{#, #}, Spacings -> 0]}, Spacings -> 0] & /@ {test[Blue], test[None]}`
ImageDimensions@Rasterize@test
{100, 102} (* I could live with {102, 102}... *)
Grid cuts my images
TabView Alignment problem for content larger than a view area:
- ###Transparency and background issues
Transparent bitmaps in controllers bug.
Dynamic graphics appears first with wrong background
DensityPlot
and GeoGraphics
put a white frame around an inset Button
.
{DensityPlot[Sin[x] Sin[y], {x, -4, 4}, {y, -3, 3}, ImageSize -> 100,
Epilog -> {Inset[Button["Test"], Background -> None]}],
GeoGraphics["London", ImageSize -> 100,
Epilog -> {Inset[Button["Test"], Background -> None]}]}
topic here
Notebook's WindowSize interference with contents' Dynamic ImageSizes
Problem with CurrentValue["MouseOver"] and Deploy
From my experience it is impossible to create precise GUI for Win and Mac. Not all features are OS dependent, and often workaround for one will give you headache in the other.
Grid layout problems: different sizes when rendering on Mac and Windows
Not needed Stylesheet locked by the FrontEnd
##Question
Are there any guidelines to make GUI creation process more stable?
Quick workarounds are not general enough and I don't have time to spend 1 day to align a simple grid.
If not, what should I tell the designer/manager about requirements?