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 23 Apr 2014, 07:12
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Can`t get gtkDialog3 version of app. to work. [Solved]
Post new topic   Reply to topic View previous topic :: View next topic
Page 3 of 4 [53 Posts]   Goto page: Previous 1, 2, 3, 4 Next
Author Message
8-bit


Joined: 03 Apr 2007
Posts: 3286
Location: Oregon

PostPosted: Tue 16 Mar 2010, 22:17    Post subject:  

potong,
If I may be so bold as to ask, where are you getting this info from?
Is it from examining the source code or is their a site we can access to see more?
Back to top
View user's profile Send private message 
trio


Joined: 21 Dec 2008
Posts: 1788
Location: अनुमोदना

PostPosted: Tue 16 Mar 2010, 23:08    Post subject:  

haha, potong is "the guru" of gtkdialog..he's the one responsible that make Zigbert ditched "ptooltips" after potong told him that gtkdialog has inbuilt 'tooltips'...many hidden things inside gtkdialog were introduced to us by him...
_________________
PET Maker|WbarCC|My Website
Back to top
View user's profile Send private message 
potong

Joined: 06 Mar 2009
Posts: 88

PostPosted: Tue 16 Mar 2010, 23:15    Post subject:  

8-bit:
You can find a lot of information here http://library.gnome.org/devel/gtk/stable
Also see my original post http://murga-linux.com/puppy/viewtopic.php?t=38608
For instance: see the the window widget here http://library.gnome.org/devel/gtk/stable/GtkWindow.html and look in particular at its properties
Code:
Properties

  "accept-focus"             gboolean              : Read / Write
  "allow-grow"               gboolean              : Read / Write
  "allow-shrink"             gboolean              : Read / Write
  "decorated"                gboolean              : Read / Write
  "default-height"           gint                  : Read / Write
  "default-width"            gint                  : Read / Write
  "deletable"                gboolean              : Read / Write
  "destroy-with-parent"      gboolean              : Read / Write
  "focus-on-map"             gboolean              : Read / Write
  "gravity"                  GdkGravity            : Read / Write
  "has-toplevel-focus"       gboolean              : Read
  "icon"                     GdkPixbuf*            : Read / Write
  "icon-name"                gchar*                : Read / Write
  "is-active"                gboolean              : Read
  "modal"                    gboolean              : Read / Write
  "opacity"                  gdouble               : Read / Write
  "resizable"                gboolean              : Read / Write
  "role"                     gchar*                : Read / Write
  "screen"                   GdkScreen*            : Read / Write
  "skip-pager-hint"          gboolean              : Read / Write
  "skip-taskbar-hint"        gboolean              : Read / Write
  "startup-id"               gchar*                : Write
  "title"                    gchar*                : Read / Write
  "transient-for"            GtkWindow*            : Read / Write / Construct
  "type"                     GtkWindowType         : Read / Write / Construct Only
  "type-hint"                GdkWindowTypeHint     : Read / Write
  "urgency-hint"             gboolean              : Read / Write
  "window-position"          GtkWindowPosition     : Read / Write

Remember most widgets have hierarchy
Code:
GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBin
                                 +----GtkWindow
                                       +----GtkDialog
                                       +----GtkAssistant
                                       +----GtkPlug

and so their properties can be used too.
To get a list of widgets used by gtkdialog you'll have to inspect the source code. It's pretty old now so some of the widgets are deprecated.

HTH

Potong
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 4985
Location: Arizona, U.S.A.

PostPosted: Wed 17 Mar 2010, 00:38    Post subject:  

Hope It Helps ??? Big time..!!!
This is more info about gtkDialog than I`ve seen in the 4 years I`ve been trying to use it!

potong; If you would be so kind...

-f, --file=filename Get the GUI description from a regular file.
Use like this: gtkdialog3 -f /path/file.gtk -G "$WIDTH"x"$HEIGHT"+"$LEFT"+"$TOP" &
And the body of the gtkDialog code is in: /path/file.gtk ( "kinda" like your example showed ).

-e, --event-driven=filename Execute the file as an event driven program.
This I have no idea where to begin with how to use it...
Back to top
View user's profile Send private message 
potong

Joined: 06 Mar 2009
Posts: 88

PostPosted: Wed 17 Mar 2010, 01:32    Post subject:  

sunburnt:
Here's a program written in two ways to show the different options.

First the --file=filename and a shell wrapper script to run it
Code:
#!/bin/sh -a
display(){ echo "Display: ${!1}"; }
cat <<EOV >/tmp/gui_file
<window>
 <vbox>
  <text label="Run from a terminal and monitor the messages"></text>
  <entry>
   <variable>ENTRY</variable>
   <default>Here is some text</default>
  </entry>
  <button use-underline="true" label="_Display">
   <action>display ENTRY</action>
  </button>
  <button cancel></button>
 </vbox>
</window>
EOV
gtkdialog3 -f /tmp/gui_file

now highlight the code above and in a terminal type:
Code:
xclip -o >/tmp/a; chmod +x /tmp/a; /tmp/a

Observe the messages when you click Display.
Also type:
Code:
cat /tmp/gui_file

and see the gui description.

Secondly --event-driven=filename
Code:
#!/usr/sbin/gtkdialog3 -e
display(){ echo "Display: ${!1}"; }
export MAIN_DIALOG='
<window>
 <vbox>
  <text label="Run from a terminal and monitor the messages"></text>
  <entry>
   <variable>ENTRY</variable>
   <default>Here is some text</default>
  </entry>
  <button use-underline="true" label="_Display">
   <action>display ENTRY</action>
  </button>
  <button cancel></button>
 </vbox>
</window>
'

now highlight the code above and in a terminal type:
Code:
xclip -o >/tmp/b; chmod +x /tmp/b; /tmp/b

You'll see the same program but run using the gtkdialog3 program directly.

HTH

Potong
Back to top
View user's profile Send private message 
zigbert


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

PostPosted: Wed 17 Mar 2010, 03:54    Post subject:  

Thank you potong. Great stuff here.
I have updated tips and tricks.
I have not added your wild progressbar examples...... I need a newer gtk to get it working.


Sigmund

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


Joined: 03 Apr 2007
Posts: 3286
Location: Oregon

PostPosted: Wed 17 Mar 2010, 11:59    Post subject:  

After reading some of the options for a gtkdialog window, trying them and not having them work, I begin to wonder if those options are even in GTK-2.0 that is included with Puppy.
Or is it a matter of not structuring the code line right for the option to work.
It is frustrating to have a list of window options that are supposed to let you do something with a window and then not have it work.
Also, they seem to be geared for writing a GUI in C rather than just a script.
As an example, Zigbert's size and position script lets you resize a window to it's original size. But using the same code segments in another script for the position and resize with save, takes the new size as the minimum window size and will not let you resize the window to it's original size.
Show me a short script that will let me shrink a window to it's original size and I will be happy.
I already tried "min_height=[height]" as an option along with "allow_shrink="true"" and I still cannot get a window back to it's original size using the mouse.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 4985
Location: Arizona, U.S.A.

PostPosted: Wed 17 Mar 2010, 14:09    Post subject:  

8-bit; try this:
Code:
export GUI="<window title=\"GUI\" allow_shrink=\"true\"><vbox>
  <button><label>Exit</label><action type=\"Exit\">exit</action></button></vbox></window>"
gtkdialog3 -p GUI -G 200x200+20+40

It will shrink all the way down to almost nothing for me... Wink
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3286
Location: Oregon

PostPosted: Wed 17 Mar 2010, 15:49    Post subject:  

sunburnt wrote:
8-bit; try this:
Code:
export GUI="<window title=\"GUI\" allow_shrink=\"true\"><vbox>
  <button><label>Exit</label><action type=\"Exit\">exit</action></button></vbox></window>"
gtkdialog3 -p GUI -G 200x200+20+40

It will shrink all the way down to almost nothing for me... Wink


Thank you, it works! My mistake was including a default_height and default_width in the <window .....> line.
But I also noticed in the docs potong gave links to that on can supposedly set a min-width and min-height for the window.
I tried those, with your allow_shrink and they do not stop me from shrinking the window to a very small size.
Again, it may just be a matter of how to phrase those options.
But I guess we learn as we go along.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 4985
Location: Arizona, U.S.A.

PostPosted: Wed 17 Mar 2010, 16:42    Post subject:  

I made a small gtkDialog tester to check the Tags in large files.
Now it needs to be expanded to check other parts of the syntax.
The file: /root/my-applications/bin/gtkdialog.test
Code:
#!/bin/sh
#####      Test gtkDialog file for errors.
N=0
FILE=`Xdialog --stdout --title "  Select gtkDialog file." --fselect /mnt/home/apps/driveman 0 0`
[ $? -gt 0 ]&& exit
echo "    ###   NO Tag problems found.  ###" > /tmp/gtk-test.results ; GTK=$(<$FILE)

for TAG in vbox hbox pix note list edit text tree menu label input entry radio check table frame combo width height action button window variable progress @
do                                                                                             #####      Read the entire file each loop looking for the Tag.
   [ $TAG = '@' ]&& break
   PLUS=`echo "$GTK" |grep -o '<'$TAG | wc -w`
   MINUS=`echo "$GTK" |grep -o '</'$TAG | wc -w`
   N=$(($PLUS - $MINUS)) ; [ $N -eq 0 ]&& continue
   errTAG='' ; [ $N -gt 0 ]&& errTAG='/' ; N=`echo $N |sed 's/^-//'`
   echo "    ###   $errTAG$TAG = $N" >> /tmp/gtk-test.results
done
xmessage -title "  gtkDialog Test" "
    $FILE   

    ( Tag Type ) = ( Number Missing )   

`cat /tmp/gtk-test.results`
   " &
rm -f /tmp/gtk-test.results


### Revised gtkDialog tester... Does most of the tags.

### If you have more Tags to add, please post them below...
### Also any suggestions on how to make it check more... ( Tags out of place, Etc...)
.

Last edited by sunburnt on Thu 18 Mar 2010, 01:06; edited 16 times in total
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3286
Location: Oregon

PostPosted: Wed 17 Mar 2010, 18:19    Post subject:  

Sunburnt,
Kudos on that checker start.
I can see that it checks vbox and hbox currently but I see also what you mean about the fact that it could be expanded to check action, button, frame, combobox, etc.
The possibilities are there.
I tried it on the /root/my-applications/driveman/driveman file and it worked fine. And showed zero for both hbox and vbox.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 4985
Location: Arizona, U.S.A.

PostPosted: Wed 17 Mar 2010, 18:29    Post subject:  

I`m reworking the settings GUI for driveman and it`s got an "unhelpful" error.

** ERROR **: gtkdialog: Error in line 31, near token '</hbox>': syntax error

There`s only 2 </hbox> tags in the script, line 31 is the bottom tag:
Code:
#! /bin/sh
export SETTINGS="
<window title=\".  DM   Settings\">
<hbox><vbox>
  <frame  Max. Drive List Height ><vbox>
    <text><label>Set Maximum Number of</label></text>
    <text><label>Drives to Show in Drive List.</label></text>
    <hbox>
    <button><label>Increase</label><action>$1/driveman lstHEIGHT up</action>
      <action type=\"clear\">HEIGHT</action><action type=\"refresh\">HEIGHT</action></button>
    <button><label>Decrease</label><action>$1/driveman lstHEIGHT dn</action>
      <action type=\"clear\">HEIGHT</action><action type=\"refresh\">HEIGHT</action></button>
    <entry><variable>HEIGHT</variable><input>cat $1/lstHEIGHT.set</input>
      <width>40</width><height>25</height></entry>
    </hbox></vbox></frame>
  <frame  Bootup Control><vbox>
    <checkbox><label>Run DriveMan at Bootup.</label>
      <variable>DMBOOT</variable><action>$1/driveman dmBOOT</action></checkbox>
    <checkbox><label>Run Auto-Drive at Bootup.</label>
      <variable>AUTOBOOT</variable><action>$1/driveman autoBOOT</action></checkbox>
  </vbox></frame> 
