Gtkdialog Development
timer widget
Dear thunor,
A timer widget? Sounds tempting!
With kind regards,
vovchik
A timer widget? Sounds tempting!
With kind regards,
vovchik
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
Overhauled the entry widget
The widget reference is available here.
From the ChangeLog:
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.
Regards,
Thunor
The widget reference is available here.
From the ChangeLog:
- Fixed the exclusive default signal i.e. it wasn't possible to have a default action and another action specifying the same signal.
- Removed the odd manual emission of the default "changed" signal when using the fileselect function i.e. inserting text.
- Fixed widget_entry_refresh which wasn't distinguishing between <input> and <input file> directives (file loading wasn't implemented anyway) and then attempted to execute the <input file> if declared.
- Added support for the save function (now a full action function set).
- Added support for the custom tag attribute "block-function-signals".
- Added support for the "activate" signal emitted from pressing Enter.
- Added support for the "icon-press" and "icon-release" signals, actually prefixed with "primary-" or "secondary-" to distinguish between them.
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.
- 2.18 for the redefinable "invisible-char" in password entries.
- 2.16 for the "caps-lock-warning" icon in the password entries.
- 2.16 for the primary and secondary icons and signals.
- 2.16 for the progress bar.
Code: Select all
#!/bin/sh
# NOTE: This example requires at least gtkdialog-0.7.21 (please visit
# http://code.google.com/p/gtkdialog/). Additionally if you are using
# Puppy Linux then you may find that an historical version of gtkdialog
# already exists in /usr/sbin, and if that is the case then you should
# modify the shell variable below to point to the new gtkdialog binary.
GTKDIALOG=gtkdialog
function funcbtnCreate() {
echo '<button>
<label>"'"$2"'"</label>
<action>echo "'"$3"' entEntry'$1'"</action>
<action type="'"$4"'">entEntry'$1'</action>
</button>'
}
function funcentCreate() {
echo '<variable>entEntry'$1'</variable>
<action>echo "entEntry'$1' action for default signal triggered"</action>
<action signal="changed">echo "entEntry'$1' changed to $entEntry'$1'"</action>
<action signal="activate">echo "entEntry'$1' Enter key-press detected"</action>
<action signal="primary-icon-press">echo "entEntry'$1' primary icon press detected"</action>
<action signal="primary-icon-release">echo "entEntry'$1' primary icon release detected"</action>
<action signal="secondary-icon-press">echo "entEntry'$1' secondary icon press detected"</action>
<action signal="secondary-icon-release">echo "entEntry'$1' secondary icon release detected"</action>
</entry>'
if [ $2 = 1 ]; then echo '<vseparator></vseparator>'; fi
if [ $3 = 1 ]; then echo '</hbox><hseparator></hseparator><hbox>'; fi
}
if [ ! -f inputfile ]; then
echo "This came from an input file" > inputfile
fi
export MAIN_DIALOG='
<window title="entEntry" width-request="700" resizable="false">
<vbox>
<frame entry widget>
<vbox>
<hbox>
<entry activates-default="true">
<default>activates-default</default>
'"$(funcentCreate 0 0 0)"'
<button can-default="true" has-default="true" tooltip-text="can-default, has-default">
<label>Default</label>
<variable>btnDefault</variable>
<action>echo "btnDefault action for default signal triggered"</action>
</button>
</hbox>
<hseparator></hseparator>
<hbox>
<entry editable="false">
<default>editable</default>
'"$(funcentCreate 1 1 0)"'
<entry has-frame="false">
<default>has-frame</default>
'"$(funcentCreate 2 0 1)"'
<entry max-length="16">
<default>max-length</default>
'"$(funcentCreate 3 1 0)"'
<entry primary-icon-name="gnumeric">
<default>primary-icon-name</default>
'"$(funcentCreate 4 0 1)"'
<entry primary-icon-stock="gtk-about" primary-icon-activatable="false">
<default>primary-icon-stock, primary-icon-activatable</default>
'"$(funcentCreate 5 1 0)"'
<entry primary-icon-stock="gtk-select-font"
primary-icon-tooltip-markup="<span fgcolor='"'darkred'"'><b>primary-icon</b></span>-<i>tooltip</i>-<u>markup</u>">
<default>primary-icon-stock, primary-icon-tooltip-markup</default>
'"$(funcentCreate 6 0 1)"'
<entry primary-icon-stock="gtk-help" primary-icon-tooltip-text="primary-icon-tooltip-text">
<default>primary-icon-stock, primary-icon-tooltip-text</default>
'"$(funcentCreate 7 1 0)"'
<entry progress-fraction="0.25">
<default>progress-fraction</default>
'"$(funcentCreate 8 0 1)"'
<entry secondary-icon-name="gnumeric">
<default>secondary-icon-name</default>
'"$(funcentCreate 9 1 0)"'
<entry secondary-icon-stock="gtk-about" secondary-icon-activatable="false">
<default>secondary-icon-stock, secondary-icon-activatable</default>
'"$(funcentCreate 10 0 1)"'
<entry secondary-icon-stock="gtk-select-font"
secondary-icon-tooltip-markup="<span fgcolor='"'darkblue'"'><b>secondary-icon</b></span>-<i>tooltip</i>-<u>markup</u>">
<default>secondary-icon-stock, secondary-icon-tooltip-markup</default>
'"$(funcentCreate 11 1 0)"'
<entry secondary-icon-stock="gtk-help" secondary-icon-tooltip-text="secondary-icon-tooltip-text">
<default>secondary-icon-stock, secondary-icon-tooltip-text</default>
'"$(funcentCreate 12 0 1)"'
<entry truncate-multiline="true">
<default>truncate-multiline</default>
'"$(funcentCreate 13 1 0)"'
<entry text="text (similar to <default> except that GTK sets it after widget realization which emits a signal)">
'"$(funcentCreate 14 0 1)"'
<entry width-chars="30">
<default>width-chars</default>
'"$(funcentCreate 15 1 0)"'
<entry visibility="false" invisible-char="120" tooltip-text="visibility, invisible-char">
<default>The password is Fidelio</default>
'"$(funcentCreate 16 0 1)"'
<entry>
<default>"<width>, <height> (equivalent to width-request and height-request)"</default>
<height>50</height><width>250</width>
'"$(funcentCreate 17 1 0)"'
<entry xalign="0.5">
<default>xalign</default>
'"$(funcentCreate 18 0 0)"'
</hbox>
<hseparator></hseparator>
<entry accept="filename" block-function-signals="true">
<input>echo "This came from a shell command, and function signals are blocked"</input>
<output file>outputfile</output>
'"$(funcentCreate 19 0 0)"'
<hbox homogeneous="true">
'"$(funcbtnCreate 19 Disable Disabling disable)"'
'"$(funcbtnCreate 19 Enable Enabling enable)"'
'"$(funcbtnCreate 19 Clear Clearing clear)"'
'"$(funcbtnCreate 19 Delete Deleting removeselected)"'
'"$(funcbtnCreate 19 Refresh Reloading refresh)"'
'"$(funcbtnCreate 19 Save Saving save)"'
'"$(funcbtnCreate 19 Fileselect """Inserting into""" fileselect)"'
</hbox>
<hseparator></hseparator>
<entry accept="directory">
<input file>inputfile</input>
<output file>outputfile</output>
'"$(funcentCreate 20 0 0)"'
<hbox homogeneous="true">
'"$(funcbtnCreate 20 Disable Disabling disable)"'
'"$(funcbtnCreate 20 Enable Enabling enable)"'
'"$(funcbtnCreate 20 Clear Clearing clear)"'
'"$(funcbtnCreate 20 Delete Deleting removeselected)"'
'"$(funcbtnCreate 20 Refresh Reloading refresh)"'
'"$(funcbtnCreate 20 Save Saving save)"'
'"$(funcbtnCreate 20 Fileselect """Inserting into""" fileselect)"'
</hbox>
</vbox>
</frame>
<hbox homogeneous="true">
<button ok></button>
</hbox>
</vbox>
<action signal="hide">exit:Exit</action>
</window>
'
$GTKDIALOG --center --program=MAIN_DIALOG
Thunor
Last edited by thunor on Sun 21 Aug 2011, 13:18, edited 9 times in total.
It would hugely useful if you could come up with a way to stay compatible with gtk+-2.16 -at compile-time, at least. What I mean is a way to disable those features which require later versions of gtk. Or, if you could supply patches which could be used to remove just those features so one could still compile against gtk-2.16 for older systems, or whatever.
I've built a system which intentionally sticks with gtk+-2.16 since ti's the last gtk2 version which has a stable API and no glaring bugs. The next version of my system will probably use the last gtk2 version -hoping that some major distros will also stick with gtk2 and keep patching up bugs for awhile.
I've built a system which intentionally sticks with gtk+-2.16 since ti's the last gtk2 version which has a stable API and no glaring bugs. The next version of my system will probably use the last gtk2 version -hoping that some major distros will also stick with gtk2 and keep patching up bugs for awhile.
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
Hi amigoamigo wrote:It would hugely useful if you could come up with a way to stay compatible with gtk+-2.16 -at compile-time, at least. What I mean is a way to disable those features which require later versions of gtk. Or, if you could supply patches which could be used to remove just those features so one could still compile against gtk-2.16 for older systems, or whatever.
I've built a system which intentionally sticks with gtk+-2.16 since ti's the last gtk2 version which has a stable API and no glaring bugs. The next version of my system will probably use the last gtk2 version -hoping that some major distros will also stick with gtk2 and keep patching up bugs for awhile.
Which means then that you haven't been compiling Gtkdialog from SVN and trying the examples
What you've said I'm already doing. When I code support for a newer feature I wrap it in a GTK version check macro which simply removes the code if GTK is too old. Later GTK properties (tag attributes) of widgets that aren't supported by the user's version of GTK are ignored/ineffective; I don't have to do anything there.
I don't think that I should be castrating later GTK versions, instead it should be the responsibility of the application developer which features he is going to support, and I have made an effort to explain which features are supported by newer versions. After all, Gtkdialog is a Linux project, not written solely for one distro.
I'm also expecting folk to alert me to any compilation issues [which I may have missed] which I can resolve.
Regards,
Thunor
Thunor, you are right that I haven't compiled any of your new code. I'm glad that you are already taking care of the backwards-compatibility issues -we don't see much of that around here, so I thought it worth bringing up.
I *will* be compiling your new code pretty soon(on a system with gtk-2.16.6), though, and will gladly notify you if any problems come up.
I appreciate very much that you are keeping gtkdialog alive and extending its' usefulness!
I *will* be compiling your new code pretty soon(on a system with gtk-2.16.6), though, and will gladly notify you if any problems come up.
I appreciate very much that you are keeping gtkdialog alive and extending its' usefulness!
That new Pmusic looks amazing! Great work, guys.
Do you know a good gtkdialog program? Please post a link here
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
The "official" gtkdialog PET on ibiblio.org 'common' repo is thunor's revision 86 I think. I'm going to upgrade it soon, and I want to put in examples to illustrate the new features, well more examples to illustrate old features also.
The PET has /usr/share/doc/gtkdialog3/examples (in devx), which are the original ones.
I was thinking of adding /usr/share/doc/gtkdialog3/examples_extra.
When I get onto doing that, I will trawl through this thread, but if you want to send any to me, just short examples of a particular feature, not full applications, kindly email them: STARTbkaulerATgmailDOTcomEND
Put "gtkdialog" somewhere in the email title.
The PET has /usr/share/doc/gtkdialog3/examples (in devx), which are the original ones.
I was thinking of adding /usr/share/doc/gtkdialog3/examples_extra.
When I get onto doing that, I will trawl through this thread, but if you want to send any to me, just short examples of a particular feature, not full applications, kindly email them: STARTbkaulerATgmailDOTcomEND
Put "gtkdialog" somewhere in the email title.
[url]https://bkhome.org/news/[/url]
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
The "official" gtkdialog PET on ibiblio.org 'common' repo is thunor's revision 86 I think. I'm going to upgrade it soon, and I want to put in examples to illustrate the new features, well more examples to illustrate old features also.
The PET has /usr/share/doc/gtkdialog3/examples (in devx), which are the original ones.
I was thinking of adding /usr/share/doc/gtkdialog3/examples_extra.
When I get onto doing that, I will trawl through this thread, but if you want to send any to me, just short examples of a particular feature, not full applications, kindly email them: STARTbkaulerATgmailDOTcomEND
Put "gtkdialog" somewhere in the email title.
The PET has /usr/share/doc/gtkdialog3/examples (in devx), which are the original ones.
I was thinking of adding /usr/share/doc/gtkdialog3/examples_extra.
When I get onto doing that, I will trawl through this thread, but if you want to send any to me, just short examples of a particular feature, not full applications, kindly email them: STARTbkaulerATgmailDOTcomEND
Put "gtkdialog" somewhere in the email title.
[url]https://bkhome.org/news/[/url]
thunor,
I noticed in the hscale/vscale code that no provision is made to add to an old scale.
So could that possibly be what is messing up the positioning on the scale of the markup text?
As an example, if I run the example you provided, the type2 scale is displayed with all the markup text on the vertical scale displayed on the same line/area.
Since each item is calling the code as a new scale, that seems to be the case.
Could a mod be made to call old scale to add marks with markup after the first item for the scale as a test?
I noticed in the hscale/vscale code that no provision is made to add to an old scale.
So could that possibly be what is messing up the positioning on the scale of the markup text?
As an example, if I run the example you provided, the type2 scale is displayed with all the markup text on the vertical scale displayed on the same line/area.
Since each item is calling the code as a new scale, that seems to be the case.
Could a mod be made to call old scale to add marks with markup after the first item for the scale as a test?
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
With *scale and refreshable pixmaps, a unified tray applet is now possible using gtkdialog.... although gtkstatusicon would make it work outside of jwm (in wm without swallow capacity)
For example:
Volume, battery, CPU, memory etc...
Glade can do gtkstatusicon, but if it is deprecated perhaps it's a poor choice?
For example:
Volume, battery, CPU, memory etc...
Glade can do gtkstatusicon, but if it is deprecated perhaps it's a poor choice?
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
I'll add a feature request for it. [EDIT] done.vovchik wrote:A timer widget? Sounds tempting!
Great The more folk testing, the merrier.amigo wrote:I *will* be compiling your new code pretty soon(on a system with gtk-2.16.6), though, and will gladly notify you if any problems come up.
If you can duplicate it then tell me and I'll take a look, otherwise just tell me what happened. BTW your Pmusic looks fantasticzigbert wrote:Regarding gtk compatibility, I think there is an issue with h/vscale when using scale-step that is not an integer. I get error in Puppy 5.11, but not in the latest Spup.
All my examples are listed in the Development section to make your life easier, if you want to use themBarryK wrote:When I get onto doing that, I will trawl through this thread...
You may be surprised to find that all directives and tag attributes are in fact static except that <input> and <input file> enable the application developer to alter the input data. Therefore adding marks and markup to an existing "shown" scale at a later time isn't possible.8-bit wrote:I noticed in the hscale/vscale code that no provision is made to add to an old scale.
...
Since each item is calling the code as a new scale, that seems to be the case.
Could a mod be made to call old scale to add marks with markup after the first item for the scale as a test?
I've tried a number of things to get the vertical markup to position correctly including fixing the bar size so that GTK doesn't resize it. The code that deals with both scales is identical since they share the GtkScale base class which includes the simple gtk-scale-add-mark function.
You have the source code: in widgets.c:126 you'll find the function fill_scale_by_items. Comment-out the "#ifdef DEBUG" and the "#endif" a few lines down and after compiling it watch the values in the terminal. I can't do anything else with it at the moment and the first thing I would do is test it on another Linux distro. Also I haven't even found a GTK+ 2 app using marks let alone markup.
Regards,
Thunor
I tend to agree that the way the code is written in gtk 2.16, there is not a whole lot one can do.
That is considering that a lot of applications Puppy uses require gtk version 2 and gtk version 3 has not assured backward compatability and would break a lot of applications.
Also, you are correct in that I too have not seen any applications at all that use the vscale.
It appears though that Zigbert has implemented a horizontal scale in Pmusic.
And, It looks really great! Good work there!
One thing that bugs me is that the original maker of gtkdialog, if it was indeed him, included an example that just flat out does not work.
It is the list_actions one.
No one even attempts to use it since it is broken.
That is considering that a lot of applications Puppy uses require gtk version 2 and gtk version 3 has not assured backward compatability and would break a lot of applications.
Also, you are correct in that I too have not seen any applications at all that use the vscale.
It appears though that Zigbert has implemented a horizontal scale in Pmusic.
And, It looks really great! Good work there!
One thing that bugs me is that the original maker of gtkdialog, if it was indeed him, included an example that just flat out does not work.
It is the list_actions one.
No one even attempts to use it since it is broken.
Rather than an examples_extra, why not add the new examples in with the old ones, upstream? It seems senseless to maintain puppy specific changes...BarryK wrote:The "official" gtkdialog PET on ibiblio.org 'common' repo is thunor's revision 86 I think. I'm going to upgrade it soon, and I want to put in examples to illustrate the new features, well more examples to illustrate old features also.
The PET has /usr/share/doc/gtkdialog3/examples (in devx), which are the original ones.
I was thinking of adding /usr/share/doc/gtkdialog3/examples_extra.
When I get onto doing that, I will trawl through this thread, but if you want to send any to me, just short examples of a particular feature, not full applications, kindly email them: STARTbkaulerATgmailDOTcomEND
Put "gtkdialog" somewhere in the email title.
Do you know a good gtkdialog program? Please post a link here
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
Thanks, I've removed it.8-bit wrote:BarryK,
In including examples, when devx is loaded, the example in /usr/share/doc/gtkdialog3/examples called 07.02-list_actions is broken.
When it is run, the processor maxes out and the example has to be killed to recover.
So removal of that example is suggested.
[url]https://bkhome.org/news/[/url]
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
Overhauled the menu and menuitem widgets - part 1
I've added quite a few useful things that I may as well announce now since I've got a fair amount of work left to do before the menu system is adequately updated and extended.
Submenu, checkbutton and radiobutton menuitems are to follow
<menu> and <menuitem> widgets example:
Updated 2011-08-02 16:46: example superseded by http://www.murga-linux.com/puppy/viewto ... 591#549591.
Regards,
Thunor
I've added quite a few useful things that I may as well announce now since I've got a fair amount of work left to do before the menu system is adequately updated and extended.
- The "icon" tag attribute now loads icons set to 16x16 and not 20x20.
- It's now possible to use the <menuitem use-stock="true" label="gtk-stock_id"> GTK property method of setting stock images as well as the easier custom stock="gtk-stock_id" method.
- The menu widget now accepts tag attributes so that <menu label="_File" use-underline="true"> works.
- Menu items now support accelerators using the "accel-key" and "accel-mods" custom tag attributes and both can be entered as either decimal or hexadecimal values.
- Added support for the <visible> directive although it's already possible to use the GTK "sensitive" property.
Submenu, checkbutton and radiobutton menuitems are to follow
<menu> and <menuitem> widgets example:
Updated 2011-08-02 16:46: example superseded by http://www.murga-linux.com/puppy/viewto ... 591#549591.
Regards,
Thunor
Last edited by thunor on Mon 08 Aug 2011, 22:03, edited 9 times in total.
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
A problem!
I cannot close a child window, I have described the problem on my blog:
http://bkhome.org/blog/?viewDetailed=02366
Ages ago, I know it did work, but I can't remember if we had to do anything special, or if "closewindow" used to work. Maybe that was with gtkdialog2.
Can anyone help?
I cannot close a child window, I have described the problem on my blog:
http://bkhome.org/blog/?viewDetailed=02366
Ages ago, I know it did work, but I can't remember if we had to do anything special, or if "closewindow" used to work. Maybe that was with gtkdialog2.
Can anyone help?
[url]https://bkhome.org/news/[/url]