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 21 Nov 2017, 00:41
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 82 of 82 [1226 Posts]   Goto page: Previous 1, 2, 3, ..., 80, 81, 82
Author Message
MochiMoppel


Joined: 26 Jan 2011
Posts: 1391
Location: Japan

PostPosted: Sat 14 Oct 2017, 03:02    Post subject:  

Today I wondered why one of my <pixmap> widgets recognizes key-press-event signals while another - seemingly identical - widget doesn't.

Turns out that it makes a difference if the pixmap is packed into a scrollable or (default) not scrollable box container.
I updated my collection of <eventbox> mysteries.
Back to top
View user's profile Send private message 
torm


Joined: 07 Mar 2015
Posts: 128

PostPosted: Sun 15 Oct 2017, 12:01    Post subject:  

Quote:
export GTK2_RC_FILES


..interesting, works as is on this system.. no need to export.



Quote:
OK, I can always use the JWM TaskList menu,



..not using JWM if possible, while double checked with JWM, looks working.
Maybe should have made better mimic of window border.. ? Top gray area?


Quote:
BTW: Resizing the "fixed size" window results in strange artifacts


.. will add resizable="false" when update.
Also some more detailed rc file to support dark themes ( for resizable window ) .
Back to top
View user's profile Send private message 
livernote1

Joined: 08 Sep 2017
Posts: 3

PostPosted: Mon 16 Oct 2017, 23:01    Post subject:  

Guys help needed, been working with this progress bar if using the example like give in page page 1 it is working fine but after i change the action it seem the program is running on the background only the progress bar is just silence

Code:
<frame Progress>
    <text>
      <label>Duplication process is happening.</label>
    </text>
    <progressbar>
      <input>dd if=/dev/sda of=/dev/sdb</input>
     <action>launch:END_DIALOG</action>
    </progressbar>
  </frame>
Back to top
View user's profile Send private message 
misko_2083


Joined: 08 Nov 2016
Posts: 19

PostPosted: Tue 17 Oct 2017, 10:01    Post subject:  

livernote1 wrote:
Guys help needed, been working with this progress bar if using the example like give in page page 1 it is working fine but after i change the action it seem the program is running on the background only the progress bar is just silence

Code:
<frame Progress>
    <text>
      <label>Duplication process is happening.</label>
    </text>
    <progressbar>
      <input>dd if=/dev/sda of=/dev/sdb</input>
     <action>launch:END_DIALOG</action>
    </progressbar>
  </frame>
This is a way to show the progress bar with dd and pv in terminal.
Code:
USB="/dev/sdb"
ISO_IMAGE="/path/to/ubuntu-15.04-desktop-amd64.iso"
SIZE=$(du -h -B1 "$ISO_IMAGE" | awk '{print $1}')

dd if="$ISO_IMAGE" | pv -s "$SIZE" | dd of="$USB" bs=4M oflag=dsync


With oflag=dsync dd will ask for completely synchronous output to disk. Slower but you'll have a progress bar.

Someone asked how to do this with yad.
To show this in a UI you need line by line output. For that add -n to pv.

Code:
USB="/dev/sdb"
 ISO_IMAGE="/path/to/ubuntu-15.04-desktop-amd64.iso"
 SIZE=$(du -h -B1 "$ISO_IMAGE" | awk '{print $1}')

(dd if="$ISO_IMAGE" | pv -n -s "$SIZE" | dd of="$USB" bs=4M oflag=dsync) 2>&1 | \
  yad --center --borders=6 --title="Image writer" --text="$(echo -e "Writing $(basename "$ISO_IMAGE"):")"\
        --width=300 --progress --no-buttons --auto-close --image=system-run --window-icon=drive-removable-media-usb

You can apply something similar with gtkdialog.
Back to top
View user's profile Send private message 
torm


Joined: 07 Mar 2015
Posts: 128

PostPosted: Fri 20 Oct 2017, 16:46    Post subject:  

Different versions of GTK2 and BASH..

fixed some,I hope ..
Back to top
View user's profile Send private message 
livernote1

Joined: 08 Sep 2017
Posts: 3

PostPosted: Sun 22 Oct 2017, 02:54    Post subject:  

misko_2083 wrote:
livernote1 wrote:
Guys help needed, been working with this progress bar if using the example like give in page page 1 it is working fine but after i change the action it seem the program is running on the background only the progress bar is just silence

Code:
<frame Progress>
    <text>
      <label>Duplication process is happening.</label>
    </text>
    <progressbar>
      <input>dd if=/dev/sda of=/dev/sdb</input>
     <action>launch:END_DIALOG</action>
    </progressbar>
  </frame>
