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 Wed 27 Aug 2014, 05:24
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Programming karma
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Sat 14 Aug 2010, 04:05    Post_subject:  Programming karma
Sub_title: Cyberchanting and the missing deity
 

been using dir2pet in Lucid 5.1 (from console) Smile

Managed to create this which puts the files just above root
http://tmxxine.com/chant/cyberchant.pet
- a menu entry is added but not yet usable
. . . near enough

run xpupsay-1.2-i486.pet which should be in the above root dir/folder
restart x and the ganesh.sh should run (right click and change permissions if not working)

Now the puzzle . . .
Why does Ganesh only appear sometimes?
(I appreciate that he is a representation of the Universal Brahman
- but even so) Wink
Maybe he does not appear at all for you and I am blessed?
Anyway need more Ganesh

Second problem is how to hit enter
in this bit of code
from the ganesh.sh
after adding a mantra number
(at the moment you click on OK once number added)

Code:
# # # # # # # # # # # # # # #
function input_message()
# # # # # # # # # # # # # # #
{
Xdialog --title "INPUT BOX" --inputbox \
"How many mantras to recite?" 0 0 2> /tmp/inputbox.tmp.$$
retval=$?
input=`cat /tmp/inputbox.tmp.$$`
rm -f /tmp/inputbox.tmp.$$
case $retval in
0)
echo "Input string is '$input'";;
1)
echo "Cancel pressed.";;
255)
echo "Box closed.";;
esac
repetitions=$input
}


Can the code be improved?
- I just 'nabbed from net' and added/hacked . . .

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
seaside

Joined: 11 Apr 2007
Posts: 886

PostPosted: Sat 14 Aug 2010, 15:35    Post_subject:  

Lobster,

Quote:

Second problem is how to hit enter
in this bit of code
from the ganesh.sh
after adding a mantra number
(at the moment you click on OK once number added)


I'm not sure if xdialog can default with an enter key. Perhaps Gtkdialog would be ok as follows:

Code:

#! /bin/bash

export DIALOG='
<window title="Mantras" icon-name="gtk-dialog-question">
  <vbox>
    <hbox>
      <text>
        <label>Mantra Recitals:</label>
      </text>
      <entry activates-default="true">
        <default>How Many ??</default>
   <variable>NUM</variable>
      </entry>
    </hbox>
    <hbox>
      <button cancel></button>
      <button can-default="true" has-default="true" use-stock="true" >
        <label>gtk-ok</label>
   
      </button>
    </hbox>
  </vbox>
</window>
'
CHOICES=`gtkdialog3 --program=DIALOG`
eval $CHOICES
repetitions=$NUM


Must keep those musical apps healthy and well fed. Very Happy

Regards,
s
Back to top
View user's profile Send_private_message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Sat 14 Aug 2010, 19:29    Post_subject:  

Quote:
Perhaps Gtkdialog would be ok as follows:


I cut and pasted your solution Seaside
and it solved both problems Smile

This is my sort of programming Wink
Thank you so much Very Happy

Interestingly you benefit and share in the merit of
any mantra recitations this inspires
In fact I will do extra as part of a challenge
http://imoveyou.com/

PS. and the code was more comprehensible to me

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Wed 25 Aug 2010, 04:17    Post_subject:  

I have updated the program here
http://www.murga-linux.com/puppy/viewtopic.php?p=445208#445208

and it works great Smile
but I would like to ensure that clicking in the close program
(x top left of initial dialog) does not start the program
but works the same as cancel

I would also like to have the ability to disable full screen mode
which is here in the code

Code:
#if [ "gtk-fullscreen" = "1" ]
#then
#echo true
#fi
#else echo false


but frankly I have not a clue what I am meant to be doing
any help offered is welcome Smile

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0533s ][ Queries: 12 (0.0048s) ][ GZIP on ]