Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 02 Sep 2014, 20:02
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
GtkDialog - tips
Post new topic   Reply to topic View previous topic :: View next topic
Page 47 of 64 [949 Posts]   Goto page: Previous 1, 2, 3, ..., 45, 46, 47, 48, 49, ..., 62, 63, 64 Next
Author Message
zigbert


Joined: 29 Mar 2006
Posts: 5701
Location: Valåmoen, Norway

PostPosted: Sat 23 Jun 2012, 07:03    Post subject:  

disciple wrote:
A pity it can't refresh more often than once a second...
It can
Code:

<timer milliseconds="true" interval="200" visible="false">

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5701
Location: Valåmoen, Norway

PostPosted: Sat 23 Jun 2012, 07:12    Post subject:  

Mick
I have cut down the code to give a simple-as-possible example.
Main post updated
Code:
#!/bin/sh
export MSG="This is a test... I repeat: This is a test... "
export GTKBOX='
<vbox width-request="300">
 <text>
  <variable>MSG</variable>
  <input>echo -en "${MSG:2}${MSG:0:2}"</input>
 </text>
 <timer milliseconds="true" interval="200" visible="false">
  <action type="refresh">MSG</action>
 </timer>
</vbox>'
gtkdialog4 -p GTKBOX

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
disciple

Joined: 20 May 2006
Posts: 6430
Location: Auckland, New Zealand

PostPosted: Sat 23 Jun 2012, 08:00    Post subject:  

Cool!
_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3263
Location: Ontario

PostPosted: Tue 07 Aug 2012, 18:43    Post subject: restrain combobox  

Two scripts AVAILABLE

I posted two scripts in programming section of forums
to demonstrate how to restrain the combobox

From a list of audio players , only the installed
audio players are shown.




________________________________________________________
Back to top
View user's profile Send private message 
walter leonardo


Joined: 10 Dec 2009
Posts: 229

PostPosted: Fri 07 Sep 2012, 00:59    Post subject:  Help with gtk-dialog  

Could you help me with mine program electricity for puppy linux I'm doing. I want to do the calculations by pressing "enter" instead of pressing the button "calculate". Could you do that for me?. Now I send the files.
I'd also like to know how to make programs in a single window with multiple tabs, each program in each tab.
vatiohms.tar.gz
Description 
gz

 Download 
Filename  vatiohms.tar.gz 
Filesize  1 KB 
Downloaded  316 Time(s) 
Back to top
View user's profile Send private message 
smokey01


Joined: 30 Dec 2006
Posts: 1806
Location: South Australia

PostPosted: Fri 07 Sep 2012, 02:33    Post subject:  

Walter, to make tabs in a single window use the <notebook> command. The syntax can be found on the first page of this thread.

This should give you a clue how to use the enter key to accept input.

#! /bin/bash

export DIALOG='
<window title="Enter password" icon-name="gtk-dialog-question">
  <vbox>
    <hbox>
      <text>
        <label>Label:</label>
      </text>
      <entry activates-default="true">
        <variable>PASS0</variable>
      <visible>password</visible>
      </entry>
    </hbox>
    <hbox>
      <button cancel></button>
      <button can-default="true" has-default="true" use-stock="true">
        <label>gtk-ok</label>
      </button>
    </hbox>
  </vbox>
</window>
'

eval $(gtkdialog --program=DIALOG)
echo "$PASS0"

_________________
Puppy Software <-> Distros <-> Puppy Linux Tips
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5701
Location: Valåmoen, Norway

PostPosted: Fri 07 Sep 2012, 13:08    Post subject:  

To activate <entry> from enter-key you could use the 'activate' signal.

Code:
<entry>
<action signal="activate">command</action>
</entry>

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
walter leonardo


Joined: 10 Dec 2009
Posts: 229

PostPosted: Fri 07 Sep 2012, 19:51    Post subject:  Help with gtk-dialog  

Use the function of the enter key and if it works, but only in a "Calcular" button and I want to get all the buttons work in "calcular"

