Thanks Dougal for creating this thread and thanks seaside for your kind words
What I'll do first then is create a [maintained] post listing improvements I've made to Gtkdialog and record anything I find useful to application developers as I dig through the source code.
Project Page
http://code.google.com/p/gtkdialog/
Downloading
There's little point in me creating source package releases at this time as it's quite fast moving. Therefore you'll need to download the source code from the SVN repository, but I'll explain the process and how to stay up-to-date. Open a terminal somewhere and type:
Code: Select all
svn checkout http://gtkdialog.googlecode.com/svn/trunk/ gtkdialog
cd gtkdialog
./autogen.sh
make
You can pass the usual configure options to autogen.sh if you want. The gtkdialog binary will be in the src folder but you can do a "make install" as super user or "sudo make install" if you wish. Later, every few days or so depending on your level of interest, you can type this from within the same folder:
Code: Select all
make clean
svn update
./autogen.sh
make
This will download only the files I've updated and you'll be in sync with what I'm doing.
Wiki
The widget reference is now complete and there is an interface to it on the
Gtkdialog Project Page.
Development
Extended functionality, new features, bug fixes etc.
- AUTHORS, ChangeLog, issue tracker, update log
- Applied as many relevant patches as I could find and removed the compilation warnings
- Added <pixmap> widget image refresh code (example)
- Added <button> widget image refresh code (example)
- Added <pixmap> widget image scaling (example) (currently animated gifs stop animating)
- Added <button> widget image scaling (example) (currently animated gifs stop animating)
- Added <tree> widget none, single, browse and multiple selection modes (example)
- Added <hbox> and <vbox> widgets scrolling capability (example)
- Added <hseparator> and <vseparator> widgets (example)
- Added <comboboxtext> widget (example)
- Fixed bugs in the glade support (diff)
- Added <button> widget image positioning capability (example)
- Added <comboboxentry> widget (example)
- Added <hscale> and <vscale> widgets (example)
- Overhauled the <entry> widget (example)
- Overhauled the <menu> and <menuitem> widgets - part 1 (example)
- Fixed, tweaked, tidied-up, made consistent and added comments to many scripts within the examples folder
- Overhauled the <menu> and <menuitem> widgets - final (example)
- Improved the theme icon support (example)
- Added <spinbutton> widget (example)
- Added <timer> widget (example)
- Overhauled the <notebook> widget (example)
- Added <togglebutton> widget (example)
- Overhauled the fileselect action function (example)
- Added <statusbar> widget (example)
- Added <tree> widget support for inserting stock or theme icons from an input file (example)
- Added <colorbutton> widget (example)
- Overhauled the widget packing method (example)
Some widget properties and features may be unavailable to you if you are using an older version of GTK+, but they will not prevent you from compiling and using Gtkdialog as Gtkdialog checks the user's version of GTK+ at compile time and removes support for unsupported properties and features to enable compilation against different GTK+ versions. Ultimately though, the features that the application developer chooses to implement and therefore the version of GTK+ that his application requires is not within my realm of operation.
Retrieving and Testing Against Gtkdialog's Version
For Puppy Linux
Firstly you'll need to locate the correct binary (courtesy of
01micko):
Code: Select all
if [ "$(which gtkdialog)" = "" ]; then
GTKDIALOG="gtkdialog3"
else
GTKDIALOG="gtkdialog"
fi
Now you're ready to check Gtkdialog's version number and Barry Kauler
states that "Woof as from April 2011 has 'vercmp' which will be in all Puppy builds":
Code: Select all
function funcGTKDVGet() {
GTKDV=( $($GTKDIALOG -v) )
GTKDV=${GTKDV[2]}
echo "Gtkdialog version: $GTKDV"
if vercmp $GTKDV lt 0.7.21 ; then
echo "This application requires at least gtkdialog-0.7.21"
exit
fi
}
funcGTKDVGet
For *nix in General
Gtkdialog's version number increased from 0.59.8 to 0.6.0 in 2006 and then 0.7.1 through to 0.7.21 where we are today, so breaking it down into major, minor and revision (micro) would require some tweaking, but if we treat it as a string then the extended test command (extended test facility) will suffice:
Code: Select all
GTKDIALOG=gtkdialog
function funcGTKDVGet() {
GTKDV=( $($GTKDIALOG -v) )
GTKDV=${GTKDV[2]}
echo "Gtkdialog version: $GTKDV"
if [[ $GTKDV < 0.7.21 ]]; then
echo "This application requires at least gtkdialog-0.7.21"
exit
fi
}
funcGTKDVGet
Research
Gtkdialog uses a lexer/parser (Flex/Bison) which manages the XML-like structures that applications are encoded within. Most widget tags accept attributes (tag attributes) and the majority of these are GTK widget properties, but some have been created exclusively for Gtkdialog (custom tag attributes) with the hbox and vbox's "scrollable" attribute being a good example. If you'd like to know which attributes can be applied to a widget, the best place to look is the
GTK+ 2 Reference Manual. Some tags such as <table> don't currently accept attributes because that's how they've been set-up in the lexer/parser, but these things can be modified if needed. Please note that the original author created the widgets in the way that he thought was appropriate, so some attributes might make GTK unhappy and you'll know via the terminal or receive a segfault in return for your meddling
Widgets inherit properties from their ancestor classes, so for example the <text> widget being a GtkLabel has the object hierarchy of GtkWidget->GtkMisc->GtkLabel and the properties of all of those object classes become available to the application developer for implementation as widget tag attributes. Following is an example of this property inheritance: the text widget is a GtkLabel which inherits the xpad and ypad properties from its parent class GtkMisc and the name property from its ancestor class GtkWidget:
Code: Select all
<text name="txtLabel "xpad="300" ypad="300">
<label>Testing this label</label>
</text>
After a widget has been created it is populated with data (if any). The directives (visible, default, width, height etc.) and custom tag attributes are applied and the signals are connected. Then it is realized and the GTK properties are passed on to GTK to be set as widget properties. Note that directives and custom tag attributes are applied pre-realization and GTK properties post-realization. This is why you can visibly see the effects of the width-request and height-request GTK properties but not the width and height directives; there is a note about this in the ChangeLog: "The widget properties are set only when the widget is realized. This modification has been made because some properties can be set only if there is a parent window".
Widget Construction
It helps to understand how the Gtkdialog widgets are constructed, especially if you are experiencing difficulties applying an attribute:
To be continued...