Gtkdialog Development
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
Whilst working on the new spinbutton widget I unearthed a bug in the tag_attributes.c:try_set_property function, the function that is responsible for passing tag attributes that are GTK+ widget properties on to GTK+ to set. The part that was responsible for converting char strings to unsigned integer values wasn't converting to anything, so that's why the "border_width" GTK+ property always appeared to be around 50 -- "0" being ASCII 48, "1" being ASCII "49", "2" being ASCII 50 etc. etc. Therefore the GTK+ "border_width" property now works as expected and this affects quite a few Gtkdialog widgets descended from the GtkContainer class. A short while ago I created the h/vbox and window "margin" custom tag attribute to compensate for this problem but it would appear to be redundant now (I'll leave it in though as it might be being used, but I'll remove it from the documentation).
Regards,
Thunor
Regards,
Thunor
thunor
Pmusic 2 is taking advantage of your wonderful work. Of course I meet some challenges, and I thought I would share some of them.
1.) H O T K E Y S
If I use <menuitem visible="false" accel-key="0xff52" accel-mods="4"> the hotkey won't work - because visible is set to false. Is this defined by purpose? I see it as a nice way to include hotkeys for other functions than I would like to include to the menus. In this example I want CTRL+up to increase volume level, but find it unlogical to include a menultem as the <hscale> works very well as the gui-alternative for setting volume level.
2.) P R O G R E S S B A R
Pmusic is getting more complex, and some parts of gtkdialog is not friendly to projects like Pmusic. - i.e. I let the main <progressbar> handle the refreshing of
- position of progress <hscale>
- album art for playing song
- play or pause icon in button
- playlist content - to show new items added from external source (like filemanager and external Music-source-window)
The problem is that <hscale> preferable should be updated each second. But this will deselect whatever the user has selected in the playlist <tree>, and that is rather anoying. The best solution for the <tree> would be to refresh only when the user actually adds something, but this won't move the progress <hscale> very often. A solution would of course be to use a unique <progressbar> for the refreshing of the playlist <tree>, but this would steal cpu, and Pmusic is aready using enough cpu-power.
The idea to solve this is hopefully simple:
<input file> is not in use by <progressbar> and could contain a value used in <action>if value refresh:PLAYLIST</action>. In other words; if <input file> contains 'refreshplaylist' (or whatever value) the playlist should be refreshed. Like this one progressbar could be used as a refresh-hub, and gtkdialog would be useful for BIG projects.
The very best would be if the <input file> could hold several values and the <action> activates if one of the values matches. This would make it possible to refresh several widgets, - or just one of them...
3.) C H E C K B O X
Pmusic 2 is close to beta-stage, but still there is one thing that is holding me back from freezing the new graphical theme-standard. You have worked alot with improving the pixmaps in gtkdialog. Still, I am not able to use the <draw-indicator="false"> for <checkbox> with only showing a pixmap (no label). Most audio-players uses only icons on the checkboxes for 'loop' and 'shuffle'. This is not a big thing for me, but I have to decide before I announce the grapical theme-standard for Pmusic 2 as final.
Thanks a lot for you work
Sigmund
Pmusic 2 is taking advantage of your wonderful work. Of course I meet some challenges, and I thought I would share some of them.
1.) H O T K E Y S
If I use <menuitem visible="false" accel-key="0xff52" accel-mods="4"> the hotkey won't work - because visible is set to false. Is this defined by purpose? I see it as a nice way to include hotkeys for other functions than I would like to include to the menus. In this example I want CTRL+up to increase volume level, but find it unlogical to include a menultem as the <hscale> works very well as the gui-alternative for setting volume level.
2.) P R O G R E S S B A R
Pmusic is getting more complex, and some parts of gtkdialog is not friendly to projects like Pmusic. - i.e. I let the main <progressbar> handle the refreshing of
- position of progress <hscale>
- album art for playing song
- play or pause icon in button
- playlist content - to show new items added from external source (like filemanager and external Music-source-window)
The problem is that <hscale> preferable should be updated each second. But this will deselect whatever the user has selected in the playlist <tree>, and that is rather anoying. The best solution for the <tree> would be to refresh only when the user actually adds something, but this won't move the progress <hscale> very often. A solution would of course be to use a unique <progressbar> for the refreshing of the playlist <tree>, but this would steal cpu, and Pmusic is aready using enough cpu-power.
The idea to solve this is hopefully simple:
<input file> is not in use by <progressbar> and could contain a value used in <action>if value refresh:PLAYLIST</action>. In other words; if <input file> contains 'refreshplaylist' (or whatever value) the playlist should be refreshed. Like this one progressbar could be used as a refresh-hub, and gtkdialog would be useful for BIG projects.
The very best would be if the <input file> could hold several values and the <action> activates if one of the values matches. This would make it possible to refresh several widgets, - or just one of them...
3.) C H E C K B O X
Pmusic 2 is close to beta-stage, but still there is one thing that is holding me back from freezing the new graphical theme-standard. You have worked alot with improving the pixmaps in gtkdialog. Still, I am not able to use the <draw-indicator="false"> for <checkbox> with only showing a pixmap (no label). Most audio-players uses only icons on the checkboxes for 'loop' and 'shuffle'. This is not a big thing for me, but I have to decide before I announce the grapical theme-standard for Pmusic 2 as final.
Thanks a lot for you work
Sigmund
There are a number of ways to move windows though, which might improve your experience a little
http://www.murga-linux.com/puppy/viewto ... 059#169059
http://www.murga-linux.com/puppy/viewto ... 059#169059
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
A quick question about the GtkDialog <notebook> widget.
I see multiple entries in xerrs.log when using the mouse wheel to switch between tabs of a gtkdialog GUI constructed with the <notebook> widget.
For example, using the mouse wheel to switch tabs in 'Puppy Event Manager' will quickly fill xerrs.log with the following:
I see multiple entries in xerrs.log when using the mouse wheel to switch between tabs of a gtkdialog GUI constructed with the <notebook> widget.
For example, using the mouse wheel to switch tabs in 'Puppy Event Manager' will quickly fill xerrs.log with the following:
Code: Select all
(gtkdialog3:3333): Gtk-CRITICAL **: gtk_widget_is_ancestor: assertion `ancestor != NULL' failed
(gtkdialog3:3333): Gtk-CRITICAL **: gtk_widget_is_ancestor: assertion `ancestor != NULL' failed
(gtkdialog3:3333): Gtk-CRITICAL **: gtk_widget_is_ancestor: assertion `ancestor != NULL' failed
(gtkdialog3:3333): Gtk-CRITICAL **: gtk_widget_is_ancestor: assertion `ancestor != NULL' failed
(gtkdialog3:3333): Gtk-CRITICAL **: gtk_widget_is_ancestor: assertion `ancestor != NULL' failed
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
Hi Sigmund
1.) H O T K E Y S
GTK+ disables the accelerator with the menuitem.
2.) P R O G R E S S B A R
Sounds to me like you need a proper timer widget like the one described here -> http://code.google.com/p/gtkdialog/issues/detail?id=15. I'm working on the spinbutton widget at the moment but I can add the timer widget pretty easily if you want me to.
3.) C H E C K B O X
I can add one of these (togglebutton widget) equivalent to our existing button i.e. with label/stock/icon/pixmap but it'll toggle. If you need this widget as soon as possible then it could be done by the weekend.
@radky: I get that too. Just note if for the moment.
Regards,
Thunor
1.) H O T K E Y S
GTK+ disables the accelerator with the menuitem.
2.) P R O G R E S S B A R
Sounds to me like you need a proper timer widget like the one described here -> http://code.google.com/p/gtkdialog/issues/detail?id=15. I'm working on the spinbutton widget at the moment but I can add the timer widget pretty easily if you want me to.
3.) C H E C K B O X
I can add one of these (togglebutton widget) equivalent to our existing button i.e. with label/stock/icon/pixmap but it'll toggle. If you need this widget as soon as possible then it could be done by the weekend.
@radky: I get that too. Just note if for the moment.
Regards,
Thunor
If the timer widget will use less cpu than than a <progressbar> it could be a solution.thunor wrote:2.) P R O G R E S S B A R
Sounds to me like you need a proper timer widget like the one described here -> http://code.google.com/p/gtkdialog/issues/detail?id=15. I'm working on the spinbutton widget at the moment but I can add the timer widget pretty easily if you want me to.
In the Puppy world we should never rush . Please consider it as a suggestion, and do what you feel like. I will sure use a toggle-button if it exist. - If not, I will use the already working checkbox. I can release the Pmusic beta and make a note about the not finished theme-standard.thunor wrote:3.) C H E C K B O X
I can add one of these (togglebutton widget) equivalent to our existing button i.e. with label/stock/icon/pixmap but it'll toggle. If you need this widget as soon as possible then it could be done by the weekend.
Sigmund
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
Added spinbutton widget
The widget reference is available here.
Updated 2011-08-10 16:34 to illustrate that it's effectively an entry widget with an attached h/vscale widget.
You can see in the terminal that spb1 executes action functions at start-up and this is due to GTK+ emitting both "changed" and "value-changed" signals on application of the "digits" property. Just to note that it's GTK+ doing this on widget realization and not Gtkdialog so I'm not in a position to do anything about it.
<spinbutton> widget example:
Regards,
Thunor
The widget reference is available here.
Updated 2011-08-10 16:34 to illustrate that it's effectively an entry widget with an attached h/vscale widget.
- The default signal is "value-changed", emitted when the range value changes.
- The "changed" signal is emitted when typing into the entry.
- The "activate" signal is emitted when the user activates the entry with the Enter key.
- "range-min", "range-max", "range-step" and "range-value" are custom tag attributes that accept double precision floating point numbers (the GTK+ "digits" property specifies the number of decimal places that are displayed within the value).
- Use either the "range-value" custom tag attribute, the <default> directive, the <input> directive or the <input file> directive to set the spinbutton's value.
- Use the custom tag attribute block-function-signals/block_function_signals="true/yes/1" if you want to isolate signals originating from user widget manipulation from the refresh function.
You can see in the terminal that spb1 executes action functions at start-up and this is due to GTK+ emitting both "changed" and "value-changed" signals on application of the "digits" property. Just to note that it's GTK+ doing this on widget realization and not Gtkdialog so I'm not in a position to do anything about it.
<spinbutton> widget example:
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>
<input file stock="'$2'"></input>
<action>echo "'"$4"' spb'$1'"</action>
<action type="'"$3"'">spb'$1'</action>
</button>'
}
function funcspbCreate() {
echo '<variable>spb'$1'</variable>
<visible>enabled</visible>
<output file>outputfile</output>
<action>echo "spb'$1' action for default signal triggered"</action>
<action signal="value-changed">echo "spb'$1' changed to $spb'$1'"</action>
<action signal="changed">echo "spb'$1' typing within the entry detected"</action>
<action signal="activate">echo "spb'$1' Enter key-press detected"</action>
<action signal="primary-icon-press">echo "spb'$1' primary icon press detected"</action>
<action signal="primary-icon-release">echo "spb'$1' primary icon release detected"</action>
<action signal="secondary-icon-press">echo "spb'$1' secondary icon press detected"</action>
<action signal="secondary-icon-release">echo "spb'$1' secondary icon release detected"</action>
</spinbutton>'
}
if [ ! -f inputfile ]; then echo "0.9881" > inputfile; fi
export MAIN_DIALOG='
<window title="spbSpinButton" resizable="false">
<vbox>
<frame spinbutton widget>
<hbox border-width="20" spacing="20">
<vbox>
<spinbutton update-policy="1" wrap="true">
<default>20</default>
<input>echo 4</input>
'"$(funcspbCreate 0)"'
<hbox>
'"$(funcbtnCreate 0 gtk-no disable Disabling)"'
'"$(funcbtnCreate 0 gtk-yes enable Enabling)"'
'"$(funcbtnCreate 0 gtk-refresh refresh Reloading)"'
'"$(funcbtnCreate 0 gtk-save save Saving)"'
</hbox>
<hseparator></hseparator>
<spinbutton block-function-signals="true" digits="4"
range-min="0" range-max="1" range-step="0.01"
tooltip-text="block-function-signals='"'true'"'">
<input file>inputfile</input>
'"$(funcspbCreate 1)"'
<hbox>
'"$(funcbtnCreate 1 gtk-no disable Disabling)"'
'"$(funcbtnCreate 1 gtk-yes enable Enabling)"'
'"$(funcbtnCreate 1 gtk-refresh refresh Reloading)"'
'"$(funcbtnCreate 1 gtk-save save Saving)"'
</hbox>
</vbox>
<vseparator></vseparator>
<vbox width-request="100">
<spinbutton range-value="44" editable="false">
'"$(funcspbCreate 2)"'
<hseparator></hseparator>
<spinbutton range-value="33" xalign="1" primary-icon-name="gnumeric"
primary-icon-tooltip-markup="<span fgcolor='"'darkred'"'><b>primary-icon</b></span>-<i>tooltip</i>-<u>markup</u>">
'"$(funcspbCreate 3)"'
<hseparator></hseparator>
<spinbutton range-value="56" secondary-icon-stock="gtk-about"
secondary-icon-tooltip-markup="<span fgcolor='"'darkblue'"'><b>secondary-icon</b></span>-<i>tooltip</i>-<u>markup</u>">
'"$(funcspbCreate 4)"'
<hseparator></hseparator>
<spinbutton range-min="0" range-max="255" range-step="8" range-value="123"
xalign="0.5" max-length="3" progress-fraction="0.6">
'"$(funcspbCreate 5)"'
</vbox>
</hbox>
</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 Fri 12 Aug 2011, 13:34, edited 6 times in total.
I am picturing spinbutton used in combination with toggle.
Instead of 4 buttons of "Enable", "Disable", "Refresh", and "Save",
there would be 3 buttons.
The "Disable" button with icon would be shown and when clicked on besides disabling the entry box, would change to a "Enable button with icon".
Each time it was clicked that button would change to it's opposite button and also change to enable or disable the entry box.
It would allow making a smaller application window that still functioned as it should.
Instead of 4 buttons of "Enable", "Disable", "Refresh", and "Save",
there would be 3 buttons.
The "Disable" button with icon would be shown and when clicked on besides disabling the entry box, would change to a "Enable button with icon".
Each time it was clicked that button would change to it's opposite button and also change to enable or disable the entry box.
It would allow making a smaller application window that still functioned as it should.
Wouldn't a checkbox normally be used in that situation?
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
disciple,
If you have the latest version of gtkdialog from thunor and have ran the spinbutton example, you might get more insight as to what I am saying.
I update gtkdialog3 with thunor's latest each time he shows us a new example as often an update of gtkdialog3 is needed to have the example work properly.
If you have the latest version of gtkdialog from thunor and have ran the spinbutton example, you might get more insight as to what I am saying.
I update gtkdialog3 with thunor's latest each time he shows us a new example as often an update of gtkdialog3 is needed to have the example work properly.
Are you thinking of http://www.murga-linux.com/puppy/viewto ... 870#548870?
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
Maybe there's something I'm missing about what you're asking, but Argolance's example I linked to is for a tree widget. Argolance was looking for help because it had a problem if you clicked on an item and didn't drag it, and 8-bit posted a link to a workaround for that problem using getcurpos http://www.murga-linux.com/puppy/viewto ... 651#549651
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
Ah, sorry - you haven't edited your last post, have you?
I thought you said you were not talking about your example of moving items in a list widget. But you didn't say that - I must have imagined it.
I thought you said you were not talking about your example of moving items in a list widget. But you didn't say that - I must have imagined it.
I think I was missing this bit:disciple wrote:Maybe there's something I'm missing about what you're asking
8-bit's example does not use gtk-options. Unless I'm misunderstanding what "gtk-options" means, of course.zigbert wrote:using gtk-options
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
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
The GTK+ property is "reorderable".zigbert wrote:...moving items inside a <tree> widget...using gtk-options.
Regards,
Thunor
Ah yes, "reorderable".
I think this operation needs a tooltip to go with it. I remember struggling with trying to move an item up and down a list and constantly ending up with placing it as a subheading instead.
The trick is after highlighting an item, drag it to the right and keeping the mouse button down move the item up and down and watch for a line under the item where you wish it placed.
Regards,
s
I think this operation needs a tooltip to go with it. I remember struggling with trying to move an item up and down a list and constantly ending up with placing it as a subheading instead.
The trick is after highlighting an item, drag it to the right and keeping the mouse button down move the item up and down and watch for a line under the item where you wish it placed.
Regards,
s
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
Hi seasideseaside wrote:I remember struggling with trying to move an item up and down a list and constantly ending up with placing it as a subheading instead.
I researched this a while back and I couldn't stop the branches from appearing when dragging-and-dropping onto existing rows. What I discovered was that Gtkdialog's tree widget is a GtkTreeView using the GtkTreeStore model which is "a tree-like data structure", whereas -- I'm assuming as I haven't tested it yet -- a GtkTreeView using the GtkListStore model implementing "a list-like data structure" may have been more appropriate. Maybe there was a reason why the tree-like structure was chosen over the list-like structure.
Regards,
Thunor