Gtkdialog Development

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#501 Post by technosaurus »

thunor wrote:Added a terminal widget

Widget reference: terminal widget
Example: examples/terminal/terminal
Description: A VteTerminal widget that requires libvte support be built into Gtkdialog at compile time although it's not mandatory.
Nice, now to check resource usage with multiple terminals in notebook tabs ... If its not too bad, I may even rebuild geany with vte support.

I wonder how difficult it would be to write an rxvt wrapper to see if "gtkdialogterm" was already running (by checking for its named pipe) and open a new vte tab or start it up. I've never added a tab on the fly and the pipe would need to be monitored somehow.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#502 Post by zigbert »

thunor wrote:Added a terminal widget
:D :D :D

Well, I rather wait and see how Puppy supports this before including this widget into apps using terminal or Xdialog logbox.

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#503 Post by 8-bit »

Not to sound like too much of a pest, but what changes do I have to make to include the vte-2.72 in the gtkdialog compile?
Also, it seems like a stretch in that for the end user to be able to use a program that used terminal, they would need the version of gtkdialog compiled with the vte support.

I do have to say that the example screen you posted looks good though!
But again, until that updated version with vte support becomes mainstream, it would make for a program that would not work without a gtkdialog update and a source to get it.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#504 Post by technosaurus »

Gtkdialog -v could printf version _and_ compile time options like glade, vte,...
Then devs could en/dis-able features as required.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#505 Post by thunor »

Added "grabfocus" action function

Example: examples/miscellaneous/grabfocus
Description: Grabs the input focus for the widget within its window.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#506 Post by 01micko »

Slacko users...


I have just compiled vte and r375 for slacko.

Please use the vte attached as if you use the one in PPM gtkdialog segfaults

Have fun :)

For slacko use only!

(Install vte-0.28.2-i486.pet first, thanks to 8-bit)



---------------------------------------------------
Attachments
gtkdialog4-375-13.37-s.pet
(82.33 KiB) Downloaded 322 times
Last edited by 01micko on Tue 28 Aug 2012, 20:40, edited 1 time in total.
Puppy Linux Blog - contact me for access

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#507 Post by 8-bit »

01micko,
I had slacko linux installed and figured I would give it a try.
When I clicked on the gtkdialog... pet to install it, I never got any messages of it being installed as well as it seemed to not want to run other gtkdialog scripts.
I figure I probably messed up my pupsave in doing so. Live and learn I guess.
I am currently in Puppy Lupu 520 with a kernel version of 2.6.33.2 and I am refraining from trying it here.
I will most likely hope that I had a backup of my pupsave for slacko but I also will try the pets, which I downloaded with a pfix=ram load of slacko and see what happens.
I cannot remember what version of kernel the version of slacko I use has and it has the black background with the rainbow effect though.
I renamed the pets extension to "tar.gz" from "pet" to see what was inside also afterwards.
Anyway, for all the different kernel versions that have been used with slacko, one should be given just for reference.


Revised!!!!!
I am back with IMPORTANT NEWS!
When installing the PET packages kindly provided by 01micko, you should install the vte PET FIRST!
This is important!
If you do not, all of the gtkdialog scripts will stop working and that includes the Puppy Package Manager that installs the PET packages you click on!
So, in order:
(1) Install the vte PETS (Developer one is optional)
(2) Install the updated gtkdialog4
(3) Install the gtkdialog DOCS.

Remember again, that if you install the gtkdialog PET first, none of the other PETS will install and Puppy's programs that use gtkdialog will not work!

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#508 Post by 8-bit »

Thunor,
I tried out your new grabfocus function example and it works great in highlighting the function chosen with the buttons at least on some of them that are more prominent than others.
Also, if you read my reply to 01micko, one has to install the PETS for the new version (375) of gtkdialog in a certain order or PET installation wil be broken along with any other program or utility that uses gtkdialog.
I learned this the hard way!
My method of recovery was to rename the extension from PET to tar.gz, and extract it in the / directory and then copy all the vte files to their respective destinations.
Some would not know how to recover though and break Puppy if the PETS were installed in the wrong order though.

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#509 Post by thunor »

Added "presentwindow" action function

Example: examples/miscellaneous/presentwindow
Description: Presents a window to the user, raising it, deiconifying it, giving it the input focus and showing it if hidden.

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#510 Post by thunor »

