Has anyone ever made a gtk script that can generate a random number between 100 and 200 and show it in the gtk dialog ?
I have looked on google but not had any success as yet........
rnd / random numbers gtk3 example
Code: Select all
#!/bin/bash
xmessage -title "random" -center $(($RANDOM%100 +100))
Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]
Question to the Gods of gtk
Where did you learn this code from , I haven't manage to find any good sites with examples for dimbo newbie's i.e. ME
I would like to find a good source on gtk
anyone got some good sources they wish to share?
I would like to find a good source on gtk
anyone got some good sources they wish to share?
got random working
How do you present a variable in my example
rndnumber="123" # will be replaced with ((Random))
<entry><default>$rndnumber</default><variable>number</variable>
all it seems to display is $rndnumber how do I present that statement as a variable from above.
rndnumber="123" # will be replaced with ((Random))
<entry><default>$rndnumber</default><variable>number</variable>
all it seems to display is $rndnumber how do I present that statement as a variable from above.
here are some tips for Gtkdialog:
http://www.murga-linux.com/puppy/viewtopic.php?t=38608
http://xpt.sourceforge.net/techdocs/lan ... 01s03.html
Here is a simple example to start with:
The random I found with google, I think I googled for "bash random".
Important is to avoid '
Instead use "
Inside two ", use: \"
Mark
http://www.murga-linux.com/puppy/viewtopic.php?t=38608
http://xpt.sourceforge.net/techdocs/lan ... 01s03.html
Here is a simple example to start with:
Code: Select all
#!/bin/bash
export a=$(($RANDOM%100 +100))
export mytest="
<window title=\"testwindow\">
<vbox>
<hbox>
<button>
<label>$a</label>
<action>rxvt &</action>
</button>
</hbox>
</vbox>
</window>"
result=`gtkdialog3 --program=mytest --center`
echo "the grafical program exited with: $result"
exit
Important is to avoid '
Instead use "
Inside two ", use: \"
Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]