Gtkdialog Development
The latest gtkdialog has changed the behavior of the fileselect function. Before I go through all my scripts, I will ensure that this is intended behavior or an issue for gtkdialog.
The following code used to work, but now it fails because of the line <action>refresh:SEARCHPATHS</action> which is not necessary, and leads to no action of the fileseletion.
Could this be solved in gtkdialog to keep backwards compatibility, or should I update my scripts?
Regards
Sigmund
btw, what exactly does the -ltr mean?
The following code used to work, but now it fails because of the line <action>refresh:SEARCHPATHS</action> which is not necessary, and leads to no action of the fileseletion.
Code: Select all
<hbox>
<entry accept="directory">
<variable>SEARCHPATHS</variable>
<input>echo '$SEARCHPATHS'</input>
</entry>
<button>
<input file stock="gtk-open"></input>
<action type="fileselect">SEARCHPATHS</action>
<action>refresh:SEARCHPATHS</action>
</button>
</hbox>
Regards
Sigmund
btw, what exactly does the -ltr mean?
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
Investigating...zigbert wrote:The latest gtkdialog has changed the behavior of the fileselect function.
...
btw, what exactly does the -ltr mean?
Internationalisation: left-to-right and right-to-left writing.
Mick's menuitems are wrong as you're probably aware. I'll break the bad news to him when he wakes up
Regards,
Thunor
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
Sigmund
Unfortuntely it's not a complete working example so I'll have to guess what you are doing.
I think that you are using the shell variable $SEARCHPATHS at XML construction time to initialise the entry widget with saved data from a previous session.
Then you press the button to select a file which will be auto-inserted into the entry widget and then you refresh the entry widget with whatever value was in the shell variable $SEARCHPATHS at XML construction time!
It does what is expected, but the unnecessary refresh is wiping out the filename from the fileselect function.
Regards,
Thunor
Unfortuntely it's not a complete working example so I'll have to guess what you are doing.
I think that you are using the shell variable $SEARCHPATHS at XML construction time to initialise the entry widget with saved data from a previous session.
Then you press the button to select a file which will be auto-inserted into the entry widget and then you refresh the entry widget with whatever value was in the shell variable $SEARCHPATHS at XML construction time!
It does what is expected, but the unnecessary refresh is wiping out the filename from the fileselect function.
Regards,
Thunor
thunor,
run this from a terminal with the updated gtkdialog3.
enter a directory path and after clicking open and then click cancel twice. You will see that $SEARCHPATHS returns a null string.
Then try it with the original gtkdialog3 and you will see $SEARCHPATHS has a string.
run this from a terminal with the updated gtkdialog3.
enter a directory path and after clicking open and then click cancel twice. You will see that $SEARCHPATHS returns a null string.
Then try it with the original gtkdialog3 and you will see $SEARCHPATHS has a string.
Code: Select all
#! /bin/bash
export MAIN_DIALOG='
<hbox>
<entry accept="directory">
<variable>SEARCHPATHS</variable>
<input>echo '$SEARCHPATHS'</input>
</entry>
<button>
<input file stock="gtk-open"></input>
<label>open</label>
<action type="fileselect">SEARCHPATHS</action>
<action>refresh:SEARCHPATHS</action>
</button>
<button cancel></button>
</hbox>
'
gtkdialog3 --program=MAIN_DIALOG
zigbert,
I may not have got everything right trying to create an executable script from your example, but I tried.
Anyway, since I kept a copy of the old gtkdialog3 and renamed it "old_gtkdialog3" in /usr/sbin all I had to do was change the gtkdialog3 at the end of the script to old_gtkdialog3 to check with the old version.
I may not have got everything right trying to create an executable script from your example, but I tried.
Anyway, since I kept a copy of the old gtkdialog3 and renamed it "old_gtkdialog3" in /usr/sbin all I had to do was change the gtkdialog3 at the end of the script to old_gtkdialog3 to check with the old version.
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
I now know why that worked, but I fixed it back r219.
There are some fundamental functions that were bugged (they weren't reentrant) and this resulted in iterating through a list of actions being prematurely terminated. In your example using the old gtkdialog3 0.7.20 Patriot Edition, the refresh action wouldn't get executed because the fileselect function would terminate the action list.
Place "<action>echo This fails to execute</action>" below the fileselect action and you'll see that now it gets executed but before it wouldn't. Making the functions reentrant stopped the corruption of the action list.
Regards,
Thunor
There are some fundamental functions that were bugged (they weren't reentrant) and this resulted in iterating through a list of actions being prematurely terminated. In your example using the old gtkdialog3 0.7.20 Patriot Edition, the refresh action wouldn't get executed because the fileselect function would terminate the action list.
Place "<action>echo This fails to execute</action>" below the fileselect action and you'll see that now it gets executed but before it wouldn't. Making the functions reentrant stopped the corruption of the action list.
Regards,
Thunor
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
Added tree widget support for inserting stock or theme icons from an input file
From issue 8.
Example:
Regards,
Thunor
From issue 8.
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
inputfilestockCreate() {
echo "gtk-dialog-authentication | | gtk-dialog-authentication | 2
gtk-dialog-error | | gtk-dialog-error | 2
gtk-dialog-info | | gtk-dialog-info | 2
gtk-dialog-question | | gtk-dialog-question | 2
gtk-dialog-warning | | gtk-dialog-warning | 2
gtk-info | | gtk-info | 2
gtk-new | | gtk-new | 2
gtk-save | | gtk-save | 2
gtk-undo | | gtk-undo | 2
gtk-redo | | gtk-redo | 2
gtk-open | | gtk-open | 2
gtk-about | | gtk-about | 2
gtk-add | | gtk-add | 2
gtk-apply | | gtk-apply | 2
gtk-bold | | gtk-bold | 2 " > inputfilestock
}
# NOTE: The following image names should hopefully represent physical
# files that exist upon your computer minus their paths and extensions,
# but if you find them to be missing then substitute them with something
# that you do have within /usr/share/icons or /usr/share/pixmaps.
inputfileiconCreate() {
echo "gimp | | gimp | 2
gnumeric | | gnumeric | 2
geany | | geany | 2
glade-3 | | glade-3 | 2
uget-icon | | uget-icon | 2
viewnior | | viewnior | 2
xarchive | | xarchive | 2
scribus | | scribus | 2
inkscape | | inkscape | 2
html | | html | 2
gz | | gz | 2
top | | top | 2
midori | | midori | 2
adblock | | adblock | 2
abiword | | abiword | 2 " > inputfileicon
}
inputfilestockCreate
inputfileiconCreate
export MAIN_DIALOG='
<window title="tree widget icons from input files" resizable="false">
<vbox>
<hbox>
<frame Stock icons from input file>
<tree>
<variable>tre0</variable>
<label>0 | 1 | 2</label>
<height>400</height><width>250</width>
<input file stock_column="0">inputfilestock</input>
</tree>
</frame>
<frame Theme icons from input file>
<tree>
<variable>tre1</variable>
<label>0 | 1 | 2</label>
<height>400</height><width>250</width>
<input file icon_column="0">inputfileicon</input>
</tree>
</frame>
</hbox>
<hbox homogeneous="true">
<button ok></button>
</hbox>
</vbox>
<action signal="hide">exit:Exit</action>
</window>
'
$GTKDIALOG --program=MAIN_DIALOG
Thunor
Last edited by thunor on Tue 30 Aug 2011, 21:13, edited 1 time in total.
Really? [ ]thunor wrote:[snip]
Mick's menuitems are wrong as you're probably aware. I'll break the bad news to him when he wakes up
Regards,
Thunor
Guess I'll see the right way when I get pmusic-2.0.1
Cheers!
Puppy Linux Blog - contact me for access
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
I'm not focusing primarily on you here OK, but I may as well illustrate how it is recommended to be implemented for the benefit of anyone and everyone.01micko wrote:Really? [ ]
Guess I'll see the right way when I get pmusic-2.0.1
This is your method:
Code: Select all
<menuitem icon="gtk-undo-ltr" accel-key="0x07a" accel-mods="4">
<label>'$LOC118'</label>
<action>. '$APPDIR'/func -undo</action>
<action>refresh:PLAYLIST</action>
</menuitem>
<menuitem icon="gtk-redo-ltr" accel-key="0x079" accel-mods="4">
<label>'$LOC119'</label>
<action>. '$APPDIR'/func -redo</action>
<action>refresh:PLAYLIST</action>
</menuitem>'
Code: Select all
<menuitem stock="gtk-undo" label="'$LOC118'" accel-key="0x07a" accel-mods="4">
<action>. '$APPDIR'/func -undo</action>
<action>refresh:PLAYLIST</action>
</menuitem>
<menuitem stock="gtk-redo" label="'$LOC119'" accel-key="0x079" accel-mods="4">
<action>. '$APPDIR'/func -redo</action>
<action>refresh:PLAYLIST</action>
</menuitem>'
Actually I think that this qualifies as a Gtkdialog Tip
Regards,
Thunor
- Attachments
-
- 01micko-menuitem-icon-issue.gif
- I added underscores to demonstrate that "use-underline" is automatically true
- (11.06 KiB) Downloaded 1457 times
It's all good.. every bit I learn is great. ..and thanks for the explanation.I'm not focusing primarily on you here OK, but I may as well illustrate how it is recommended to be implemented for the benefit of anyone and everyone.
Cheers
Puppy Linux Blog - contact me for access
I have updated some tricks (and removed some not needed anymore) in the tips thread. Also linked more to Thunors pages.
I tested the new notebook example which has this VERY interesting feature to control the tabs from external wigdets like buttons... With tabs hidden, it really looks like a dynamic gui.But when running the example here, the tabs still shows up.
Sigmund
I tested the new notebook example which has this VERY interesting feature to control the tabs from external wigdets like buttons... With tabs hidden, it really looks like a dynamic gui.
Code: Select all
<notebook show-tabs="false" show-border="false">
Sigmund
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
Guys,
I'm pissed off. It is nice that gtkdialog is getting developed, but I was caught unawares.
Ok, there was the bug with password-entry box having invisible text, only two apps needed to be fixed. Although, I still don't see why the original syntax couldn't have continued to be supported.
I released Wary Puppy 5.1.4 a couple of days ago, then yesterday I discovered that Pfind is broken, as the directory-select dialog is broken. I informed zigbert, and he finds the bug and then informs me that this means Pburn, Pmirror and Pbackup are also broken.
Ok, I will bring out an emergency upgrade to Wary Puppy, but I'm not happy.
The 'common' repo currently has gtkdialog revision 224, and that's it. I'm not going to upgrade. If you bring out strict bugfixes for that, fine. Any further development should be in a separate development thread. All apps that are to be publicaly released should be tested to work on the reference gtkdialog as available in the 'common' repo at ibiblio.org.
I don't intend to upgrade gtkdialog again unless there is a very good reason to do so, nor will I upgrade any more apps that use gtkdialog unless they are tested against that version of gtkdialog.
I'm pissed off. It is nice that gtkdialog is getting developed, but I was caught unawares.
Ok, there was the bug with password-entry box having invisible text, only two apps needed to be fixed. Although, I still don't see why the original syntax couldn't have continued to be supported.
I released Wary Puppy 5.1.4 a couple of days ago, then yesterday I discovered that Pfind is broken, as the directory-select dialog is broken. I informed zigbert, and he finds the bug and then informs me that this means Pburn, Pmirror and Pbackup are also broken.
Ok, I will bring out an emergency upgrade to Wary Puppy, but I'm not happy.
The 'common' repo currently has gtkdialog revision 224, and that's it. I'm not going to upgrade. If you bring out strict bugfixes for that, fine. Any further development should be in a separate development thread. All apps that are to be publicaly released should be tested to work on the reference gtkdialog as available in the 'common' repo at ibiblio.org.
I don't intend to upgrade gtkdialog again unless there is a very good reason to do so, nor will I upgrade any more apps that use gtkdialog unless they are tested against that version of gtkdialog.
[url]https://bkhome.org/news/[/url]
@zigbert
Hi
in the example of Thunor only primary tabs are hidden
A simpler example hidden tabs
Hi
in the example of Thunor only primary tabs are hidden
A simpler example hidden tabs
Code: Select all
#!/bin/bash
export MAIN_DIALOG='<vbox>
<notebook show_tabs="false" page="0" labels="One|Two|Three|Four">
<!-- Tab1 -->
<hbox>
<text label="This is page 0"></text>
</hbox>
<!-- Tab2 -->
<hbox>
<text label="This is page 1"></text>
</hbox>
<!-- Tab3 -->
<hbox>
<text label="This is page 2"></text>
</hbox>
<!-- Tab4 -->
<hbox>
<text label="This is page 3"></text>
</hbox>
<variable>tab_0</variable>
<input file>inputfile</input>
</notebook>
<hbox>
<vbox>
<button image-position="0" tooltip-text="View tab 0">
<label>View tab 0</label>
<input file stock="gtk-connect"></input>
<action>echo 0 > inputfile</action>
<action>refresh:tab_0</action>
</button>
<button image-position="0" tooltip-text="View tab 1">
<label>View tab 1</label>
<input file stock="gtk-connect"></input>
<action>echo 1 > inputfile</action>
<action>refresh:tab_0</action>
</button>
<button image-position="0" tooltip-text="View tab 2">
<label>View tab 2</label>
<input file stock="gtk-connect"></input>
<action>echo 2 > inputfile</action>
<action>refresh:tab_0</action>
</button>
<button image-position="0" tooltip-text="View tab 3">
<label>View tab 3</label>
<input file stock="gtk-connect"></input>
<action>echo 3 > inputfile</action>
<action>refresh:tab_0</action>
</button>
</vbox>
<vscale height_request="200" range-min="0" range-max="3" value-pos="0" tooltip-text="vscale change d'\''onglet">
<variable>hsc0</variable>
<output file>inputfile</output>
<action>save:hsc0</action>
<action>refresh:tab_0</action>
</vscale>
</hbox>
</vbox>'
export MAIN_DIALOG="$(sed 's@<!--.*-->@@g' <<<"$MAIN_DIALOG")";
gtkdialog3 --program=MAIN_DIALOG
exit 0
You have no need to be. This is a development release, and you are the one to choose to include this code. I find it rather ambitious to include 'new' libs/backends in bugfix releases.BarryK wrote:Guys,
I'm pissed off.
I have not used any new gtkdialog features in my scripts else of Pmusic 2 and the latest pprocess (because of much better performance). My intentions is to start using 0.7.21 at once it is released as stable.
Best wishes
Sigmund
Very important. The directory-select dialog is not broken. In fact it is now working. My way of adding too much lines into the xml-code was ignored by gtkdialog-0.7.20. Now my dirty lines actually executes and *ucks up the result.BarryK wrote:yesterday I discovered that Pfind is broken, as the directory-select dialog is broken.
MY FAULT
I think we should encourage Thunors initiative... which could give Puppy a boost.
Sigmund