technosaurus wrote:Gtkdialog -v could printf version _and_ compile time options like glade, vte,...
Then devs could en/dis-able features as required.
Done in r379.

Code: Select all

# gtkdialog --version
gtkdialog version 0.8.1 (C) 2003-2007 Laszlo Pere, 2011-2012 Thunor
Built with additional support for: Glade, VTE.

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#511 Post by 8-bit »

After I had installed the new version of gtkdialog, thanks 01micko,
I wanted to edit a PDF file and figured I would install pdfedit.
I installed it and it would not run because it needed some dependencies.
When I went to install the dependencies, gtkdialog again crashed.
To me this means that one has to use extreme caution in say installing a new game or utility that may hav dependencies that conflict with gtkdialog -v375.
I do not know if this is a case of gtkdialog being compiled with vte because when I tried to run a gtkdialog script without vte installed, nothing happened and when run from a terminal, gtkdialog reported it needed vte support.
Anyway, I wanted to pass that information along.
Also, as in the subject description, make sure you have a backup of your slackosave file to fall back on in case you mess up like I did.
Trying to remove a pet package you installed that crashed gtkdialog without the benefit of puppy package manager (requires gtkdialog) is an exercise in frustration! And this also goes for the SFS load on the fly utility not being accessible if gtkdialog has crashed.

I'll bet you never realized just how many things in Puppy depend on a working gtkdialog being present!

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#512 Post by vovchik »

Dear Thunor,

In Lucid I changed to this in configure.in:

Code: Select all

vte_lib="vte >= 0.23.5"
and VTE worked fine.

With kind regards,
vovchik

PS. Great work....:)

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#513 Post by zigbert »

I wonder if this behavior is intended or ?
the 3 lines
<action>echo $chk</action>
<action>activate:chk</action>
<action>echo $chk</action>

is not run in set order

Code: Select all

#!/bin/sh
export win='
<window>
 <vbox>
  <togglebutton label="Toggle">
   <variable>chk</variable>
   <default>true</default>
   <action>if true echo I am true</action>
   <action>if false echo I am false</action>
  </togglebutton>
  <button label="activate Toggle">
   <action>echo $chk</action>
   <action>activate:chk</action>
   <action>echo $chk</action>
  </button>
 </vbox>
</window>'
gtkdialog --program=win

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#514 Post by zigbert »

Could <hbox><input file> import a file with gtkdialog xml-code?

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#515 Post by thunor »

Code: Select all

vte_lib="vte >= 0.23.5"
Thanks vovchik, I've applied and commited that.

Sigmund, the activate behaviour is interesting. The "<action>echo $chk</action> " underneath the activate action: duplicate it several dozen times and run it again. The action list is iterated through in the signal-callback function for the signal related to that action. The activate action is a call to gtk-widget-activate(). I'm guessing that gtk is waiting until the signal-callback function containing the action list is exited before dealing with gtk-widget-activate(). Would it work instantly if run from another thread? I don't know, but anyway it looks as though the activate is animated to simulate the amount of time a user takes so attempting to read the target widget's variable from the source widget in that way I'd say is not something that could ever be relied upon.

Regarding "<hbox><input file>", I think you want to load-in i.e. parse another program and place it into the hbox? That would be cool. I've been working on the program loading/launching/parsing code quite a bit recently and I've discovered an issue with it that needs to be looked at: parsing another program -- such as when launching -- results in another call to gtk_main(). gtk_main() is the main loop and it can be entered multiple times but the timers are managed by gtk_main() and entering it again kills the timers. I've got that on my list of things to do, if it's even possible to solve. There are other issues too such as the action list in the source window that is launching the new window is prematurely terminated resulting in actions following a launch not being executed. The system feels like it's passing control rather than integrating.

I have thought already about creating widgets at application runtime which is an easy thing to do, but it is my opinion that gtkdialog wasn't designed for on-demand parsing; it looks and it feels like an afterthought. Possibly originally it was designed to be done once at the start and then that was it.
Last edited by thunor on Thu 30 Aug 2012, 22:39, edited 1 time in total.

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#516 Post by thunor »

Sigmund, I've refactored and slightly updated the table widget although I'm a bit worried about doing any more because the code is old, doing its own thing and its behaviour might be a result of that.