As you would?



Code:

#!/bin/bash
#Autor: Walter Leonardo Iñiguez
MAIN_DIALOG='
<window title="Programa VatiOhms">
<notebook page="0" labels=" Tab 1| Tab 2| Tab 3| Tab 4">       
<vbox>
  <frame  Calcular el Voltaje: V=I.R >
   <hbox>
     <text>
      <label>Ingrese Resistencia (Ohm):  </label>
     </text>
     <entry>
     <default>""</default>
      <variable>Resistencia</variable>
     </entry>
     <text>
      <label>o vatios</label>
     </text>
     <entry>
     <default>""</default>
      <variable>V</variable>
     </entry>
   </hbox>

   <hbox>
     <text>
      <label>Ingrese Corriente (Ampere):</label>
     </text>
     <entry activates-default="true">
     <default>""</default>
      <variable>Corriente</variable>
     </entry>
     <text>
      <label>o vatios</label>
     </text>
     <entry activates-default="true">
     <default>""</default>
      <variable>Val</variable>
     </entry>
   </hbox>

   <hbox>
     <text>
      <label>El voltaje es:                         </label>
     </text>
     <entry>
      <variable>Voltaje</variable>
      <input>echo "scale=6;$Resistencia*$Corriente" | bc</input>
      <input>echo "scale=6;$V/$Corriente" | bc</input>
      <input>echo "scale=6;sqrt($Val*$Resistencia)" | bc</input>
     </entry>
     <text>
      <label>Volts</label>
     </text>
   </hbox>

   <hbox>
     <button>
       <label>Borrar datos</label>
     <action type="clear">Voltaje</action><action type="clear">Resistencia</action><action type="clear">Corriente</action><action type="clear">V</action><action type="clear">Val</action>
     </button>
     <button can-default="true" has-default="true" use-stock="true">
      <label>Calcular</label>
      <action>refresh:Voltaje</action>
     </button>
   </hbox>
 </frame>
 
 
 <frame Calcular la Resistencia: R=V/I >
   <hbox>
     <text>
      <label>Ingrese Tensión (Volt):         </label>
     </text>
     <entry>
     <default>""</default>
      <variable>Volts</variable>
     </entry>
     <text>
      <label>o vatios</label>
     </text>
     <entry>
     <default>""</default>
      <variable>Va</variable>
     </entry>
   </hbox>

   <hbox>
     <text>
      <label>Ingrese Corriente (Ampere):</label>
     </text>
     <entry activates-default="true">
     <default>""</default>
      <variable>Amper</variable>
     </entry>
     <text>
      <label>o vatios</label>
     </text>
     <entry activates-default="true">
     <default>""</default>
      <variable>Vas</variable>
     </entry>
   </hbox>

   <hbox>
     <text>
      <label>La resistencia es:                 </label>
     </text>
     <entry>
      <variable>Resistor</variable>
      <input>echo "scale=3;$Volts/$Amper" | bc</input>
      <input>echo "scale=3;($Va/$Amper)/$Amper" | bc</input>
      <input>echo "scale=3;$Volts/($Vas/$Volts)" | bc</input>
     </entry>
     <text>
      <label>Ohms</label>
     </text>
   </hbox>

     <hbox>
      <button>
       <label>Borrar datos</label>
     <action type="clear">Resistor</action><action type="clear">Volts</action><action type="clear">Amper</action><action type="clear">Va</action><action type="clear">Vas</action>
     </button>
     <button can-default="true" has-default="true" use-stock="true">
      <label>Calcular</label>
      <action>refresh:Resistor</action>
     </button>
    </hbox>
   </frame>
 
 
 <frame Calcular la Corriente: I=V/R >
   <hbox>
     <text>
      <label>Ingrese Tensión (Volt):        </label>
     </text>
     <entry>
     <default>""</default>
      <variable>Tensio</variable>
     </entry>
     <text>
      <label>o vatios</label>
     </text>
     <entry>
     <default>""</default>
      <variable>Vac</variable>
     </entry>
   </hbox>

   <hbox>
     <text>
      <label>Ingrese Resistencia (Ohm): </label>
     </text>
     <entry activates-default="true">
     <default>""</default>
      <variable>Resisten</variable>
     </entry>
     <text>
      <label>o vatios</label>
     </text>
     <entry activates-default="true">
     <default>""</default>
      <variable>Vat</variable>
     </entry>
   </hbox>

   <hbox>
     <text>
      <label>La Corriente es:                  </label>
     </text>
     <entry>
      <variable>Corrient</variable>
      <input>echo "scale=6;$Tensio/$Resisten" | bc</input>
      <input>echo "scale=6;$Vat/$Tensio" | bc</input>
      <input>echo "scale=6;(sqrt($Vac*$Resisten))/$Resisten" | bc</input>
     </entry>
     <text>
      <label>Amperes</label>
     </text>
   </hbox>
   

    <hbox>
     <button>
       <label>Borrar datos</label>
     <action type="clear">Corrient</action><action type="clear">Tensio</action><action type="clear">Resisten</action><action type="clear">Vat</action><action type="clear">Vac</action>
     </button>
     <button can-default="true" has-default="true" use-stock="true">
      <label>Calcular</label>
      <action>refresh:Corrient</action>
     </button>
   </hbox>
 </frame>
 
 
 <frame Calcular los Vatios (Watts): W=I.V >
   <hbox>
     <text>
      <label>Ingrese Tensión (Volt):          </label>
     </text>
     <entry>
     <default>""</default>
      <variable>Tensione</variable>
     </entry>
     <text>
      <label>o resistencia</label>
     </text>
     <entry>
     <default>""</default>
      <variable>Vad</variable>
     </entry>
   </hbox>

   <hbox>
     <text>
      <label>Ingrese Corriente (Ampere): </label>
     </text>
     <entry activates-default="true">
     <default>""</default>
      <variable>Amperiore</variable>
     </entry>
     <text>
      <label>o resistencia</label>
     </text>
     <entry activates-default="true">
     <default>""</default>
      <variable>Vag</variable>
     </entry>
   </hbox>

   <hbox>
     <text>
      <label>Los Vatios son:                     </label>
     </text>
     <entry>
      <variable>Vatios</variable>
      <input>echo "scale=6;$Tensione*$Amperiore" | bc</input>
      <input>echo "scale=6;($Vad*$Amperiore)*$Amperiore" | bc</input>
      <input>echo "scale=6;($Tensione/$Vag)*$Tensione" | bc</input>
     </entry>
     <text>
      <label>Vatios</label>
     </text>
   </hbox>
   

    <hbox>
     <button>
       <label>Borrar datos</label>
     <action type="clear">Vatios</action><action type="clear">Tensione</action><action type="clear">Amperiore</action><action type="clear">Vad</action><action type="clear">Vag</action>
     </button>
     <button can-default="true" has-default="true" use-stock="true">
      <label>Calcular</label>
      <action>refresh:Vatios</action>
     </button>
   </hbox>
 </frame>
 
 
    <hbox>
     <button>
       <label>BORRAR TODOS LOS DATOS</label>
     <action type="clear">Resistor</action><action type="clear">Volts</action><action type="clear">Amper</action><action type="clear">Va</action><action type="clear">Vas</action><action type="clear">Vatios</action><action type="clear">Tensione</action><action type="clear">Amperiore</action><action type="clear">Vad</action><action type="clear">Vag</action><action type="clear">Corrient</action><action type="clear">Tensio</action><action type="clear">Resisten</action><action type="clear">Vat</action><action type="clear">Vac</action><action type="clear">Voltaje</action><action type="clear">Resistencia</action><action type="clear">Corriente</action><action type="clear">V</action><action type="clear">Val</action>
     </button>
    <button>
      <label>SALIR</label>
      <action>exit:EXIT</action>
     </button>
  </hbox>
