Author |
Message |
don570

Joined: 10 Mar 2010 Posts: 4988 Location: Ontario
|
Posted: Wed 21 Aug 2013, 15:45 Post subject:
|
|
When you create a button to do an action you can also
set how the exit variable is set. For instance
<action>exit:EXIT</action> sets the exit variable to "EXIT"
When you run your script in the terminal the variable is printed.
(a nice feature of terminal )
Code: | funcbtnType0Create3() {
echo '<button image-position="'$1'" use-stock="true" tooltip-text="'$(gettext 'Relaunch Bulldog Finder')'">
<input file stock="gtk-ok"></input>
<label>"'$(gettext 'Relaunch')'"</label>
<action>bulldog-finder "$FPATH" &</action>
<action>exit:EXIT</action>
</button>' |
Then after gtkdialog has run you can put a line that can
decide what is done next . Here's an example in my bulldog-finder
program.
Code: | for STATEMENTS in $($GTKDIALOG -c -p SETTINGS); do
eval $STATEMENTS
done
IFS=$I
if [ "$EXIT" = "EXIT" ] || [ "$EXIT" = "abort" ];then # delete temp
rm -rf $TEMPDIR
exit 0
fi |
In my example I do a deletion , in your case you would want to launch
gtkdialog again
|
Back to top
|
|
 |
simargl7
Joined: 05 Oct 2013 Posts: 18
|
Posted: Sat 19 Oct 2013, 05:29 Post subject:
|
|
Will there be stable Gtk3 based version soon?
In Gtk 3.10 icons from menus are removed without option for user to enable them, Gtk.Stock is deprecated. Icons on menus and buttons must be explicitly added by application's developer.
|
Back to top
|
|
 |
don570

Joined: 10 Mar 2010 Posts: 4988 Location: Ontario
|
Posted: Sat 19 Oct 2013, 16:06 Post subject:
|
|
Thunor has looked into a GTK3 version but he
doesn't seem to feel there's a high priority.
________________________________________-
|
Back to top
|
|
 |
jfi
Joined: 15 Nov 2013 Posts: 1
|
Posted: Fri 15 Nov 2013, 17:47 Post subject:
memory leak? |
|
Am I doing this wrong or is there a memory leak in gtkdialog?
I ran a gtkdialog script that I'm working on for a day. After about 8 hours it ran out of RAM (there wasn't very much available to start with). The script was sitting idle all day only updating clock display twice a second so I tried removing the clock. Gtkdialog process stopped growing.
Then I narrowed it down to this script that just updates date and time:
Code: |
#!/bin/bash
GTKDIALOG=gtkdialog
MAIN_DIALOG='
<window title="memory leak test">
<vbox>
<text use-markup="true">
<variable>TIMEDISPLAY</variable>
<input>date +%H:%M:%S</input>
</text>
<text>
<variable>DATEDISPLAY</variable>
<input>date +%A\ %-d.%m.%Y</input>
</text>
<timer milliseconds="true" interval="50" visible="false">
<action>clear:TIMEDISPLAY</action>
<action>refresh:TIMEDISPLAY</action>
<action>clear:DATEDISPLAY</action>
<action>refresh:DATEDISPLAY</action>
</timer>
</vbox>
</window>
'
export MAIN_DIALOG
$GTKDIALOG --program=MAIN_DIALOG
|
and watched it grow:
Code: | chmod u+x leaktest
./leaktest&
while [ 1 ]; do date; ps -C "gtkdialog" u; sleep 10; done |
I tried this under Ubuntu 10.04 Lucid Lynx (x86_64 desktop) and an A13-OLinuXino-WIFI board running Debian Wheezy (armhf). Bash versions are 4.1.5 for the desktop and 4.2.20 for the arm board.
I tried gtkdialog 0.8.3 tarball on both platforms and on desktop I also tried svn rev 514. All kept growing.
P.S. Those "clear" actions were added for testing, it leaks without them as well. The timer was originally 500 ms, I sped it up to maybe get it to leak more.
|
Back to top
|
|
 |
don570

