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 Sat 23 Sep 2017, 20:00
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 81 of 81 [1212 Posts]   Goto page: Previous 1, 2, 3, ..., 79, 80, 81
Author Message
zigbert


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

PostPosted: Mon 28 Aug 2017, 06:52    Post subject:  

Laughing Laughing Laughing

That means the solution is to combine a <chooser> in mode 0 (select file) with an <entry> holding the filename. Thank you.

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


Joined: 26 Jan 2011
Posts: 1349
Location: Japan

PostPosted: Mon 28 Aug 2017, 07:22    Post subject:  

No, that's not what it meant. But if you somehow are able to achieve this with a separate <entry> widget I would be keen to see your solution Wink
Back to top
View user's profile Send private message 
zigbert


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

PostPosted: Mon 28 Aug 2017, 08:35    Post subject:  

I am onto it Wink
_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
zigbert


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

PostPosted: Mon 28 Aug 2017, 09:39    Post subject:  

First draft:
Code:
echo /usr/share/backgrounds > /tmp/savepath
echo "default.svg" > /tmp/savefile

echo '
<vbox>
 <entry visible="false">
  <variable>SAVEPATH</variable>
  <input file>/tmp/savepath</input>
 </entry>
 <entry>
  <variable>SAVEFILE</variable>
  <input file>/tmp/savefile</input>
 </entry>
 <chooser action="0" create-folders="true" >
  <width>600</width>
  <height>400</height>
  <variable>SAVE_CHOOSER</variable>
  <default>'$(cat /tmp/savepath)'</default>
  <action signal="button-release-event" condition="command_is_true([[ -f \"$SAVE_CHOOSER\" ]] && echo true)">basename "$SAVE_CHOOSER" > /tmp/savefile</action>
  <action signal="button-release-event" condition="command_is_true([[ -d \"$SAVE_CHOOSER\" ]] && echo true)">dirname "$SAVE_CHOOSER" > /tmp/savepath</action>
  <action signal="button-release-event">refresh:SAVEFILE</action>
  <action signal="button-release-event">refresh:SAVEPATH</action>
 </chooser>
 <hbox>
  <button cancel></button>
  <button>
   <label>Save</label>
   <input file stock="gtk-save"></input>
   <action>gxmessage "savefile: $SAVEPATH"/"$SAVEFILE"</action>
  </button>
 </hbox>
</vbox>
' |  gtkdialog -s


Seems to work ok, but it doesn't update $SAVEPATH when pressing one of the path-buttons (second row in the gui). I got problems to control that...

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


Joined: 10 Mar 2010
Posts: 4685
Location: Ontario

PostPosted: Mon 28 Aug 2017, 10:58    Post subject:  

Simple example to show left side buttons...

Code:
echo '
<vbox width-request="300">
 <hbox>
                   
              <button  space-expand="false" space-fill="false">
            <label>"Action"</label>
                      <input file stock="gtk-help"></input>
            <action>xmessage here</action>
      </button>
       <button  space-expand="false" space-fill="false">
                      <input file stock="gtk-preferences"></input>

            <action>xmessage here</action>
      </button>

       <text space-expand="true" space-fill="true">
            <label>""</label>
       </text> 
       <button cancel></button> 
 </hbox> 
 

</vbox>' | gtkdialog -s
screenshot-button.png
 Description   left side buttons
 Filesize   6.53 KB
 Viewed   214 Time(s)

screenshot-button.png

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


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

PostPosted: Fri 01 Sep 2017, 02:55    Post subject:  

Is it possible to change the background colour of the <edit> widget?
_________________
Software <-> Distros <-> Tips <-> Newsletters
Back to top
View user's profile Send private message Visit poster's website 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1349
Location: Japan

PostPosted: Fri 01 Sep 2017, 03:56    Post subject:  

smokey01 wrote:
Is it possible to change the background colour of the <edit> widget?
Yes.
Back to top
View user's profile Send private message 
smokey01


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

PostPosted: Fri 01 Sep 2017, 04:26    Post subject:  

MochiMoppel wrote:
smokey01 wrote:
Is it possible to change the background colour of the <edit> widget?
Yes.
Thanks.
_________________
Software <-> Distros <-> Tips <-> Newsletters
Back to top
View user's profile Send private message Visit poster's website 
some1

