Autoglade
From Codtech
Under construction
Contents |
Welcome to autoglade
autoglade is an attempt to automate as much as possible the design and program of Gnome/GTK, Windows/GTK and OSX/GTK cross platform applications whose GUI is designed with Glade.
| IMPORTANT: Always remember that all of these examples are using autoglade in its command line mode and require not even a single line of code being programmed. Autoglade as a python module is described Autoglade python module. |
Some patterns in the GUI design are detected and translated into application code automatically.
autoglade-0.4
autoglade-0.4 introduce a big amount of new features that simplifies even further Rapid Application Development (RAD) (or should we call it MAD for Magic Application Development :-) and prototyping. This new version also supports cross-platform applications allowing to develop or run on any of the supported platforms (Linux, Unix, Windows, OSX). Following examples use a simple editor application to show automated features.
autoglade download: autoglade-0.4 @ SF
name overloading
To describe the behavior of some components name overloading is used to be able to insert this from Glade GUI designer.
This commands are currently supported
| command | args | description | mywidget:auto:init: | gconf | registry | initialize widget value | mywidget1:auto:show: | mywidget2[,...] | show or hide the specified widgets | mywidget1:auto:sensitize: | mywidget2[,...] | sensitize or desensitize the specified widgets | mywidget:auto:dump | name | dump values as name | mywidget1:auto:property: | mywidget2:prop:val | set property prop with value val | mywidget:auto:exec: | command:args | exec command | mywidget:auto: | method:args | invoke method |
|---|
autoeditor
A sample application, discussed in Autoglade Tutorial, is used to show most of the features: autoeditor.
It is included in the distribution under examples/Tutorial/Autoeditor.
| TIP: Have in mind that the "application" is just the Glade interface definition in XML, all the functionality is automagically provided by autoglade |
This is autoeditor running
after
C:\watherver> autoglade autoeditor.glade
or
after
$ autoglade autoeditor.glade
main features
auto menu items
Stock menu items are automatically located and identified and default behavior is provided
auto open
Clicking on File->Open, using tool bar button Open or CTRL + O shortcut, the open file dialog is obtained
In our Glade XML file we can find (in the widget name)
imagemenuitemopen:auto:textview1
indicating that we want to put the content of the file opened into textview1 TevtView widget.
auto save
Clicking on File->Save, using tool bar button Save or CTRL + S shortcut, the save file dialog is obtained
auto save as
Clicking on File->Save As, using tool bar button Save As (if present), the save as file dialog, similar to #auto save is obtained
auto new
Clicking on File->New, using tool bar button New or CTRL + N shortcut, the create an empty document. If there are changes not saved in the previous document the corresponding warning is issued.
auto cut
Clicking on Edit->Cut, using tool bar button Cut or CTRL + X shortcut, the selected text is cut into the clipboard.
auto copy
Clicking on Edit->Copy, using tool bar button Copy or CTRL + C shortcut, the selected text is copy to the clipboard.
auto paste
Clicking on Edit->Paste, using tool bar button Paste or CTRL + V shortcut, the clipboard text is copied to the target widget.
auto delete
Clicking on Edit->Delete, using tool bar button Delete if present, the selected text is deleted from the target widget.
auto preferences
Clicking on Edit->Preferences or using tool bar button Preferences invokes the Preferences dialog.
auto about
Clicking on Help->About or using tool bar button About if present, invokes the About dialog.
auto generic menu item
Any other, non-stock, menu item that has some autoglade hint, will invoke the auto action on activation. There are two examples in #autoeditor
- View->Tool Bar
- View->Status Bar
Having
menuitemshowtoolbar:auto:show:toolbar1
as widget name.
auto quit
Clicking on File->Quit, using tool bar button Quit (not present in autoeditor) or CTRL + Q shortcut, the application exits.
auto preferences
Using some of the method described in #auto prefereces you obtain the Preferences dialog.
auto font
Changing the font in Preferences will result in the font changed in the target widget.
auto wrap mode
Changing the wrap mode in Preferences to char will result in text flowing along the target widget.
auto about
auto generic dialog
If there were another dialog it would be invoked by some widget having the corresponding autoglade hint.