Joined: 10 Mar 2010 Posts: 4988 Location: Ontario
|
Posted: Sat 16 Nov 2013, 16:49 Post subject:
|
|
Additional info: Thunor did a timer example. The shell may be important.
Thunor used the bash 3.0 shell.
Ubuntu uses dash.
http://code.google.com/p/gtkdialog/source/browse/trunk/examples/timer/timer_advanced?spec=svn493&r=493
________________________________________
|
Back to top
|
|
 |
brokenman
Joined: 20 Oct 2011 Posts: 25
|
Posted: Wed 12 Feb 2014, 08:57 Post subject:
hide and show |
|
I am trying to hide a button on a 'notebook' page when the page is shown. The page has the an entry widget and radiobutton widgets (as well as the button). I can't seem to get the button to hide using signal="show" for any widgets. It hides OK if i put the action into a radiobutton 'if true' action.
Any ideas how I can realize this?
PS: Is there a donation system for gtkdialog?
Code: | <vbox margin="10">
<hbox>
<text><label>Select a file: </label></text>
<entry fs-action="file" editable="false" block-function-signals="true">
<variable>SELPKG</variable>
</entry>
<button>
<label>Select</label>
<action function="fileselect">SELPKG</action>
<action>echo $SELPKG</action>
</button>
</hbox>
<radiobutton>
<label>Example</label>
</radiobutton>
<button>
<label>Vanish</label>
<variable>butDownload</variable>
</button>
</vbox> |
Last edited by brokenman on Wed 12 Feb 2014, 09:06; edited 1 time in total
|
Back to top
|
|
 |
dejan555

Joined: 30 Nov 2008 Posts: 2805 Location: Montenegro
|
Posted: Wed 12 Feb 2014, 09:04 Post subject:
|
|
Did you try: <button visible="false"> ?
_________________ puppy.b0x.me stuff mirrored HERE or HERE
|
Back to top
|
|
 |
brokenman
Joined: 20 Oct 2011 Posts: 25
|
Posted: Wed 12 Feb 2014, 09:09 Post subject:
|
|
I want the button to be visible until a certain 'notebook' page is shown. So what I need is something similar to an "onshow" parameter for one of the widgets. When the widget is shown, the button vanishes. The original state of the button should be visible so this attribute is no good for me. Thanks.
Essentially I would like the button in the above code to be invisible when the script is run, but done so without using anything within the button widget itself.
|
Back to top
|
|
 |
brokenman
Joined: 20 Oct 2011 Posts: 25
|
Posted: Wed 12 Feb 2014, 09:17 Post subject:
|
|
Ok I got it. Since the button I want to vanish is created after the other widgets, they can't do what I want since the button doesn't exist at the point when they are created. I need to have a widget somewhere in the code AFTER the button I want to vanish. Makes sense.
Code: | <vbox margin="10">
<hbox>
<text><label>Select a file: </label></text>
<entry fs-action="file" editable="false" block-function-signals="true">
<variable>SELPKG</variable>
</entry>
<button>
<label>Select</label>
<action function="fileselect">SELPKG</action>
<action>echo $SELPKG</action>
</button>
</hbox>
<radiobutton>
<label>Example</label>
<action>if true show:butDownload</action>
</radiobutton>
<radiobutton>
<label>Example2</label>
<action>if true hide:butDownload</action>
</radiobutton>
<button visible="true">
<label>Vanish</label>
<variable>butDownload</variable>
</button>
<statusbar has-resize-grip="false">
<variable>stb0</variable>
<input>echo statusbar</input>
<action signal="show">hide:butDownload</action>
</statusbar>
</vbox> |
|
Back to top
|
|
 |
dejan555

Joined: 30 Nov 2008 Posts: 2805 Location: Montenegro
|
Posted: Wed 12 Feb 2014, 09:51 Post subject:
|
|
Not sure if I understand but why not put it inside one frame of notebook if that's only where it should be shown instead after notebook code?
_________________ puppy.b0x.me stuff mirrored HERE or HERE
|
Back to top
|
|
 |
brokenman
Joined: 20 Oct 2011 Posts: 25
|
Posted: Wed 12 Feb 2014, 21:21 Post subject:
|
|
I should have explained more clearly, sorry. There is a set of buttons at the bottom of the application. They are static and exist to move from one notebook page to the next. Like a back button. While the notebook pages may change, these buttons stay where they are all the time.
For this reason they are the last widgets to be drawn (last in the code) and as such I believe the widgets above this can not affect them with a signal="show" action. I have found a solution in any case. Thanks.
BTW, I would still like to know about any donation options Thunor. I get a lot of mileage out of gtkdialog. Many thanks for your work.
|
Back to top
|
|
 |
