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 Thu 23 Oct 2014, 14:45
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Gtkdialog Development
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 40 of 55 [821 Posts]   Goto page: Previous 1, 2, 3, ..., 38, 39, 40, 41, 42, ..., 53, 54, 55 Next
Author Message
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: Sat 29 Sep 2012, 18:35    Post subject:  

thunor wrote:
Thanks technosaurus, added to issue tracker for a future update.

http://code.google.com/p/gtkdialog/issues/detail?id=12
thanks, I got a little burnt out tracking everything down and feel like I should consider an alternative to just cut/pasting to the original considering all the improvements made to the rest of the toolchain since the last time glade was touched - it may be straight forward enough to use shared code, but I didn't delve that far, - just enough to get the toolbar button example to work.
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
zigbert


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

PostPosted: Sat 29 Sep 2012, 18:57    Post subject:  

Thunor
I have been working with great new stuff in 0.8.2, and most of it is working great. However, I have met some limitations....

I am struggling with signals in the <tree> widget.

The dream is to move items in list, and that didn't look too advanced at first, but now...
The attribute reorderable="true" works as expected, and with the support of <output file> in gtkdialog-0.8.2 everything should be fine. - But no go.
I have tried several attempts, and this is the closest I get.

In pMusic it is required to update the <input file> after moved a track in playlist (<tree>). Else, the new sort order won't be kept the next time the user adds a track to the list (refresh <input file>) . The first issue I met was that <output file> only kept data from the exported column - not the whole tree which I find more logical. I see input/output as one data-flow. Second, I couldn't get the <action>save: happen before I grab the output file for further work. (ie. to update the <input file> depending on the new sort-order in the <output file>.) The code-example shows the problem.

The first issue has a possible workaround with an extra grep-loop, while I can't see an immediate solution to the second issue.

Code:
#!/bin/sh

echo -e "1\n2\n3" > /tmp/input
echo > /tmp/output

echo '
<window>
 <vbox>
  <text><label>Move items in list and check output in terminal</label></text>
  <tree reorderable="true" column-header-active="0">
   <label>A</label>
   <variable>TREE</variable>
   <input file>/tmp/input</input>
   <output file>/tmp/output</output>
   <action signal="button-release-event">echo "button-release-event get the signal first. That is why I save:TREE"</action>
   <action signal="enter-notify-event">echo "enter-notify-event gets the signal later. But output file is not updated"</action>
   <action signal="button-release-event">save:TREE</action>
   <action signal="enter-notify-event">cat /tmp/output</action>
  </tree>
  <hbox><button ok></button></hbox>
 </vbox>
</window>
' | gtkdialog -s


When talking about the <tree> widget, I want to mention the other 'weakness' that makes me sometimes use the <table> instead. The <tree> auto-resize the column-width to show all content of input file. Maybe a nice feature sometimes, but with large input data, mostly not (my opinion). But worse, - it does only auto-expand column-width, never shrink again.


Thank you for all the goodies
Sigmund

_________________
Stardust resources

Last edited by zigbert on Sun 30 Sep 2012, 06:05; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
oldyeller


Joined: 15 Nov 2011
Posts: 812
Location: Mishawaka IN

PostPosted: Sat 29 Sep 2012, 20:51    Post subject:  

I have a couple of questions;

1) what are the names of the gtk icons that I can use for buttons?

2) How can I use the menubar widget and the text widget together?

I am planning on making a reader and than a simple word processeor and any help would be great.

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


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

PostPosted: Sat 29 Sep 2012, 23:27    Post subject:  

Is this what you are looking for?

