## The `gWidgets2` package
The `gWidgets2` package is a rewrite of the `gWidgets` package that
allows R users to easily create graphical user interfaces (GUIs) from
within R in a toolkit-independent manner. The package itself sets up
an API for describing these interfaces. An accompanying package
integrates this into the underlying toolkit library.
Currently there are the following packages:
* `gWidgets2RGtk2` for interfacing with the `GTK` set of widgets through the `RGtk2` package.
* `gWidgets2tcltk` for interfacing with the `TCL/TK` widgets through the `tcltk` package.
* `gWidgets2Qt` for interfacing with the `Qt` set of widget through the `qtbase`
Additionally, for web programming the packages `gWidgetsWWW2` and
`gWidgetsWWW2.rapache` implement basically the same API using the
ExtJs JavaScript libraries.
To use the package you need to have intalled: the underlying graphical
toolkit libraries, one of the basic R interfaces (`RGtk2`, `tcltk` or
`Qt`), then `gWidgets2` and one or more of the `gWidgets2XXX`
packages. The `tcltk` interface is usually the easiest, as the
underlying graphical toolkit libraries are bundled with the standard
windows binary of R, thought `RGtk2` and `Qt` versions work with a
much richer underlying set of controls.
The `gWidgets2` API exposes only a small subset of what is available
in the underlying toolkit, but does it in a fairly easy to learn way
using many of `R`'s standard methods, as possible.
A basic example of making a "hello world" app would be:
```
w <- gwindow("Hello...", visible=FALSE) ## a parent container
g <- ggroup (cont = w) ## A box container
b <- gbutton("Click me for a message", cont=g, expand=TRUE) ## some control
addHandlerClicked(b, function(...) { ## adding a callback to an event
gmessage("Hello world!", parent=w) ## a dialog
})
visible(w) <- TRUE ## a method call
```
Though short, this example illustrates the range of basic tasks needed
to construct a GUI. Some other examples are in the `examples`
directory of the package and the package `vignette`.
## Why a rewrite of the `gWidgets` package?
* This should be much faster (early benchmarking is about 10-100% as
fast). The gWidgets package had a cumbersome dispatch mechanism
based on S4 methods. This rewrite uses a lighter-weight S3 dispatch
and reference classes.
* Should be easier to maintain. The documentation is done with
roxygen2. The old version was by hand. It required some tedious
stuff, best left unsaid.
* rethinking some of the argument names, functions etc.. I don't think
we need `gcommandline`, `gformlayout`, `ggenericwidget`, etc. These
are best left to a separate package, if at all. Most of the
arguments were made to be consistent. There weren't major changes,
but enough to warrant adding a "2" to the package name.
* The code in the toolkit implementations needed cleaning up. Lots of
it. This rewrite gave reason to do so.
* putting more structure on the toolkit. Before the class structure
was left alone, leaving open the possibility that it could be made
better (by someone else). Well, it wasn't. By enforcing a class
structure with specific method names in the toolkit packages the
code becomes more consistent. It should also make it easier for users
to derive subclasses
* adding in some other features. For example, `gprogressbar`, `gtimer`, `gstackwidget`, ...
![avatar](https://profile-avatar.csdnimg.cn/51db315e0c214f5dbc234437d2a45af7_qq_46187594.jpg!1)
好家伙VCC
- 粉丝: 2740
- 资源: 9136
最新资源
- 围栏破损检测数据集,954张,带有txt和xml格式的标注
- WPF基于FFmpeg做的媒体转换器 软件支持音频转换、视频转换、视频压缩、视频编辑、合并转换等多种功能.zip
- STM32H750驱动的四轴飞行器实验源码:基于IMU模块的通用四旋翼功能实现,涵盖滤波、控制与通信技术,STM32H750驱动的四轴飞行器实验源码:基于imu模块的滤波、控制与通信技术实现四旋翼通用
- 基于PSO-CNN算法的优化与分类预测:多特征输入单输出模型的迭代混淆矩阵分析图解,PSO-CNN算法优化卷积神经网络分类预测模型:多特征输入迭代优化与混淆矩阵分析的二分类与多分类模型图解,PSO-C
- MicroPython ESP32 ,SSD1306 OLED 显示中文汉字
- 一种基于无监督学习的全局水平辐照度估算方法在光伏功率测量中的应用,全球视角下的无监督光伏功率测量方法:精准估算全局水平辐照度,一种估算光伏功率测量全局水平辐照度的无监督方法 ,核心关键词:光伏功率测量
- 基于PLC的立体车库设计:西门子S7-1200PLC程序与组态仿真技术,电路图及IO表详解,博途软件应用指南,基于PLC的立体车库设计与西门子S7-1200PLC程序开发 通过组态仿真及电路设计,包括
- 基于深度学习的GCNN神经网络模型在EEG数据诊断神经疾病中的应用研究,**GCNN在脑电图EEG神经疾病诊断中的应用:领域引导图卷积神经网络的增强源码数据集**,DL00507-使用领域引导图卷积神
- 智链触屏mqtt通讯协议v2.0(1).pdf
- TortoiseSVN-1.9.7.27907-x64-svn-1.9.7.msi
- 基于Matlab Simulink的电气工程仿真教学:涵盖控制算法与仿真模型制作,基于Matlab Simulink的自动控制教学辅导系统:涵盖控制算法与仿真模型制作实践,代Matlab Simuli
- .NET 面试宝典-2025
- 异步电机与感应电机仿真模型组合推荐:涵盖数学基础模型、无位置速度辨识等十多个模型,适用多种版本,总价特惠 ,基于Matlab/Simulink平台的异步电机与感应电机仿真模型打包,涵盖多种控制策略模型
- Maven Home Path配置Use Maven wrapper时的.mvn文件
- 自动睡眠阶段评分:基于序列到序列深度学习方法的单通道脑电图分析,基于DL00338的序列到序列深度学习自动睡眠阶段评分系统研究与实现,DL00338-使用序列到序列深度学习方法自动睡眠阶段评分 深度学
- 随机孔隙模型与小球生成仿真在光学与微波颗粒加热中的应用:COMSOL与MATLAB联合仿真探究,基于随机孔隙模型与小球生成仿真的光学及微波颗粒加热COMSOL与MATLAB联合仿真研究,随机孔隙模型与
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)