</vbox>
</notebook>
</window>
' gtkdialog3 --program=MAIN_DIALOG
 
Back to top
View user's profile Send private message 
walter leonardo


Joined: 10 Dec 2009
Posts: 229

PostPosted: Fri 07 Sep 2012, 19:56    Post subject:  Help with gtk-dialog  

Now use the function tabs in my program and it worked well with the function of the enter key, but the enter key works only see in every window. What would be the problem?

Code:

#!/bin/bash
#Autor: Walter Leonardo Iñiguez
MAIN_DIALOG='
<window title="Programa VatiOhms">
<notebook page="0" labels=" Tab 1| Tab 2| Tab 3| Tab 4">         
<vbox>
  <frame>
  <text use-markup="true">
  <label>"<b><u>Calcular el Voltaje: V=I.R</u></b>"</label>
  </text>
   <hbox>
     <text>
      <label>Ingrese Resistencia (Ohm):  </label>
     </text>
     <entry>
     <default>""</default>
      <variable>Resistencia</variable>
     </entry>
     <text>
      <label>o vatios</label>
     </text>
     <entry>
     <default>""</default>
      <variable>V</variable>
     </entry>
   </hbox>

   <hbox>
     <text>
      <label>Ingrese Corriente (Ampere):</label>
     </text>
     <entry activates-default="true">
     <default>""</default>
      <variable>Corriente</variable>
     </entry>
     <text>
      <label>o vatios</label>
     </text>
     <entry activates-default="true">
     <default>""</default>
      <variable>Val</variable>
     </entry>
   </hbox>

   <hbox>
     <text>
      <label>El voltaje es:                         </label>
     </text>
     <entry>
      <variable>Voltaje</variable>
      <input>echo "scale=6;$Resistencia*$Corriente" | bc</input>
      <input>echo "scale=6;$V/$Corriente" | bc</input>
      <input>echo "scale=6;sqrt($Val*$Resistencia)" | bc</input>
     </entry>
     <text>
      <label>Volts</label>
     </text>
   </hbox>

   <hbox>
     <button>
       <label>Borrar datos</label>
     <action type="clear">Voltaje</action><action type="clear">Resistencia</action><action type="clear">Corriente</action><action type="clear">V</action><action type="clear">Val</action>
     </button>
     <button can-default="true" has-default="true" use-stock="true">
      <label>Calcular</label>
      <action>refresh:Voltaje</action>
     </button>
   </hbox>
 </frame>
 </vbox>
 
 <vbox>
 <frame Calcular la Resistencia: R=V/I >
   <hbox>
     <text>
      <label>Ingrese Tensión (Volt):         </label>
     </text>
     <entry>
     <default>""</default>
      <variable>Volts</variable>
     </entry>
     <text>
      <label>o vatios</label>
     </text>
     <entry>
     <default>""</default>
      <variable>Va</variable>
     </entry>
   </hbox>

   <hbox>
     <text>
      <label>Ingrese Corriente (Ampere):</label>
     </text>
     <entry activates-default="true">
     <default>""</default>
      <variable>Amper</variable>
     </entry>
     <text>
      <label>o vatios</label>
     </text>
     <entry activates-default="true">
     <default>""</default>
      <variable>Vas</variable>
     </entry>
   </hbox>

   <hbox>
     <text>
      <label>La resistencia es:                 </label>
     </text>
     <entry>
      <variable>Resistor</variable>
      <input>echo "scale=3;$Volts/$Amper" | bc</input>
      <input>echo "scale=3;($Va/$Amper)/$Amper" | bc</input>
      <input>echo "scale=3;$Volts/($Vas/$Volts)" | bc</input>
     </entry>
     <text>
      <label>Ohms</label>
     </text>
   </hbox>

     <hbox>
      <button>
       <label>Borrar datos</label>
     <action type="clear">Resistor</action><action type="clear">Volts</action><action type="clear">Amper</action><action type="clear">Va</action><action type="clear">Vas</action>
     </button>
     <button can-default="true" has-default="true" use-stock="true">
      <label>Calcular</label>
      <action>refresh:Resistor</action>
     </button>
    </hbox>
   </frame>
 </vbox>
 
 <vbox>
 <frame Calcular la Corriente: I=V/R >
   <hbox>
     <text>
      <label>Ingrese Tensión (Volt):        </label>
     </text>
     <entry>
     <default>""</default>
      <variable>Tensio</variable>
     </entry>
     <text>
      <label>o vatios</label>
     </text>
     <entry>
     <default>""</default>
      <variable>Vac</variable>
     </entry>
   </hbox>

   <hbox>
     <text>
      <label>Ingrese Resistencia (Ohm): </label>
     </text>
     <entry activates-default="true">
     <default>""</default>
      <variable>Resisten</variable>
     </entry>
     <text>
      <label>o vatios</label>
     </text>
     <entry activates-default="true">
     <default>""</default>
      <variable>Vat</variable>
     </entry>
   </hbox>

   <hbox>
     <text>
      <label>La Corriente es:                  </label>
     </text>
     <entry>
      <variable>Corrient</variable>
      <input>echo "scale=6;$Tensio/$Resisten" | bc</input>
      <input>echo "scale=6;$Vat/$Tensio" | bc</input>
      <input>echo "scale=6;(sqrt($Vac*$Resisten))/$Resisten" | bc</input>
     </entry>
     <text>
      <label>Amperes</label>
     </text>
   </hbox>
   

    <hbox>
     <button>
       <label>Borrar datos</label>
     <action type="clear">Corrient</action><action type="clear">Tensio</action><action type="clear">Resisten</action><action type="clear">Vat</action><action type="clear">Vac</action>
     </button>
     <button can-default="true" has-default="true" use-stock="true">
      <label>Calcular</label>
      <action>refresh:Corrient</action>
     </button>
   </hbox>
 </frame>