#! /bin/bash
export MAIN_DIALOG='
<vbox>
<frame Stock>
<tree rules_hint="true" exported_column="1">
<height>400</height><width>250</width>
<label>Stock ID</label>
<item stock="gtk-dialog-authentication">gtk-dialog-authentication</item>
<item stock="gtk-dialog-info">gtk-dialog-info</item>
<item stock="gtk-dialog-warning">gtk-dialog-warning</item>
<item stock="gtk-dialog-error">gtk-dialog-error</item>
<item stock="gtk-dialog-question">gtk-dialog-question</item>
<item stock="gtk-dnd">gtk-dnd</item>
<item stock="gtk-dnd-multiple">gtk-dnd-multiple</item>
<item stock="gtk-about">gtk-about</item>
<item stock="gtk-add">gtk-add</item>
<item stock="gtk-apply">gtk-apply</item>
<item stock="gtk-bold">gtk-bold</item>
<item stock="gtk-cancel">gtk-cancel</item>
<item stock="gtk-cdrom">gtk-cdrom</item>
<item stock="gtk-clear">gtk-clear</item>
<item stock="gtk-close">gtk-close</item>
<item stock="gtk-color-picker">gtk-color-picker</item>
<item stock="gtk-convert">gtk-convert</item>
<item stock="gtk-connect">gtk-connect</item>
<item stock="gtk-copy">gtk-copy</item>
<item stock="gtk-cut">gtk-cut</item>
<item stock="gtk-delete">gtk-delete</item>
<item stock="gtk-directory">gtk-directory</item>
<item stock="gtk-disconnect">gtk-disconnect</item>
<item stock="gtk-edit">gtk-edit</item>
<item stock="gtk-execute">gtk-execute</item>
<item stock="gtk-file">gtk-file</item>
<item stock="gtk-find">gtk-find</item>
<item stock="gtk-find-and-replace">gtk-find-and-replace</item>
<item stock="gtk-floppy">gtk-floppy</item>
<item stock="gtk-fullscreen">gtk-fullscreen</item>
<item stock="gtk-goto-bottom">gtk-goto-bottom</item>
<item stock="gtk-goto-first">gtk-goto-first</item>
<item stock="gtk-goto-last">gtk-goto-last</item>
<item stock="gtk-goto-top">gtk-goto-top</item>
<item stock="gtk-go-back">gtk-go-back</item>
<item stock="gtk-go-down">gtk-go-down</item>
<item stock="gtk-go-forward">gtk-go-forward</item>
<item stock="gtk-go-up">gtk-go-up</item>
<item stock="gtk-harddisk">gtk-harddisk</item>
<item stock="gtk-help">gtk-help</item>
<item stock="gtk-home">gtk-home</item>
<item stock="gtk-index">gtk-index</item>
<item stock="gtk-indent">gtk-indent</item>
<item stock="gtk-info">gtk-info</item>
<item stock="gtk-unindent">gtk-unindent</item>
<item stock="gtk-italic">gtk-italic</item>
<item stock="gtk-jump-to">gtk-jump-to</item>
<item stock="gtk-justify-center">gtk-justify-center</item>
<item stock="gtk-justify-fill">gtk-justify-fill</item>
<item stock="gtk-justify-left">gtk-justify-left</item>
<item stock="gtk-justify-right">gtk-justify-right</item>
<item stock="gtk-leave-fullscreen">gtk-leave-fullscreen</item>
<item stock="gtk-missing-image">gtk-missing-image</item>
<item stock="gtk-media-forward">gtk-media-forward</item>
<item stock="gtk-media-next">gtk-media-next</item>
<item stock="gtk-media-pause">gtk-media-pause</item>
<item stock="gtk-media-play">gtk-media-play</item>
<item stock="gtk-media-previous">gtk-media-previous</item>
<item stock="gtk-media-record">gtk-media-record</item>
<item stock="gtk-media-rewind">gtk-media-rewind</item>
<item stock="gtk-media-stop">gtk-media-stop</item>
<item stock="gtk-network">gtk-network</item>
<item stock="gtk-new">gtk-new</item>
<item stock="gtk-no">gtk-no</item>
<item stock="gtk-ok">gtk-ok</item>
<item stock="gtk-open">gtk-open</item>
<item stock="gtk-paste">gtk-paste</item>
<item stock="gtk-preferences">gtk-preferences</item>
<item stock="gtk-print">gtk-print</item>
<item stock="gtk-print-preview">gtk-print-preview</item>
<item stock="gtk-properties">gtk-properties</item>
<item stock="gtk-quit">gtk-quit</item>
<item stock="gtk-redo">gtk-redo</item>
<item stock="gtk-refresh">gtk-refresh</item>
<item stock="gtk-remove">gtk-remove</item>
<item stock="gtk-revert-to-saved">gtk-revert-to-saved</item>
<item stock="gtk-save">gtk-save</item>
<item stock="gtk-save-as">gtk-save-as</item>
<item stock="gtk-select-color">gtk-select-color</item>
<item stock="gtk-select-font">gtk-select-font</item>
<item stock="gtk-sort-ascending">gtk-sort-ascending</item>
<item stock="gtk-sort-descending">gtk-sort-descending</item>
<item stock="gtk-spell-check">gtk-spell-check</item>
<item stock="gtk-stop">gtk-stop</item>
<item stock="gtk-strikethrough">gtk-strikethrough</item>
<item stock="gtk-undelete">gtk-undelete</item>
<item stock="gtk-underline">gtk-underline</item>
<item stock="gtk-undo">gtk-undo</item>
<item stock="gtk-yes">gtk-yes</item>
<item stock="gtk-zoom-100">gtk-zoom-100</item>
<item stock="gtk-zoom-fit">gtk-zoom-fit</item>
<item stock="gtk-zoom-in">gtk-zoom-in</item>
<item stock="gtk-zoom-out">gtk-zoom-out</item>
</tree>
</frame>
<hbox>
<button cancel></button>
<button ok></button>
</hbox>
</vbox>
'