I've added tag attribute support so you can play with some properties and input file now works. I know that the signal handling is broken (it doesn't distinguish between <action> and <action signal="type"> although it could if I fixed it, but it would be nice if you could try it and let me know if it's still working as expected.

Regards,
Thunor

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#517 Post by zigbert »

Sigmund, I've refactored and slightly updated the table widget
I am shaking of eager :D

Trying to compile the latest

Code: Select all

svn checkout http://gtkdialog.googlecode.com/svn/trunk/ gtkdialog
cd gtkdialog
./autogen.sh
make
Halts during 'make'

Code: Select all

# make
(CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /root/gtkdialog/missing --run autoheader)
rm -f stamp-h1
touch config.h.in
cd . && /bin/sh ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
make  all-recursive
make[1]: Entering directory `/root/gtkdialog'
Making all in src
make[2]: Entering directory `/root/gtkdialog/src'
make  all-am
make[3]: Entering directory `/root/gtkdialog/src'
gcc -DHAVE_CONFIG_H -I. -I..    -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14   -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -pthread -I/usr/include/libglade-2.0 -I/usr/include/gtk-2.0 -I/usr/include/libxml2 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14   -DHAVE_GLADE_LIB=1  -DHAVE_VTE=0 -g -O2 -MT gtkdialog.o -MD -MP -MF .deps/gtkdialog.Tpo -c -o gtkdialog.o gtkdialog.c
mv -f .deps/gtkdialog.Tpo .deps/gtkdialog.Po
gcc -DHAVE_CONFIG_H -I. -I..    -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14   -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -pthread -I/usr/include/libglade-2.0 -I/usr/include/gtk-2.0 -I/usr/include/libxml2 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14   -DHAVE_GLADE_LIB=1  -DHAVE_VTE=0 -g -O2 -MT printing.o -MD -MP -MF .deps/printing.Tpo -c -o printing.o printing.c
mv -f .deps/printing.Tpo .deps/printing.Po
gcc -DHAVE_CONFIG_H -I. -I..    -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14   -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -pthread -I/usr/include/libglade-2.0 -I/usr/include/gtk-2.0 -I/usr/include/libxml2 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14   -DHAVE_GLADE_LIB=1  -DHAVE_VTE=0 -g -O2 -MT variables.o -MD -MP -MF .deps/variables.Tpo -c -o variables.o variables.c
variables.c:38:26: fatal error: widget_table.h: No such file or directory
compilation terminated.
make[3]: *** [variables.o] Error 1
make[3]: Leaving directory `/root/gtkdialog/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/gtkdialog/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/gtkdialog'
make: *** [all] Error 2

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#518 Post by vovchik »

Dear thunor,

I get the same error as Zigbert :(

Code: Select all

widget_table.h: No such file or directory
With kind regards,
vovchik

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#519 Post by thunor »

Ok, missing files commited (I forgot to "svn add" them) so it'll compile now.

I want to fix the signal managing code next. I'll do a commit for each part of the widget I work on so I can revert easily if needed.

The table widget is a GtkCList and I have found some functions you might be interested in:

gtk_clist_set_compare_func()
gtk_clist_set_sort_column()
gtk_clist_set_sort_type()
gtk_clist_sort()
gtk_clist_set_auto_sort()

Every single section of the API says "* is deprecated" but I can try things and we'll see what happens.

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#520 Post by zigbert »

Compiling version 388 worked fine.

This example script returns 'Segmentation fault' when trying to refresh:
I tested all other functions, and they seem to work as expected.

Code: Select all

#! /bin/bash

echo -e '1|Row 1 Column 2 |Row 1 Column 3\n2|Row 2 Column 2 |Row 2 Column 3\n3|Row 3 Column 2 |Row 3 Column 3' > /tmp/input_table
export MAIN_DIALOG='
 <vbox>
  <table>
    <width>500</width><height>200</height>
    <variable>TABLE</variable>
    <label>Column 1|Column 2|Column 3</label>
    <input file>/tmp/input_table</input>
    <action>echo $TABLE</action>
  </table>
  <hbox>
   <button ok></button>
   <button>
       <label>refresh</label>
       <action>refresh:TABLE</action>
   </button>
  </hbox>
 </vbox>
'

gtkdialog --program=MAIN_DIALOG

Post Reply