grail.widgets.ggroup module

Version: 16.2

Table of Contents

Description

Contains the GGroup widget.

Example

The following example will create a GGroup widget with a button within it.

from grail.widgets import *

root = gwidgetinit()
root.title("GGroup Example")

group = GGroup(root, text="My group")
button = GButton(group.interior(), text="button in group")
group.pack(anchor='nw', expand=1, fill='x')
button.pack(padx=4, pady=4, expand=1, fill='x')

root.mainloop()

The above script will create a window that appears as follows,

Screen shot of the GGroup widget.

Example of the GGroup widget.

GGroup Widget

The GGroup widget inherits from,
class GGroup([parent, **keywords])

A small 'border' around a collection of widgets.

Arguments:
parent : Tkinter.Frame
Parent widget, widget we insert into.
keywords
Variable keyword list defined below.
Keyword:
text
The text displayed as part of the group.
rtv
Sets an grail.rtv variable that will update the group's text field if the RTV variable changes.
Components:
None.
Signals:
None.
destroy()
Handle the Tkinter clean-up request.
disable()
Doesn't do anything (can't disable per se).
enable()
Doesn't do anything (can't enable per se).
interior()
Retrieves the internal frame (inside the group).
updatevars()

Synchronize RTV variables with GGroups text value.

In this case the user can not modify the contents of the group, therefore we don't have to a thing!