haskell - 如何更改 Threepenny GUI 中的按钮布局和位置?
问题描述
如何在使用 threepenny-gui 包创建的 GUI 中更改按钮或其他 UI 元素的大小和位置?
的文档Graphics.UI.Threepenny.Attributes
列出了一些可能有用的函数,例如coords :: WriteAttr Element String
. 但是,我不明白如何使用它们。具体来说,我不明白这个String
论点应该是什么。
谢谢
解决方案
Threepenny UI element combinators translate more or less directly to HTML, and so you should think in terms of HTML when doing layout with it:
The attributes from
Graphics.UI.Threepenny.Attributes
you mention are HTML attributes. Modifying them while defining your initial layout is typically done withset
. (By the way, if you need a reference for looking up what things like HTML attributes do, you can't do wrong with MDN.)For CSS styling, you can use the
(#.)
combinator.As for layout, the basic tools are
(#+)
to nest HTML elements, andgrid
,row
andcolumn
to arrangediv
-based grids.
推荐阅读
- java - Spring Boot 循环依赖与接口
- php - 如何从 react、axios 和 dropzone 前端使用 php 保存文件?
- entity-framework - OData - Entity Framework Core - 如何将 OData 参数从 Controller 注入到 Linq 查询中
- ruby - 如何在 Pry 控制台中提供自定义方法
- python - 将数据帧分区到重叠段
- spring-data-mongodb - Spring data MongoDB查询具有BigDecimal类型字段的文档
- c++ - C++ ^ 运算符与函数一起使用
- html - 在网页中制作图表
- java - 如何捕获 GWT TextBox KeyDown 重复
- audio - 如何将音频文件设置为某些特征?