gtkdialog --program=MAIN_DIALOG

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


Joined: 15 Nov 2011
Posts: 812
Location: Mishawaka IN

PostPosted: Sun 30 Sep 2012, 03:10    Post subject:  

Thanks for the list smokey01

1 questioned answered. thanks again
Back to top
View user's profile Send private message 
zigbert


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

PostPosted: Sun 30 Sep 2012, 06:07    Post subject:  

Minor updates in my test-script
_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Sun 30 Sep 2012, 06:14    Post subject:  

@ oldyeller

Make an hbox that contains both the menubar and the text widget. I just added a few lines to Thunor's example:

Code:
#!/bin/sh

GTKDIALOG=gtkdialog

IMAGEFILE=( $(find /usr/share/icons -maxdepth 1 -type f | head -3) )

export MAIN_DIALOG='
<window title="MenuBar" resizable="false" width-request="360" height-request="240"  border-width="0">
   <vbox spacing="0">
   <hbox>
      <menubar>
         <menu label="_Stock Images" use-underline="true">
            <menuitem stock-id="gtk-about"></menuitem>
            <menuitem stock-id="gtk-add"></menuitem>
            <menuitemseparator></menuitemseparator>
            <menuitem stock-id="gtk-quit" accel-key="0x51" accel-mods="4">
               <action>exit:Quit</action>
            </menuitem>
         </menu>
         <menu use-underline="true">
            <menuitem icon-name="abiword" label="AbiWord"></menuitem>
            <menuitem icon-name="gnumeric" label="Gnumeric 32px">
               <height>32</height>
            </menuitem>
            <menuitem icon-name="gimp" label="_Gimp 48px" use-underline="true">
               <height>48</height>
            </menuitem>
            <label>"_Theme Images"</label>
         </menu>
         <menu use-underline="true">
            <menuitem image-name="'"${IMAGEFILE[0]}"'" label="Original Size"></menuitem>
            <menuitem image-name="'"${IMAGEFILE[1]}"'">
               <label>32px</label>
               <height>32</height>
               <width>32</width>
            </menuitem>
            <menuitem image-name="'"${IMAGEFILE[2]}"'" label="48px">
               <height>48</height>
               <width>48</width>
            </menuitem>
            <label>"_File Images"</label>
         </menu>
      </menubar>
         <text>
            <label>This is static text.</label>
         </text>
   </hbox>
   </vbox>
