Why does not close the dialog? [solved]

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
der-schutzhund
Posts: 1045
Joined: Mon 26 Nov 2007, 22:07
Location: Blomberg / Germany

Why does not close the dialog? [solved]

#1 Post by der-schutzhund »

Hello together,

the following code is at the end of a Bashscript.
Can someone tell me why the dialog window does not close, when I press the "Save" button?
Pressing "OK" and "cancel", the dialog closes normally!

Code: Select all

.
.
export MAIN_DIALOG='
  <window title="Oberfläche geändert..">
  <vbox>
  <text><label>Achtung! Geänderte Oberfläche jetzt speichern?</label></text>
  <hbox>
   <button>
   <label>save</label>
   <action>cp /usr/local/variomen/data/iconsetup_TEMP '$1' &</action>
   </button>
   <button ok></button>
   <button cancel></button>
  </hbox>
 </vbox>
 </window>'

if [ "$vorlang" != "$templang" ]
then
 gtkdialog --program=MAIN_DIALOG
 unset MAIN_DIALOG
fi

exit 0 
Greetings

Wolfgang
Last edited by der-schutzhund on Mon 28 Jan 2013, 21:23, edited 1 time in total.

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#2 Post by SFR »

Try this:

Code: Select all

<action>cp /usr/local/variomen/data/iconsetup_TEMP '$1' &</action>
<action type="exit">save_pressed</action>
The 'save_pressed' phrase can be replaced with something else.
It will be returned in shell as:
EXIT="save_pressed"
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#3 Post by seaside »

der-schutzhund,

Unless the buttons have a "close" associated with them like "cancel" or "ok", the dialog stays open. Since created buttons can have any number of additional actions, it is very flexible.

In addition to the close action mentioned by SFR, you can do this

Code: Select all

<action>exit:save_pressed</action>
I haven't noticed any difference between the two methods.

Cheers,
s

der-schutzhund
Posts: 1045
Joined: Mon 26 Nov 2007, 22:07
Location: Blomberg / Germany

#4 Post by der-schutzhund »

Thank you very much for your help! It works!

Many greetings

Wolfgang

Post Reply