Gtkdialog Development

Under development: PCMCIA, wireless, etc.
Post Reply
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:

#106 Post by thunor »

Wow 01micko, that looks really nice, and somebody has good taste in music, well, Judas Priest at least :P

So can I update my Pmusic in lupu-520? I haven't been visiting other threads to be honest as I haven't had the time.

[EDIT] Ok, I found this thread, downloaded pmusic-1.9.2.pet and it doesn't look like yours, so I guess it's still being developed.

Regards,
Thunor

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

#107 Post by technosaurus »

thunor wrote:
technosaurus wrote:how about uncommenting and replacing
/usr/share/icons/Bluecurve/16x16/stock/
with
/usr/share/mini-icons/

so that we can use the plethora of available icons without having to specify the full path??
The main reason I ask is that the full path is typically not included in the .desktop files and parsing them to autogenerate a gtkdialog program requires some pretty slow workarounds... or missing icons

I have always fixed this in the past by making a symlink between
/usr/share/icons/Bluecurve/16x16/stock/ and /usr/share/mini-icons/
... or by including locate and updatedb
Why can't you write a shell function to check the existence of a file and if not found prefix it with "/usr/share/mini-icons/" and if still not found then attempt to find it with the locate program which you have installed?

[EDIT] I could code something on the command-line that enables you to pass a list of directories for find_pixmap to look through if it can't find an image file, and then another command-line option to specify to use locate as a last resort, but all these things are executed before the widgets are realized i.e. before the user sees anything, so I'm thinking why should I code all that when you can do it in the script. Doing it in the script also enables you to use a default image if locate fails too. Let me know what you think.

Regards,
Thunor
here is some code for icon finding ... I could only get it down to adding 0.3 sec (for parsing all .desktop icons) using shell compared to having it coded into gtkdialog

Code: Select all

if [ -e $Icon -a $Icon ];then Icon=$Icon
elif [ -e /usr/share/mini-icons/${Icon:-so.xpm} ];then Icon=/usr/share/mini-icons/${Icon:-so.xpm} #default Icon
elif [ -e /usr/share/pixmaps/$Icon ];then Icon=/usr/share/pixmaps/$Icon
else Icon=`find /usr/share -iname $Icon`
fi
it would add a lot more if /usr/share/icons/{hicolor,bluecurve}/... are searched for any kind of backward/cross-distro compatibility, but this seems to work for most puppy icons

it seems like this would be something that could be added to a gtkrc file, since libgtk actually looks in some of them itself (/usr/share/pixmaps and 1 or 2 others iirc)

EDIT
nevermind, we could probably just add something like this to the gtkrc file
pixmap_path "/usr/share/mini-icons:/another/path/to/more/icons"
(it should probably be in the default gtkrc since some gtk programs, especially window managers depend on it)
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
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#108 Post by 01micko »

thunor wrote:Wow 01micko, that looks really nice, and somebody has good taste in music, well, Judas Priest at least :P

So can I update my Pmusic in lupu-520? I haven't been visiting other threads to be honest as I haven't had the time.

[EDIT] Ok, I found this thread, downloaded pmusic-1.9.2.pet and it doesn't look like yours, so I guess it's still being developed.

Regards,
Thunor
I'll make an announcement soon about the new pequalizer app that zigbert and myself have been developing.
Zigbert has posted another alpha for Pmusic (1.9.3) in the slacko thread as well as the latest pequalizer-0.2.
If you can't wait you will find necessary deps (alsaequal, CAPS, ffmpeg-0.8 [x264 and libvpx required by ffmpeg, and probably mplayer, although if you keep the old ffmpeg libs then you need not bother with mplayer]) here - lupu only, hopefully all versions 5.0.0 to 5.2.5. (Ignore the old equaliser pet).

Have fun! :)
Puppy Linux Blog - contact me for access

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

#109 Post by 8-bit »

Just to be clear, does this new version of Pmusic require the updated version of gtkdialog?
If so, and not stated, I can see a lot of unhappy campers complaining.

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

#110 Post by 01micko »

8-bit wrote:Just to be clear, does this new version of Pmusic require the updated version of gtkdialog?
If so, and not stated, I can see a lot of unhappy campers complaining.
Well in this thread I guess it goes without saying "yes it requires at least revision 123".. however when I do post a thread for pequalizer I'll compile a binary and post a link. There will be some unhappy campers with gtk+ < 2.16! I think wary sneaks through ok, correct me if I'm wrong.

I'm not sure on which approach zigbert will take. Some features of Pmusic won't work without the latest ffmpeg, that also requires a newish puppy version. He may decide to "fork" such that older versions are bugfixed for older puppies but the newer versions enhanced along with developments in gtkdialog and ffmpeg. His choice.
Puppy Linux Blog - contact me for access

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

#111 Post by zigbert »