</window>
'

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


Joined: 15 Nov 2011
Posts: 812
Location: Mishawaka IN

PostPosted: Sun 30 Sep 2012, 11:58    Post subject:  

@ vovchik,


Thanks I will check out what you did and go from there and see what I can do.
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Sun 30 Sep 2012, 14:42    Post subject:  

@ oldyeller

You can also put the text tag into another vbox together with the menubar:

Code:
#!/bin/sh

GTKDIALOG=gtkdialog

IMAGEFILE=( $(find /usr/share/icons -maxdepth 1 -type f | head -3) )

export MAIN_DIALOG='
<window title="MenuBar" resizable="false" width-request="360" height-request="240"  border-width="0">
   <vbox spacing="0">
   <vbox>
      <menubar>
         <menu label="_Stock Images" use-underline="true">
            <menuitem stock-id="gtk-about"></menuitem>
            <menuitem stock-id="gtk-add"></menuitem>
            <menuitemseparator></menuitemseparator>
            <menuitem stock-id="gtk-quit" accel-key="0x51" accel-mods="4">
               <action>exit:Quit</action>
            </menuitem>
         </menu>
         <menu use-underline="true">
            <menuitem icon-name="abiword" label="AbiWord"></menuitem>
            <menuitem icon-name="gnumeric" label="Gnumeric 32px">
               <height>32</height>
            </menuitem>
            <menuitem icon-name="gimp" label="_Gimp 48px" use-underline="true">
               <height>48</height>
            </menuitem>
            <label>"_Theme Images"</label>
         </menu>
         <menu use-underline="true">
            <menuitem image-name="'"${IMAGEFILE[0]}"'" label="Original Size"></menuitem>
            <menuitem image-name="'"${IMAGEFILE[1]}"'">
               <label>32px</label>
               <height>32</height>
               <width>32</width>
            </menuitem>
            <menuitem image-name="'"${IMAGEFILE[2]}"'" label="48px">
               <height>48</height>
               <width>48</width>
            </menuitem>
            <label>"_File Images"</label>
         </menu>
      </menubar>
         <text>
            <label>This is static text.</label>
         </text>
   </vbox>
   </vbox>
</window>
'

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


Joined: 15 Nov 2011
Posts: 812
Location: Mishawaka IN

PostPosted: Sun 30 Sep 2012, 21:13    Post subject:  

@ vovchik

Thanks again for this one too, Will take a look also at this one and see what I can come up with.
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Mon 01 Oct 2012, 05:26    Post subject:  

@ oldyeller

This is the same stuff again, but with an edit box.

With kind regards,
vovchik
Code:
#!/bin/sh

GTKDIALOG=gtkdialog

IMAGEFILE=( $(find /usr/share/icons -maxdepth 1 -type f | head -3) )