</vbox><vbox> 
  <frame  Auto-Drive Control ><vbox>
    <checkbox><label>Start or Stop Auto-Drive.</label>
      <variable>AUTODRV</variable><action>$1/driveman autoDRV</action></checkbox>
    <checkbox><label>Auto-Drive Pops up ROX.</label>
      <variable>AUTOROX</variable><action>$1/driveman autoROX</action></checkbox>
  </vbox></frame>
    <button><label>Exit</label><action>exit</action></button>
</vbox></hbox>"
gtkdialog3 -p SETTINGS &
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 4985
Location: Arizona, U.S.A.

PostPosted: Wed 17 Mar 2010, 20:06    Post subject:  

.
### NOTE: I posted a " revised " gtkDialog tester above that does most of the Tags...
Back to top
View user's profile Send private message 
seaside

Joined: 11 Apr 2007
Posts: 878

PostPosted: Wed 17 Mar 2010, 20:09    Post subject:  

potong wrote:
sunburnt:
Here's a program written in two ways to show the different options.


Secondly --event-driven=filename
Code:
#!/usr/sbin/gtkdialog3 -e
display(){ echo "Display: ${!1}"; }
...............



Just wanted to add that using the "#!/usr/sbin/gtkdialog3" event form requires that gtkdialog3 is symlinked to gtkdialog, otherwise it errs. I ran into this earlier using the "event driven" form of gtkdialog - no matter from a file or on the command line.

Potong, thanks for supplying all this great information on Gtkdialog. It is immensely helpful.

Regards,
s
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 4985
Location: Arizona, U.S.A.

PostPosted: Wed 17 Mar 2010, 20:13    Post subject:  

seaside; Yep, I ran into that problem awhile back using gtkDialog that way.
I had marginal luck with it. But with potong`s help it may bare fruit yet...
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 3 of 4 [53 Posts]   Goto page: Previous 1, 2, 3, 4 Next
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.1060s ][ Queries: 12 (0.0104s) ][ GZIP on ]