01micko wrote:I'm not sure on which approach zigbert will take. Some features of Pmusic won't work without the latest ffmpeg, that also requires a newish puppy version. He may decide to "fork" such that older versions are bugfixed for older puppies but the newer versions enhanced along with developments in gtkdialog and ffmpeg. His choice.
Pmusic 1 will still be available for ffmpeg-0.6/gtkdialog-0.7.20. Critical bugs may be fixed, but no further development. Pmusic 1.8.3 is still a reasonable good player.
Pmusic 2 will use recent ffmpeg and gtkdialog.

There had to come a switch in dependencies because of
- Improved streaming (the WebMusic module that allows playing of youtube music)
- New features in gtkdialog made it possible to offer a full-featured player-module... and more.... much more....
- ... Which lead to a new look and the structure for graphical themes had to be updated.
- It also gives me an opportunity to clean up some core-code.

Next release is expected to be the first beta... But I will be away for a couple of weeks (leaving tomorrow).


Sigmund

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#112 Post by BarryK »

01micko wrote:
8-bit wrote:Just to be clear, does this new version of Pmusic require the updated version of gtkdialog?
If so, and not stated, I can see a lot of unhappy campers complaining.
Well in this thread I guess it goes without saying "yes it requires at least revision 123".. however when I do post a thread for pequalizer I'll compile a binary and post a link. There will be some unhappy campers with gtk+ < 2.16! I think wary sneaks through ok, correct me if I'm wrong.
yes, Wary has gtk 2.20.1
[url]https://bkhome.org/news/[/url]

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#113 Post by Dougal »

technosaurus wrote:~line 368 of stringman.c

Code: Select all