export MAIN_DIALOG='
<window title="MenuBar" resizable="false" width-request="360" height-request="240"  border-width="0">
   <vbox spacing="0">
   <vbox>
      <menubar>
         <menu label="_Stock Images" use-underline="true">
            <menuitem stock-id="gtk-about"></menuitem>
            <menuitem stock-id="gtk-add"></menuitem>
            <menuitemseparator></menuitemseparator>
            <menuitem stock-id="gtk-quit" accel-key="0x51" accel-mods="4">
               <action>exit:Quit</action>
            </menuitem>
         </menu>
         <menu use-underline="true">
            <menuitem icon-name="abiword" label="AbiWord"></menuitem>
            <menuitem icon-name="gnumeric" label="Gnumeric 32px">
               <height>32</height>
            </menuitem>
            <menuitem icon-name="gimp" label="_Gimp 48px" use-underline="true">
               <height>48</height>
            </menuitem>
            <label>"_Theme Images"</label>
         </menu>
         <menu use-underline="true">
            <menuitem image-name="'"${IMAGEFILE[0]}"'" label="Original Size"></menuitem>
            <menuitem image-name="'"${IMAGEFILE[1]}"'">
               <label>32px</label>
               <height>32</height>
               <width>32</width>
            </menuitem>
            <menuitem image-name="'"${IMAGEFILE[2]}"'" label="48px">
               <height>48</height>
               <width>48</width>
            </menuitem>
            <label>"_File Images"</label>
         </menu>
      </menubar>
      <edit>
         <variable>EDITOR</variable>
         <height>150</height>
         <width>350</width>
         <default>
            "This is the default text of the editor."
         </default>
      </edit>
      <hbox>
         <button cancel></button>
         <button ok></button>
      </hbox>
   </vbox>
   </vbox>
</window>
'

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


Joined: 15 Nov 2011
Posts: 812
Location: Mishawaka IN

PostPosted: Mon 01 Oct 2012, 17:19    Post subject:  

@ vovchik

Thanks again. I will no longer be posting any more on this thread but instead will be posting any quwstions on the Gtkdialog-Tips by zigbert.

This is the thread I should be using correct?

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


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

PostPosted: Tue 02 Oct 2012, 17:30    Post subject:  

Is gtkdialog 0.8.2 suppose to be backward compatible with 0.8.1?

I have a small script that works fine in 0.8.1 but not 0.8.2.

BTW I compiled it in FD64-600.

Thanks

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


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Wed 03 Oct 2012, 10:23    Post subject:  

I'm in the process of setting-up slacko 533 to use as my main distro so Sigmund I will look into your issues once I'm settled.

oldyeller: Just create a new topic in the Programming section asking for help with whatever it is you want help with.

smokey01: Can we see the small script please?
Back to top
View user's profile Send private message Visit poster's website 
smokey01


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

PostPosted: Wed 03 Oct 2012, 17:15    Post subject:  

#!/bin/sh

# A simple GUI to give someone a "Nudge"
# (maybe add an icon on wbar to run this)

#set work dir
APPDIR=$(pwd)
export APPDIR

someone1 () {
echo "boo" | ncat -i 1 someone1.no-ip.info 1234
}
export -f someone1

someone2 () {
echo "boo" | ncat -i 1 someone2.no-ip.info 1234
}
export -f someone2

toggle () {
# If big-ears is already running, then kill it
if pidof ncat | grep [0-9] > /dev/null
then
exec killall ncat; exec killall big-ears
else
# Start big-ears running again
$APPDIR/big-ears
# change above path to point to your psip binary file.
exit
fi
}
export -f toggle

IMAGEFILE="$APPDIR/bill.jpg"
IMAGEFILE2="$APPDIR/bob.jpg"

export script='
<window title="Nudger" icon-name="gtk-preferences" 0 0>
<vbox>
<frame Contacts:>
<hbox>
<button>
<width>48</width>
<input file>'"$IMAGEFILE"'</input>
<action>someone1</action>
</button>
<button>
<width>48</width>
<input file>'"$IMAGEFILE2"'</input>
<action>someone2</action>
</button>
</hbox>
</frame>

<frame Listening Mode:>
<vbox>
<button>
<width>48</width>
<label>On / Off</label>
<action>toggle</action>
</button>
</vbox>
</frame>

<hbox>
<button use-stock="true" label="gtk-quit"></button>
</hbox>
</vbox>
</window>'

gtkdialog -p script

_________________
Puppy Software <-> Distros <-> Puppy Linux Tips
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 40 of 55 [821 Posts]   Goto page: Previous 1, 2, 3, ..., 38, 39, 40, 41, 42, ..., 53, 54, 55 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
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.1560s ][ Queries: 13 (0.0195s) ][ GZIP on ]