gtkdialog1-1.4

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#101 Post by goingnuts »

amigo: I use Geany...

I got comment to work:

Code: Select all

 /* amigo 20120322 comment handling */

"/*"(.|\n)*"*/" { ; }
"<!--"(.|\n)*"-->" { ; } 
Important to have space or tab before the first "/*".

"#ifdef" should be possible - the 0.7.20 uses it - but I haven't got it working.

Looking forward to here about your findings and fixes - thanks again for your valuable support!

I have the raw code for a swallow widget - at least I am able to swallow things:
Attachments
snap0008.png
Swallow running - rxvt was the target...
(31.3 KiB) Downloaded 500 times

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#102 Post by amigo »

Is that (swallow) using Xlib?
It is something useful and tempting for a few cases, but it might be overused also... This program already loads very slowly if there is any work to do at all...

Anyway, here are my notes:
###
gtk_button, gtk_complex
Various examples throw 'sh' errors:
bash-4.1# ./gtk_button
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `locate /(null)'

Do they have something in common? Yes!
This error shows when an 'input file' is
not found.
> operator error -fixed as a HINTS entry

###
In GTK1 'entry' widgets, 'max_length' does not work:
Gtk-WARNING **: gtk_object_set(): could not find argument "max-length" in the `GtkEntry' class ancestry
> fixed by commenting out, unless you want to try to implement it.

###
menu_test error with 'input' tag:
Warning: Could not stat 'Command:ls'.
Hmm, this seems to be simply wrong-usage in the example
from the original author. It happens in the <edit> widget
when '<input>ls</input>' is called.
> author's error

###
chooser_test and many others:
Using tags like '<label>gtk-no</label>'
inside <menuitem> tags shows stock icons in the menu pop-ups,
with standard text and accelerator keys activated.
gtk1 build does not do this, but simply shows the label 'gkt-no'
This traces back to automaton.c create_menuitem where GTK2
uses: gtk_image_menu_item_new_from_stock
and GTK1 uses:
gtk_menu_item_new_with_label
The function gtk_image_menu_item_new_from_stock is found
in the GTK2 sources includefile: gtkimagemenuitem.h:70
The menu items with icons are nice -maybe we could include
the source for gtk_image_menu_item_new_from_stock in compat.c ??

###
gtk_edit is not working. How do you save or display an edit?
If the edit widget is useless as is, then we need to fix it or get rid of it, I guess.

Nice work with the comments in lexer.l - I hadn't noticed ifdef's in the 0.7.20 flex code. Still, I think the reason we needed them means we shouldn't use them. It may be that we can't get every GTK2 feature supported by the original code to function the same and look at least similar in the gtk1 version. In those cases we should not support the feature at all -so no ifdef'ing would be needed for the parser files. I think that a single feature-set and syntax for both toolkits is central to this thing... I don't mind if it means we miss some minor feature available in gtkdialog -we'll never match what thunor is doing anyway by trying to support every gtk2 feature.

BTW, looking at gdmap chooser /tree proved not useful -it's a dir-select-only widget -maybe just right as the left-side of a rox/afx-filer tree-wiew, though...
The code from Xdialog would probably be better suited for inclusion in our tool if we want such a tree-view-dir-file-selector.

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#103 Post by goingnuts »

Thanks amigo! Its a pure gtk-swallow using "gtk_socket_steal". Very close to the gvim socket code - and is quite swift running here. But I have to hard code the windowID as I haven't figured how to get a windowID_by_name via gtk...
Well - it is just a try and maybe not so usable right now.

I will look through your list - I think I have the code to get edit working - and some of the errors might be a missing "locate" program? I created a script in /usr/bin/locate holding only:

Code: Select all

#!/bin/sh
echo ""
- it wont locate anything but I think the locate function is just taking up execution time. If an image is not where you told it to be - you will notice and fix the script-reference...

For the not supported images in menus and other placed I think we should replace the "gtk-" with "".

I will look at the things during the weekend.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#104 Post by disciple »