This is a way to show the progress bar with dd and pv in terminal.
Code:
USB="/dev/sdb"
ISO_IMAGE="/path/to/ubuntu-15.04-desktop-amd64.iso"
SIZE=$(du -h -B1 "$ISO_IMAGE" | awk '{print $1}')

dd if="$ISO_IMAGE" | pv -s "$SIZE" | dd of="$USB" bs=4M oflag=dsync


With oflag=dsync dd will ask for completely synchronous output to disk. Slower but you'll have a progress bar.

Someone asked how to do this with yad.
To show this in a UI you need line by line output. For that add -n to pv.

Code:
USB="/dev/sdb"
 ISO_IMAGE="/path/to/ubuntu-15.04-desktop-amd64.iso"
 SIZE=$(du -h -B1 "$ISO_IMAGE" | awk '{print $1}')

(dd if="$ISO_IMAGE" | pv -n -s "$SIZE" | dd of="$USB" bs=4M oflag=dsync) 2>&1 | \
  yad --center --borders=6 --title="Image writer" --text="$(echo -e "Writing $(basename "$ISO_IMAGE"):")"\
        --width=300 --progress --no-buttons --auto-close --image=system-run --window-icon=drive-removable-media-usb

You can apply something similar with gtkdialog.


i have try me best to understand but apparently still cant make the progress bar in the gtkdialog moving...its work smoothly if i just want to use the pv at terminal but on the gtkdialog interface the progress bar is no moving Sad
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 4755
Location: Ontario

PostPosted: Thu 09 Nov 2017, 21:34    Post subject:  

Tip for a horizontal line of buttons at the bottom of a window (see image)

Instead of all the icons sharing the window equally
or force them all to the right side , I found a way to
give a button less space. In the example the help button
is small and on the left side. The other two buttons share the remaining space equally.

Code:

#!/bin/sh


export TEXTSTRING="$(gettext 'How to use pho
Usage: : pho *.jpg (or whatever format). ')"

export VIEWER='
<window title="Experiment">
     <vbox   width-request="740">
             <text><label>Experiment</label></text>


             <hseparator></hseparator>
 
            <hbox>   
                       <button   space-expand="false" space-fill="false">
                      <input file stock="gtk-help"></input>
                       <action>Xdialog --title "'$(gettext 'Help')'"  --ok-label "'$(gettext 'OK')'" --backtitle "\n$TEXTSTRING \n "  --msgbox  "" 0 0 &</action>
                       </button>


            <hbox   space-expand="true" space-fill="true">
                       <button>
                      <input file stock="gtk-cancel"></input>
                      <label>Cancel</label>
                     </button>

                      <button>
                       <input file stock="gtk-apply"></input>
                       <label>Proceed</label>       
                      <action>xmessage clicked</action> 
                      <action type="exit">CLOSE</action>           
                      </button>
   
            </hbox></hbox>

      </vbox>
</window>'

gtkdialog -p VIEWER --center



screenshot-script.png
 Description   
 Filesize   8.65 KB
 Viewed   178 Time(s)

screenshot-script.png

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


Joined: 10 Mar 2010
Posts: 4755
Location: Ontario

PostPosted: Sat 11 Nov 2017, 12:48    Post subject:  

Here is final app --> pho viewer

http://murga-linux.com/puppy/viewtopic.php?p=974027#974027
____________________________________________________
screenshot-pho.png
 Description   
 Filesize   31.41 KB
 Viewed   134 Time(s)

screenshot-pho.png

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


Joined: 24 Aug 2009
Posts: 2908

PostPosted: Wed 15 Nov 2017, 02:17    Post subject:  

I was wondering if anyone has any idea under what conditions the gtkdialog elements of an app/script may be shown in reverse order
i.e. from bottom to top and from right to left (see pick below)