</vbox>

<vbox>
 <frame Calcular los Vatios (Watts): W=I.V >
   <hbox>
     <text>
      <label>Ingrese Tensión (Volt):          </label>
     </text>
     <entry>
     <default>""</default>
      <variable>Tensione</variable>
     </entry>
     <text>
      <label>o resistencia</label>
     </text>
     <entry>
     <default>""</default>
      <variable>Vad</variable>
     </entry>
   </hbox>

   <hbox>
     <text>
      <label>Ingrese Corriente (Ampere): </label>
     </text>
     <entry activates-default="true">
     <default>""</default>
      <variable>Amperiore</variable>
     </entry>
     <text>
      <label>o resistencia</label>
     </text>
     <entry activates-default="true">
     <default>""</default>
      <variable>Vag</variable>
     </entry>
   </hbox>

   <hbox>
     <text>
      <label>Los Vatios son:                     </label>
     </text>
     <entry>
      <variable>Vatios</variable>
      <input>echo "scale=6;$Tensione*$Amperiore" | bc</input>
      <input>echo "scale=6;($Vad*$Amperiore)*$Amperiore" | bc</input>
      <input>echo "scale=6;($Tensione/$Vag)*$Tensione" | bc</input>
     </entry>
     <text>
      <label>Vatios</label>
     </text>
   </hbox>
   

    <hbox>
     <button>
       <label>Borrar datos</label>
     <action type="clear">Vatios</action><action type="clear">Tensione</action><action type="clear">Amperiore</action><action type="clear">Vad</action><action type="clear">Vag</action>
     </button>
     <button can-default="true" has-default="true" use-stock="true">
      <label>Calcular</label>
      <action>refresh:Vatios</action>
     </button>
   </hbox>
 </frame>

    <hbox>
     <button>
       <label>BORRAR TODOS LOS DATOS</label>
     <action type="clear">Resistor</action><action type="clear">Volts</action><action type="clear">Amper</action><action type="clear">Va</action><action type="clear">Vas</action><action type="clear">Vatios</action><action type="clear">Tensione</action><action type="clear">Amperiore</action><action type="clear">Vad</action><action type="clear">Vag</action><action type="clear">Corrient</action><action type="clear">Tensio</action><action type="clear">Resisten</action><action type="clear">Vat</action><action type="clear">Vac</action><action type="clear">Voltaje</action><action type="clear">Resistencia</action><action type="clear">Corriente</action><action type="clear">V</action><action type="clear">Val</action>
     </button>
    <button>
      <label>SALIR</label>
      <action>exit:EXIT</action>
     </button>
  </hbox>
  </vbox>