/*      Thunor: Redundant.
        snprintf(tmp, 127, "/usr/share/icons/Bluecurve/16x16/stock/%s",
                        filename);
        tmp[127] = '\0';
        if (access(tmp, R_OK) == 0)
                return strdup(tmp);
how about uncommenting and replacing
/usr/share/icons/Bluecurve/16x16/stock/
with
/usr/share/mini-icons/
The standard location is /usr/share/icons. Anyway, there are ways for getting the info.
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

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

#114 Post by 8-bit »

One important thing we all have to remember is that thunor is updating gtkdialog for the linux community.
This does include Puppy, but it is not necessarily specific to it.
This would mean that a path to icons or pixmaps on Puppy may not be the same as another linux release.

IMO, thunor is doing a great job.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#115 Post by sunburnt »

How about changing the syntax from XML to more like Basic.
Easier to type, easier read and understand, etc.
Only the /hbox, /vbox, and /bookmark tags need companion closing tags!
Lots of tag "<>" qualifiers must be typed, and they do nothing!

I suggested this years ago, maybe it`ll make some sense now... ( timing :wink: )

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

#116 Post by 8-bit »

If closing tags are missing, gtkdialog will not run the script, since that is the way it is designed.
To modify it as you suggest would make it another gtk scripting language.
It also would break almost all Puppy programs that were written using gtkdialog.

But if you would like to try your hand at creating a scripting language, there is no one stopping you but you.

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

#117 Post by technosaurus »

Someone already started a ***** to gtkdialog "compiler" of sorts iirc ... in programming I think
Dougal wrote:
technosaurus wrote:~line 368 of stringman.c

Code: Select all

/*      Thunor: Redundant.
        snprintf(tmp, 127, "/usr/share/icons/Bluecurve/16x16/stock/%s",
                        filename);
        tmp[127] = '\0';
        if (access(tmp, R_OK) == 0)
                return strdup(tmp);
how about uncommenting and replacing
/usr/share/icons/Bluecurve/16x16/stock/
with
/usr/share/mini-icons/
The standard location is /usr/share/icons. Anyway, there are ways for getting the info.
So /usr/share/icons/hicolor/16x16/ would be the standard and puppy should have a compatibility symlink to its mini-icons directory as I did before with bluecurve ... or just use a gtkrc file.
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
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#118 Post by sunburnt »

I hope Thunor can straighten out gtkDialog, it`s a mess.
And probably the biggest sore point of Puppy ( GUI`s ), and for it`s development.

I just thought the crappy XML syntax would benefit from a rewrite also.
It could always be made to accept both types of syntax ( of course ).

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

#119 Post by thunor »

sunburnt wrote:How about changing the syntax from XML to more like Basic.
Easier to type, easier read and understand, etc.
Only the /hbox, /vbox, and /bookmark tags need companion closing tags!
Lots of tag "<>" qualifiers must be typed, and they do nothing!

I suggested this years ago, maybe it`ll make some sense now... ( timing :wink: )
BASIC is a programming language, XML is a markup language.

What's a "/bookmark" tag?

The closing tags trigger widget creation. Can you let me know which widgets don't require a closing tag please as it could be a bug and should be fixed.

Which are the tag qualifiers that do nothing? If you can tell me then I'll investigate them.
sunburnt wrote:I hope Thunor can straighten out gtkDialog, it`s a mess.
And probably the biggest sore point of Puppy ( GUI`s ), and for it`s development.

I just thought the crappy XML syntax would benefit from a rewrite also.
It could always be made to accept both types of syntax ( of course ).
If you can tell me which parts are a mess then I can make a feature request in the issue tracker to improve them.

I don't know anything about Gtkdialog being a "sore point of Puppy" as I haven't been using Puppy Linux for that long.

Why of course can it always be made to accept both types of syntax?

If you'd like to create some issues yourself within the issue tracker then feel free. Then all Linux users can benefit from your bug and usability reports :)

Kindest regards,
Thunor

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

#120 Post by 8-bit »

I now use a script file to keep current on gtkdialog.
I placed it in the base directory created by the initial download using
"svn checkout http://gtkdialog.googlecode.com/svn/trunk/ gtkdialog" from a command prompt.

The script I use is this:

Code: Select all

 #!/bin/bash
svn update
make clean
./autogen.sh
make
 cd src
 cp -a gtkdialog gtkdialog3
 strip gtkdialog3
cp -af gtkdialog3 /usr/sbin
   `xmessage -name 'Gtkdialog Update' -center -bg orange -fg black " Update of Gtkdialog3 completed."`
It automates the process of keeping gtkdialog current with thunor's additions and revisions.

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

#121 Post by 8-bit »

I have been experimenting with having more than one child window opened and controlled by the main_dialog window.
I have found that the child windows have to be opened in a specific order or it causes a crash.
They can be closed from the main window without having to deal with order that they were launched.

I used 3 gtkdialog examples to create the script.
I am attaching it for your comments and also to show it is doable.
Edit: fixed version attached
Attachments
2window_child.tar.gz
revised script to open 2 child windows and control closing from the main window as well as the child windows. Revision courtesy of thunor
(1.63 KiB) Downloaded 357 times
Last edited by 8-bit on Fri 29 Jul 2011, 17:33, edited 2 times in total.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#122 Post by sunburnt »

thunor; Sorry... I meant "notebook" ( It`s been awhile... ).
I think you understood what I meant about Basic and XML "syntax" types.
The closing tags are not needed because the start of the next control description
ends the previous control`s description, closing`s not needed, it`s already done.

"Basic" type of syntax example:

Code: Select all

Button
    Text OK
    Action /root/my-applications/bin/app_exe
Button
    Text Close
    Action EXIT
Simple, clean, easy to read and write, no messy code like XML... Right?

gtkDialog`s biggest "mess" is:
The way control properties are set is random, no straight forward one way to do it.
The Basic syntax example above uses the same format for all controls and properties.

And then there`s all the unnecessary <> tags, they do nothing to describe the control !
They are just part of the XML syntax description, but serve no purpose...

There can always be multiple input file parsers for different syntax types.
I wrote a converter for Basic to gtkDialog ( like the Basic to C converter "BaCon" ).
But it would be much better if it was contained inside of gtkDialog, then
the "crappy" XML syntax could be depreciated over a few version releases,
thus easing the transition for Puppy`s GUIs that has some folks worried.
If I understand, gtkDialog just converts it`s syntax to that of GTK+ and runs it.

These are obvious corrections that could be made...
Any of them will improve gtkDialog, you must decide:
1) If you agree with me that they are improvements.
2) If you want to do it.
3) If you think it`s worth the trouble to do it.

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

#123 Post by technosaurus »

A common way to close an xml tag that doesn't encompass other elements is to end it with "/>" instead of "></sometag>" , but I've never bothered to try it.

If you want basic syntax for gtk, there are projects that do that.
Same goes for python, C++, c#, .net, tcl...

However, it is _possible_ to do what you are asking by conversion (this is essentially part of what a compiler does) ... you are just using tracking of multiple n * \t (pita to implement) instead of just looking for the next <tag...
In other words, it may be easier to write, but it is typically slower to parse, not that the existing parser is particularly fast, considering it _requires_ libxml2 while gtk can be built with expat (which is much smaller) and glib has its own GMarkup* xml parser - don't ask me why gtk doesn't just use it.
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
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#124 Post by sunburnt »

Hi technosaurus; I haven`t seen any Basic to GTK+ converters other than the extra stuff
that BaCon comes with, it may be very good though. Need to look at it...
Do you have any links to other Basic to GTK+ converters like this?

Speed at parsing... Seems like it would be faster the fewer characters to read.

Still, all in all it is only a little work to write a converter, I wrote many in VisualBasic
and I`ve written a few in Bash script, like the Basic to gtkDialog I mentioned.
The gtkBasic file could be executed, or the gtkDialog file it made could be saved.
### gtkDialog should be able to produce a GTK+ executable file that`d run faster.

But as I said above, doesn`t anyone else agree that the Basic code is way
easier to read, write, and understand than the crap XML syntax ?????
That alone should be enough for everyone to like and support this idea.

And again... It is so easy for it to support several syntax types... Why not?

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

#125 Post by disciple »

But as I said above, doesn`t anyone else agree that the Basic code is way easier to read, write, and understand than the crap XML syntax ?????
Well, it does seem fashionable to believe that BASIC is the root of all evil ;)
But isn't Barry himself quite a fan of BASIC? (hence why BaCon is included)

There is also freebasic, and gtkbasic / Puppybasic - or do they only do guis via glade?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

Post Reply