BTW, looking at gdmap chooser /tree proved not useful -it's a dir-select-only widget -maybe just right as the left-side of a rox/afx-filer tree-wiew, though...
Another possible source for that is gwhere - I've never used it with gtk1.2, but I presume it must be possible, as they still have a poll on the website asking which gtk people use it with...
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#105 Post by goingnuts »

disciple: Thanks for pointing at gwhere - seems to be a gently modded fileselect - but without trees and icons.

But its a great day:

Final release of gtkdialog1-1.0 - after 3 months of work - posted at the start of this thread. :D

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#106 Post by jpeps »

Required configuring --with-gtk=2.0 (since 2.0 uses a different configuration system re glib-config). I installed to a /tmp folder and tried it out.

Code: Select all

/tmp/gtkdialog1-1.0/usr/local/bin/gtkdialog1: unrecognized option '-G'
Probably DESTDIR didn't get all the needed files ?

edit: Oh....I see...still testing....

Seems like I'd have to rewrite all the scripts to even test it out. No geometry,
etc.,etc.,

Code: Select all

Error in line 2, near token 'window title=': syntax error

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#107 Post by goingnuts »

jpeps: Thanks for testing! Its puppy gktdialog2...

Geometry is supported - use "-g" - ex.:

Code: Select all

-g +400+200
Maybe try the examples to get an idea of what is running?

I will add that to the printout of gtkdialog1 --help in next update.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#108 Post by jpeps »

gtkdialog geometry requires -G to run.

next:

Code: Select all

Error in line 2, near token 'window icon-name=': syntax error
Removed icon-name, then

Code: Select all

Error in line 2, near token '<window>': Unknown tag.
removed <window> blocks, then

Code: Select all

Error in line 24, near token 'fs-action=': syntax error
I was more interested in how it works with the present scripts.

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#109 Post by amigo »

You will no doubt find many, many things that do not work if trying it with recent gtkdialog(3) or gtkdialog(4) scripts. gtkdialog3 (thats from 0.7.0 to 0.7.20 adds a few widgets and subtly uses extra attributes which are not supported by this version. gtkdialog4 (thunor's work) adds widgets *by the dozens*. We will porbably never catch up with that, although we are planning to backport fetures adn fixes from the 0.7.x series, at least.

The point of this tool is to be able to use the same scripts with either the gtk1 or gtk2 toolkit -without needing to make any changes to the scripts. Probably only the earliest puppy gtkdialog scripts will work unchanged with this tool as it is now. As goingnuts said, see the included examples to see what should be working -there is lots of room for improvement in the examples and documents which we are working on.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#110 Post by jpeps »

gotcha....thanks

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#111 Post by disciple »

goingnuts wrote:disciple: Thanks for pointing at gwhere - seems to be a gently modded fileselect - but without trees and icons.
What is that thing on the left hand side then? http://www.gwhere.org/screenshots/screenshot02.png
Am I misunderstanding something?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#112 Post by goingnuts »

disciple: No - I am. I thought you meant the fileselect - thanks for pointing that out! I will look again - just haven't fully understood the purpose of gwhere (or did not find documentation that could enlighten me) :oops:
Attachments
snap0009.png
(58.12 KiB) Downloaded 592 times

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#113 Post by disciple »

Gwhere is basically for cataloging the contents of removable disks. Put a disk in and mount it then run Gwhere and use the "Management" tab to add the disk to the catalogue.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

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

#114 Post by technosaurus »

As we progress toward gtkdialog4, we should have a todo list for each unsupported tag and its associated properties. The previously mentioned <window title="..." etc...> can be fixed with a sed script to be <wtitle>...</wtitle>... Other tags could be added and ignored similar to amigo's comment tag ... In fact printf tag:property to stderr could be the default for unrecognized tags. Does someone have a list of unsupported tags/properties BTW?

@goingnuts - any thought on a swallow example that would turn rxvt into mrxvt+ using notebook tabs.
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].

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#115 Post by jpeps »

technosaurus wrote: @goingnuts - any thought on a swallow example that would turn rxvt into mrxvt+ using notebook tabs.
note on mrxvt...it's great, as long as you have a script to keep closing out orphaned processes.

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

#116 Post by technosaurus »

jpeps wrote:note on mrxvt...it's great, as long as you have a script to keep closing out orphaned processes.
yes, mrxvt has a few annoying bugs like that - thus my interest in swallowing rxvt/urxvt/xvt/st instead... it may be worth it to instead make a standalone gtk enhanced version of tabbed ... though I would like to implement geany-like close buttons into the notebook tabs - that has been missing in gtkdialog afaik. If I could just wedge a flat button in with the label, all it would need is a callback with a widget_hide (I may do some experimenting with minimum profit text editor, to see if I could add it there as a practice excercise first)
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].

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#117 Post by jpeps »


goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#118 Post by goingnuts »

technosaurus wrote:As we progress toward gtkdialog4, we should have a todo list for each unsupported tag and its associated properties. The previously mentioned <window title="..." etc...> can be fixed with a sed script to be <wtitle>...</wtitle>... Other tags could be added and ignored similar to amigo's comment tag ... In fact printf tag:property to stderr could be the default for unrecognized tags. Does someone have a list of unsupported tags/properties BTW?

@goingnuts - any thought on a swallow example that would turn rxvt into mrxvt+ using notebook tabs.
I have no list but it would be handy to have...I have tried to add lexer rules from 0.7.20 to gtkdialog1 rules but until now without success.

The present swallow-widget is very dependent on the window name and it seems that a lot of programs alter the window name so it does not reflect the program name. rxvt only have one window with a name it seems - several instances of rxvt seems to be children with no name.

If the swallow widget should make it into gtkdialog1 I think it should be recoded to act on a windowID which the gtkdialog-script is responsible for finding (could be via xwininfo or other apps able of identifying windowID). That would also eliminate the problem of parsing window-names containing spaces...
I still lack to prove that it actually can be part of the GUI in gtkdialog1 as it is a standalone pop-up atm.

A second thought: The steal-socket depends on the client window being present to work - this might give initial windows flowing around before they are captured. So if the swallow widget could be responsible for both launching and stealing the client program...and we could the use the socket-plug/unplug gtk-mechanism (just like the gvim) in gtkdialog1..then the swallow-widget could stay as a standalone program...

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#119 Post by amigo »

I'm sticking to some low-hanging fruit I see.

0.7.20 only implements 3 new tags as far as I can see. They are <separator>, <progressbar> and <window>
Just this morning I've back-ported the separator tag from 0.7.20. It's just for use as a menuitem though. So, I implemented an hseparator and vseparator which can be used between vbox/hbox/frame tags.
For the separator tag, I did it the 'cheap' way by 'downgrading' from the GTK2-only 'gtk_separator_menu_item_new' to the dual-use
'gtk_hseparator_new', although and ifdef could be used there to
preserve the original GTK2 call if it maes a difference.

We've talked about the progressbar before, and I agree it is low-priority. The <window> tag is a little more involved because of the attributes allowed. But it should be easy to back-port that too, rather than try to sed-out stuff rom later scripts.

I'm pretty sure there are other usage cases in modern gtkdiaog scripts which cause problems under gtk1 -similar to what was happening with the 'max-length' attribute when invoking an 'entry' widget -the gtk1 version of GtkEntry doesn't recognize the option.

Anyway, there are a few other things that can be backported, like the integration of the gtklauncher in to the main program. There are some items in the TODO list already -some GTK1 implementations are still incomplete...

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#120 Post by goingnuts »

The 'max-length' in entry is supported in gtk1 - forgot to tell you...
Cool with the additions! Just tested some of the examples from 0.7.20: A great deal of the syntax is accepted by gtkdialog1 but might not be supported though.
How to coordinate? I have a few modifications lying around too and if we start making syntax from 0.7.20 acceptable (but maybe not responsive), we need to keep things updated...

Post Reply