</notebook>
</window>
' gtkdialog3 --program=MAIN_DIALOG
 
Back to top
View user's profile Send private message 
smokey01


Joined: 30 Dec 2006
Posts: 1806
Location: South Australia

PostPosted: Wed 26 Sep 2012, 07:52    Post subject:  

Can anyone offer a simple gtkdialog GUI for netcat.

I would like to be able to run netcat in backgrounded listening mode when I start the computer. If someone was to call me using netcat, my system should open a chat window so the caller and callee can chat.

It's easy enough to do it in two terminal on the local and remote computer.

EG: listening computer:
netcat -lp <port>

EG: Calling computer:
netcat 192.168.x.x <port>

Both terminals will connect and you can chat in the terminal windows.

This can also be done on a WAN but you need to do some port forwarding.

I would also be happy just to use the terminal/console as long as it is backgrounded until invoked by the caller. I just don't want in in the tray until it's required.

Thanks

_________________
Puppy Software <-> Distros <-> Puppy Linux Tips
Back to top
View user's profile Send private message Visit poster's website 
smokey01


Joined: 30 Dec 2006
Posts: 1806
Location: South Australia

PostPosted: Wed 26 Sep 2012, 16:27    Post subject:  

Alternative to the above, all I need is some indication that the remote computer is online. I don't really need a chat client. When both computers are online each should be visible to each other. I guess a poke function would be useful just to let the other party know you want to communicate.