tele1234567891
Joined: 15 Nov 2014 Posts: 13
|
Posted: Tue 08 Sep 2015, 08:34 Post subject:
|
|
Hi!
1. I have problem with gtkdialog apps,
Because when I
open gtkdialog app running (
( I click button and this doing long script)
, I see this app
then I open on full screen for example firefox
and gtkdialog app is empty.
When gdtkdialog app finished script, I see all good
Is the same problem on Puppy Linux?
I use PCLinuxOS 64bit Mate.
2. I have problems with buttons,
http://murga-linux.com/puppy/viewtopic.php?p=862856#862856
files v5
When I paste
Code: | <action>FuncAskInstall</action> |
buttons not working correct after click,
when I removed function buttons working good.
Code: | <button sensitive="'"$SensitiveKdeInstall"'">
<label>Kde Install</label>
<variable>KdeInststall</variable>
<input file icon="bottom"></input>
<action>echo "You pressed button Kde Install"</action>
<action>GRAPHIC=KDE; ACTION=Install; echo -e "$GRAPHIC\n$ACTION" > /tmp/gdi/action</action>
<action>FuncAskInstall</action>
<action function="'Disable'">'KdeInstall'</action>
<action function="'Enable'">'KdeUninstall'</action>
<action>ln -sf `pwd`/green_ball.png "$TMPDIR"/StateBallKde.png</action>
<action function="refresh">BallKde</action>
</button>
<button sensitive="'"$SensitiveKdeUninstall"'">
<label>Kde Uninstall</label>
<variable>KdeUninstall</variable>
<input file icon="editdelete"></input>
<action>echo "You pressed button Kde Uninstall."</action>
<action>GRAPHIC=KDE; ACTION=Uninstall; echo -e "$GRAPHIC\n$ACTION" > /tmp/gdi/action</action>
<action>FuncAskUninstall</action>
<action function="'Enable'">'KdeInstall'</action>
<action function="'Disable'">'KdeUninstall'</action>
<action>ln -sf `pwd`/red_ball.png "$TMPDIR"/StateBallKde.png</action>
<action function="refresh">BallKde</action>
</button> |
3. I have problems with variables
from above code FuncAskUninstall and FuncAskUninstall
there are files funtions,
this functions open window with warning ( window is in next file )
Code: | $ ls
functions gdi.png test1.png WarningRoot*
gdi* green_ball.png WarningAskInstall* WindowAbout*
gdi.desktop red_ball.png WarningAskUninstall* |
Like this I created app:
click gdi button install -->function --> "WarningAskInstall" click Yes--> function
and when I added "WarningAskInstall" I can not export variable from button to function (or from functions file)
So I saved variables to file, and I skipped problem.
|
Back to top
|
|
 |
don570

Joined: 10 Mar 2010 Posts: 4988 Location: Ontario
|
Posted: Thu 19 Nov 2015, 20:44 Post subject:
|
|
I would check if your function FuncAskInstall is working correctly and is defined .
Replace the code in the function with something simple
as a test.
____________________________
|
Back to top
|
|
 |
TecnoGuy458
Joined: 26 Jan 2015 Posts: 124 Location: Ohio
|
Posted: Sat 21 Nov 2015, 13:25 Post subject:
want to stretch the width of a pixmap... |
|
I need to stretch a pixmap to the width of the dialog automatically.
reason: im making a little piano app in gtkdialog and would like the key number bar image i made to stretch to the size of the dialog. (automatically)
is this do-able and if so, how?
|
Back to top
|
|
 |
don570

Joined: 10 Mar 2010 Posts: 4988 Location: Ontario
|
Posted: Sat 21 Nov 2015, 13:34 Post subject:
|
|
I'm not sure. It's normally the inverse i.e. the window will automatically
resize to fit the widgets properly.
Here are three examples to study
http://gtkdialog.googlecode.com/svn/trunk/examples/pixmap/
______________________________________________
|
Back to top
|
|
 |
|