#!/bin/bash
export TEXTDOMAIN=pmusic
$APPDIR/func -reset_gtk
[ "$1" != "-txt1_file" ] && echo "$TXT1" > $WORKDIR/box_ok_txt1
[ -z "$IMG" ] && IMG="dialog-error"
[ -z "$FRAME" ] && FRAME="Error"
[ "$HEADING" ] && $APPDIR/func_svg -heading "$HEADING"

S="
<window icon-name=\"pmusic\" title=\"pMusic\" allow-grow=\"false\">
 <vbox>"
  [ "$HEADING" ] && S=$S'
  <vbox space-expand="false" space-fill="false">
   <hbox spacing="0" height="75" scrollable="true" space-expand="true" space-fill="true" vscrollbar-policy="2" hscrollbar-policy="2">
    <eventbox name="svgheading" space-expand="true" space-fill="true">
     <hbox space-expand="true" space-fill="true">
      <text space-expand="true" space-fill="true"><label>""</label></text>
      <vbox homogeneous="true" space-expand="false" space-fill="false">
       <vbox>
        <pixmap icon_size="6"><input file stock="gtk-'$IMG'"></input></pixmap>
       </vbox>
      </vbox>
     </hbox>
    </eventbox>
   </hbox>
  </vbox>'
  S=$S"<frame $FRAME>"
   [ ! "$HEADING" ] && S=$S'<pixmap icon_size="6"><input file stock="gtk-'$IMG'"></input></pixmap>'
   S=$S"<text use-markup=\"true\" selectable=\"true\" can-focus=\"false\"><input file>$WORKDIR/box_ok_txt1</input></text>"
   [ "$TXT2" ] && S=$S'<text use-markup="true" selectable="true" can-focus="false"><label>"'$TXT2'"</label></text>'
  S=$S"</frame>
  <hbox>
   <button can-default=\"true\" has-default=\"true\" use-stock=\"true\">
    <input file stock=\"gtk-ok\"></input>
    <label>$(gettext 'Ok')</label>
   </button>
  </hbox>
 </vbox>
</window>"

export ok_box="$S"
$GTKDIALOG -p ok_box --center
TXT1=""; TXT2=""; IMG=""; FRAME="" #reset to avoid alien values in next box