Thanks

_________________
Puppy Software <-> Distros <-> Puppy Linux Tips
Back to top
View user's profile Send private message Visit poster's website 
disciple

Joined: 20 May 2006
Posts: 6430
Location: Auckland, New Zealand

PostPosted: Wed 26 Sep 2012, 18:42    Post subject:  

ping?
nbtscan?

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4348

PostPosted: Wed 26 Sep 2012, 19:15    Post subject:  

smokey01 wrote:
Can anyone offer a simple gtkdialog GUI for netcat.
Goingnuts adapted my irc client to use netcat, I was just using Xdialog, but he may have used something else as well.
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
sklimkin

Joined: 11 Jul 2012
Posts: 151
Location: Russia Moscow

PostPosted: Mon 29 Oct 2012, 17:59    Post subject: make string of argements for scrot-program  

Please help to master script.
There can be somebody collected a string of arguments from the program gtkdialog?

Here that I can't master in bash-gtkdialog:
#!/bin/bash
GTKDIALOG=gtkdialog

if [ "$COMBOBOX1" == "All" ]; then
COMMAND1=
##sprintf( COMMANDSTRING, "scrot -d %s -e 'mv $f ~%s'", COMBOBOX2, FILE );
else COMMAND1="-s"
##sprintf( COMMANDSTRING, "scrot -d %s -s -e 'mv $f ~%s'", COMBOBOX2, FILE );
echo "COMMAND1= $COMMAND1"
COMMAND2="$COMBOBOX2"
echo "COMMAND2= $COMMAND2"
COMMANDSTRING="-d $COMMAND2 $COMMAND1 -e 'mv $f ~'"
export COMMANDSTRING
echo "COMMANDSTRING= $COMMANDSTRING"
echo "End of export variables."
fi

export MAIN_DIALOG='
<window title="SCReenshOT screen-grabber">
<vbox>
... ... ...
I pass the insignificant
... ... ...
It is necessary to connect variable COMMANDSTRING here to what:
<button>
<label>ACCEPT</label>
<variable>GOMMANDSRING</variable>
<action>echo "Start of scrot:"</action>
<action>cat [ echo $COMMANDSTRING ] | scrot </action>
</button>

