Gtkdialog Development

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#496 Post by thunor »

zigbert wrote:The issue with <checkbox> is similar to the <entry> - You can't actually rely on that it refreshes EVERY time.
...
I have made some extras in pMusic to overcome this issue. It now very seldom occur.
- For some reason <input>cat works better than <input file>
...
I tried other widgets such as edit and text and the same thing happened so if the input file is being updated regularly then developers will have to accept that there could be conflicts depending on the frequency.

You can duplicate this behaviour by running these two lines in separate terminals:

Code: Select all

while [ true ]; do date > /tmp/test; sleep 0.1; done

while [ true ]; do echo /tmp/test="`cat /tmp/test`"; sleep 1; done
If you increase "sleep 0.1" more and more towards 1 then you'll experience fewer errors.

Everybody's going to have to design around minimising conflicts because otherwise I'm going to have to offer file locking.

Anyway, it's good that you have worked around it for pMusic :)

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

#497 Post by 8-bit »

In the example /usr/share/doc/gtkdialog/examples/text/text_advanced, how would one get fileselect to display the contents of the file selected in the txt0 windows instead of just the file name with path of the file?
I am open to a how to from anyone on how to do this.

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

#498 Post by thunor »

smokey01 wrote:Thunor is there an IDE tool/interface for developing gtkdialog code similar to glade?

I really struggle sometimes although there is a lot of good advice here?

I see Barry is asking for the same tools a couple of posts back.

It would be great.
Gtkdialog-IDE

Gtkdialog apps are quite oftenly constructed using shell script so you may as well use Geany and get stuck in writing by hand from the outset. If you want to see what it looks like just run it :D

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#499 Post by smokey01 »

thunor wrote:
smokey01 wrote:Thunor is there an IDE tool/interface for developing gtkdialog code similar to glade?

I really struggle sometimes although there is a lot of good advice here?

I see Barry is asking for the same tools a couple of posts back.

It would be great.
Gtkdialog-IDE

Gtkdialog apps are quite oftenly constructed using shell script so you may as well use Geany and get stuck in writing by hand from the outset. If you want to see what it looks like just run it :D
I have already looked at Gtkdialog-IDE and its not as intuitive as I would like.
I am currently using Geary to write bash and gtkdialog but I was hoping to find something that would help me develop scripts much faster.

Thanks

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

#500 Post by thunor »

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.

You're going to need to know which version of gtk+ and glib you're running on your computer so that you can download the correct version of libvte. "pkg-config --modversion gtk+-2.0" will assist you with gtk+ and for glib use "pkg-config --modversion glib-2.0". I'm using lupu 520 and I discovered that I needed vte-0.27.2 by trial and error, but I have some information that might assist you:

The last version supporting GTK_REQUIRED=2.14.0 with GLIB_REQUIRED=2.22.0 is vte-0.24.3

The last version supporting GTK_REQUIRED=2.20.0 with GLIB_REQUIRED=2.22.0 is vte-0.27.2 (suitable for lupu 520)

The last version supporting GTK_REQUIRED=2.20.0 with GLIB_REQUIRED=2.26.0 is vte-0.28.2

vte-0.29.0 and above are for gtk+3.

You can locate GTK_REQUIRED and GLIB_REQUIRED in "configure.in" within the libvte package.

Within gtkdialog's configure.in I have set the minimum version of libvte to be 0.24.3, but if you need to go back further than that then change it to the version that you've downloaded and let me know and I'll update the code. You're going to want to run "make clean && make" after editing configure.in to be certain everything is up-to-date.

Compiling and Installing libvte
It's the usual "./configure --prefix=/usr && make && make install". It'll install lots of "vte-0.0.mo" files into /usr/share/locale so you might want to be selective about those, and docs into /usr/share/gtk-doc/html/vte-0.0 which is 556kB you can purge there, or make your own pet package or get someone else to do it :) The Beyond Linux From Scratch page for libvte has some interesting configure options.
Attachments
terminal.png
(8.66 KiB) Downloaded 1398 times
Last edited by thunor on Sat 25 Aug 2012, 17:33, edited 5 times in total.

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.

Post Reply