Should point out that this is with the mac version of gtkdialog Embarassed , but still...
The gtkdialog dependencies appear to be ok, btw
Code:
gm$ otool -L /usr/local/bin/gtkdialog # otool is the dll equivalent for ox x
/usr/local/bin/gtkdialog:
/usr/local/opt/gtk+/lib/libgtk-quartz-2.0.0.dylib (compatibility version 2401.0.0, current version 2401.31.0)
/usr/local/opt/gtk+/lib/libgdk-quartz-2.0.0.dylib (compatibility version 2401.0.0, current version 2401.31.0)
/usr/local/opt/pango/lib/libpangocairo-1.0.0.dylib (compatibility version 4001.0.0, current version 4001.3.0)
/usr/local/opt/pango/lib/libpango-1.0.0.dylib (compatibility version 4001.0.0, current version 4001.3.0)
/usr/local/opt/atk/lib/libatk-1.0.0.dylib (compatibility version 22210.0.0, current version 22210.1.0)
/usr/local/opt/cairo/lib/libcairo.2.dylib (compatibility version 11403.0.0, current version 11403.6.0)
/usr/local/opt/gdk-pixbuf/lib/libgdk_pixbuf-2.0.0.dylib (compatibility version 3601.0.0, current version 3601.0.0)
/usr/local/opt/glib/lib/libgio-2.0.0.dylib (compatibility version 5001.0.0, current version 5001.2.0)
/usr/local/opt/glib/lib/libgobject-2.0.0.dylib (compatibility version 5001.0.0, current version 5001.2.0)
/usr/local/opt/glib/lib/libglib-2.0.0.dylib (compatibility version 5001.0.0, current version 5001.2.0)
/usr/local/opt/gettext/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.5.0)
/usr/local/opt/glib/lib/libgthread-2.0.0.dylib (compatibility version 5001.0.0, current version 5001.2.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
gtkdialog_mac.png
 Description   
 Filesize   171.68 KB
 Viewed   100 Time(s)

gtkdialog_mac.png


_________________
== Here is how to solve your Linux problems fast ==
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 8659
Location: qld

PostPosted: Wed 15 Nov 2017, 04:31    Post subject:  

mavrothal wrote:
I was wondering if anyone has any idea under what conditions the gtkdialog elements of an app/script may be shown in reverse order
i.e. from bottom to top and from right to left (see pick below)

Should point out that this is with the mac version of gtkdialog Embarassed , but still...
The gtkdialog dependencies appear to be ok, btw
Code:
gm$ otool -L /usr/local/bin/gtkdialog # otool is the dll equivalent for ox x
/usr/local/bin/gtkdialog:
/usr/local/opt/gtk+/lib/libgtk-quartz-2.0.0.dylib (compatibility version 2401.0.0, current version 2401.31.0)
/usr/local/opt/gtk+/lib/libgdk-quartz-2.0.0.dylib (compatibility version 2401.0.0, current version 2401.31.0)
/usr/local/opt/pango/lib/libpangocairo-1.0.0.dylib (compatibility version 4001.0.0, current version 4001.3.0)
/usr/local/opt/pango/lib/libpango-1.0.0.dylib (compatibility version 4001.0.0, current version 4001.3.0)
/usr/local/opt/atk/lib/libatk-1.0.0.dylib (compatibility version 22210.0.0, current version 22210.1.0)
/usr/local/opt/cairo/lib/libcairo.2.dylib (compatibility version 11403.0.0, current version 11403.6.0)
/usr/local/opt/gdk-pixbuf/lib/libgdk_pixbuf-2.0.0.dylib (compatibility version 3601.0.0, current version 3601.0.0)
/usr/local/opt/glib/lib/libgio-2.0.0.dylib (compatibility version 5001.0.0, current version 5001.2.0)
/usr/local/opt/glib/lib/libgobject-2.0.0.dylib (compatibility version 5001.0.0, current version 5001.2.0)
/usr/local/opt/glib/lib/libglib-2.0.0.dylib (compatibility version 5001.0.0, current version 5001.2.0)
/usr/local/opt/gettext/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.5.0)
/usr/local/opt/glib/lib/libgthread-2.0.0.dylib (compatibility version 5001.0.0, current version 5001.2.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)


Said 'mac version' seems to exhibit the exact same problem of arm versions before jamesbond patched it... (take a close look at the screeny from your linked thread Wink ).

You can try applying the untested patch attached.

NB: possibly in automaton.c (refer to patch) there are other possibilities. '__APPLE__' may work. If not replace it with '__MACH__'.
apple_gtkdialog.patch.gz
Description  real gzip (lol)
gz

 Download 
Filename  apple_gtkdialog.patch.gz 
Filesize  343 Bytes 
Downloaded  3 Time(s) 

_________________
Puppy Linux Blog - contact me for access
Back to top
View user's profile Send private message Visit poster's website 
mavrothal


Joined: 24 Aug 2009
Posts: 2908

PostPosted: Wed 15 Nov 2017, 10:09    Post subject:  

01micko wrote:

Said 'mac version' seems to exhibit the exact same problem of arm versions before jamesbond patched it... (take a close look at the screeny from your linked thread Wink ).

You can try applying the untested patch attached.

NB: possibly in automaton.c (refer to patch) there are other possibilities. '__APPLE__' may work. If not replace it with '__MACH__'.


This was it!
Needed some more changes to build but it worked.
Find the final gtkdialog mac binary and patch in the original post

_________________
== Here is how to solve your Linux problems fast ==
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 82 of 82 [1226 Posts]   Goto page: Previous 1, 2, 3, ..., 80, 81, 82
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.1120s ][ Queries: 14 (0.0331s) ][ GZIP on ]