That is to transfer to function <action> a string of arguments for scrot (SCReen-shOT).

All other works: the directory for saving is selected, setting selected by the user are stored to an output from the program.

Commented out in the beginning of a file of a line ## sprintf (...) it that works in bash, but isn't accepted in gtkdialog and SO it would be desirable...
2012-10-30-015002_457x369_scrot.png
 Description   Screenshot of gtkdialog window
 Filesize   37.85 KB
 Viewed   629 Time(s)

2012-10-30-015002_457x369_scrot.png

Back to top
View user's profile Send private message 
sklimkin

Joined: 11 Jul 2012
Posts: 151
Location: Russia Moscow

PostPosted: Mon 29 Oct 2012, 18:24    Post subject: Corrected data to my previous post  

1. Script
Code:
#!/bin/bash
GTKDIALOG=gtkdialog

if [ "$COMBOBOX1" == "All" ]; then
COMMAND1=
##sprintf( COMMANDSTRING, "scrot -d %s -e 'mv $f ~%s'", COMBOBOX2, FILE );
else COMMAND1="-s"
##sprintf( COMMANDSTRING, "scrot -d %s -s -e 'mv $f ~%s'", COMBOBOX2, FILE );
echo "COMMAND1= $COMMAND1"
COMMAND2="$COMBOBOX2"
echo "COMMAND2= $COMMAND2"
COMMANDSTRING="-d $COMMAND2 $COMMAND1 -e 'mv $f ~'"
export COMMANDSTRING
echo "COMMANDSTRING= $COMMANDSTRING"
echo "End of export variables."
fi

export MAIN_DIALOG='
<window title="SCReenshOT  screen-grabber">
   <vbox>
      <frame Command button EXIT>
         <hbox>
            <button cancel></button>
         </hbox>
      </frame>

      <frame User-settings>
         <hbox>
            <vbox>
               <text>
                  <label>Select grab-mode</label>
               </text>
               <combobox>
                  <variable>COMBOBOX1</variable>
                  <item>All</item>
                  <item>Window</item>
                  <item>Area</item>
                  <action>save:COMBOBOX1</action>
                  <variable>COMMAND1</variable>
               </combobox>
            </vbox>
            <vbox>
               <text>
                  <label>Time-delay-sec</label>
               </text>
               <combobox>
                  <variable>COMBOBOX2</variable>
                  <item>0</item>
                  <item>1</item>
                  <item>2</item>
                  <item>5</item>
                  <item>10</item>
                  <item>20</item>
                  <action>save:COMBOBOX2</action>
                  <variable>COMMAND2</variable>
               </combobox>
            </vbox>
            <button>
               <label>ACCEPT</label>
               <variable>GOMMANDSRING</variable>
               <action>echo "Start of scrot:"</action>
               <action>cat [ echo $COMMANDSTRING ] | scrot </action>
            </button>
         </hbox>
      </frame>

      <frame Select DIR for save screenshot>
         <chooser>
            <height>200</height>
            <width>200</width>
            <variable>FILE</variable>
            <default>/home/</default>
            <action>cat [ echo $FILE ] | zenity --text-info  --width=250 --height=250 --title $FILE</action>
         </chooser>
      </frame>
   </vbox>
</window>
'

case $1 in
   -d | --dump) echo "$MAIN_DIALOG" ;;
   *) $GTKDIALOG --program=MAIN_DIALOG ;;
esac


2. Screenshot with "head"
2012-10-30-021933_1280x1024_scrot.png
 Description   Adjusted screemshot
 Filesize   39.76 KB
 Viewed   624 Time(s)

2012-10-30-021933_1280x1024_scrot.png

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 47 of 64 [949 Posts]   Goto page: Previous 1, 2, 3, ..., 45, 46, 47, 48, 49, ..., 62, 63, 64 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2130s ][ Queries: 13 (0.0226s) ][ GZIP on ]