Joined: 17 Jan 2013
Posts: 75

PostPosted: Fri 01 Sep 2017, 16:38    Post subject:  

Yes!
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 4685
Location: Ontario

PostPosted: Sat 02 Sep 2017, 15:49    Post subject:  

Here's another example of a colored background..
http://45.33.15.200/puppy/viewtopic.php?p=881811&sid=1a5cb59d306d4dbcce14d9e258108dea#881811

___________________________________________________
Back to top
View user's profile Send private message 
livernote1

Joined: 08 Sep 2017
Posts: 1

PostPosted: Fri 08 Sep 2017, 23:46    Post subject:  

Hello guys newbie here, help needed...

below i have provide two code from two different program but the problem here is how can i merge this two program. if u guys can see there is button continue below the date button,so i want to make the continue button will open the second program code that i have provide below. The second problem is the picture that i used on pixmap fuction is not showing the picture but show sign like it cant read the picture.. so thanks in advance.

Code:


#!/bin/bash
GTKDIALOG=gtkdialog
export MAIN_DIALOG='
<window title="welcome" width-request="480" height-request="320">
<vbox>

   <frame>
      <text>
         <label> Welcome </label>
      </text>   
      <pixmap>
      <input file> /home/livernote/Desktop/L.jpg </input>
      </pixmap>   
   </frame>
   
   <frame Label from command>
     <text>
       <label>This is a static text.</label>
       <input>date</input>
       <variable>DATE</variable>
     </text>
     <hbox>
       <button>
         <label>refresh</label>
         <action type="refresh">DATE</action>
       </button>
       <button>
       <label>Continue</label>
       <action>
         <input file> /home/livernote/Desktop/my </input>
        </action>
       </button>
    </hbox>
   </frame>   

</vbox>
</window>
'
case $1 in
-d | --dump) echo "$MAIN_DIALOG" ;;
*) $GTKDIALOG --program=MAIN_DIALOG --center ;;
esac
------------




Code:


#!/bin/bash
GTKDIALOG=gtkdialog
export MAIN_DIALOG='
<window title="welcome" width-request="480" height-request="320">
<hbox>

      <vbox space-expand="true" space-fill="true">
         
         <button>   
         <label>1</label> 
         <action>echo "Button 1"</action>
         </button>

         <button>   
         <label>2</label> 
         <action>echo "Button 2"</action>
         </button>
               
      </vbox>
</hbox>

</window>
'
case $1 in
-d | --dump) echo "$MAIN_DIALOG" ;;
*) $GTKDIALOG --program=MAIN_DIALOG --center ;;
esac
------------
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1349
Location: Japan

PostPosted: Sat 09 Sep 2017, 01:09    Post subject:  

"Merge" two programs? It appears that you have 2 different scripts, each containing a MAIN_DIALOG, and that you are trying to call the second script from the first. Could be done with a simple button action <action>/path/to/my/secondscript.sh &</action>

You could also put both dialogs into 1 script and launch the second dialog from your first. Something like this:
Code:
#!/bin/bash
export SUB_DIALOG='
<window>
<vbox>
 <text><label>SUB_DIALOG</label></text>
 <button>
   <label>Close</label>
   <action>closewindow:SUB_DIALOG</action>
 </button>
</vbox>
<variable>SUB_DIALOG</variable>
</window>'

export MAIN_DIALOG='
<window>
<vbox>
 <text><label>MAIN_DIALOG</label></text>
 <button>
   <label>Continue</label>
   <action>launch:SUB_DIALOG</action>
 </button>
</vbox>
</window>'
gtkdialog -cp MAIN_DIALOG


More examples for launching child windows:
http://www.murga-linux.com/puppy/viewtopic.php?p=353875#353875
http://www.murga-linux.com/puppy/viewtopic.php?p=758300#758300

Your second question: Remove the surrounding whitespace or put the file path in quotes.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 81 of 81 [1212 Posts]   Goto page: Previous 1, 2, 3, ..., 79, 80, 81
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.0945s ][ Queries: 14 (0.0064s) ][ GZIP on ]