Gtkdialog Development

Under development: PCMCIA, wireless, etc.
Post Reply
Message
Author
User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#91 Post by 8-bit »

BarryK,
In including examples, when devx is loaded, the example in /usr/share/doc/gtkdialog3/examples called 07.02-list_actions is broken.
When it is run, the processor maxes out and the example has to be killed to recover.
So removal of that example is suggested.

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

#92 Post by 8-bit »

thunor,
I noticed in the hscale/vscale code that no provision is made to add to an old scale.
So could that possibly be what is messing up the positioning on the scale of the markup text?
As an example, if I run the example you provided, the type2 scale is displayed with all the markup text on the vertical scale displayed on the same line/area.
Since each item is calling the code as a new scale, that seems to be the case.
Could a mod be made to call old scale to add marks with markup after the first item for the scale as a test?

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

#93 Post by technosaurus »

With *scale and refreshable pixmaps, a unified tray applet is now possible using gtkdialog.... although gtkstatusicon would make it work outside of jwm (in wm without swallow capacity)

For example:
Volume, battery, CPU, memory etc...

Glade can do gtkstatusicon, but if it is deprecated perhaps it's a poor choice?
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:

#94 Post by thunor »

vovchik wrote:A timer widget? Sounds tempting! :)
I'll add a feature request for it. [EDIT] done.
amigo wrote:I *will* be compiling your new code pretty soon(on a system with gtk-2.16.6), though, and will gladly notify you if any problems come up.
Great :) The more folk testing, the merrier.
zigbert wrote:Regarding gtk compatibility, I think there is an issue with h/vscale when using scale-step that is not an integer. I get error in Puppy 5.11, but not in the latest Spup.
If you can duplicate it then tell me and I'll take a look, otherwise just tell me what happened. BTW your Pmusic looks fantastic :D
BarryK wrote:When I get onto doing that, I will trawl through this thread...
All my examples are listed in the Development section to make your life easier, if you want to use them :)
8-bit wrote:I noticed in the hscale/vscale code that no provision is made to add to an old scale.
...
Since each item is calling the code as a new scale, that seems to be the case.
Could a mod be made to call old scale to add marks with markup after the first item for the scale as a test?
You may be surprised to find that all directives and tag attributes are in fact static except that <input> and <input file> enable the application developer to alter the input data. Therefore adding marks and markup to an existing "shown" scale at a later time isn't possible.

I've tried a number of things to get the vertical markup to position correctly including fixing the bar size so that GTK doesn't resize it. The code that deals with both scales is identical since they share the GtkScale base class which includes the simple gtk-scale-add-mark function.

You have the source code: in widgets.c:126 you'll find the function fill_scale_by_items. Comment-out the "#ifdef DEBUG" and the "#endif" a few lines down and after compiling it watch the values in the terminal. I can't do anything else with it at the moment and the first thing I would do is test it on another Linux distro. Also I haven't even found a GTK+ 2 app using marks let alone markup.

Regards,
Thunor

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

#95 Post by 8-bit »

I tend to agree that the way the code is written in gtk 2.16, there is not a whole lot one can do.
That is considering that a lot of applications Puppy uses require gtk version 2 and gtk version 3 has not assured backward compatability and would break a lot of applications.
Also, you are correct in that I too have not seen any applications at all that use the vscale.
It appears though that Zigbert has implemented a horizontal scale in Pmusic.
And, It looks really great! Good work there!

One thing that bugs me is that the original maker of gtkdialog, if it was indeed him, included an example that just flat out does not work.
It is the list_actions one.
No one even attempts to use it since it is broken.

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

#96 Post by disciple »

BarryK wrote:The "official" gtkdialog PET on ibiblio.org 'common' repo is thunor's revision 86 I think. I'm going to upgrade it soon, and I want to put in examples to illustrate the new features, well more examples to illustrate old features also.

The PET has /usr/share/doc/gtkdialog3/examples (in devx), which are the original ones.

I was thinking of adding /usr/share/doc/gtkdialog3/examples_extra.

When I get onto doing that, I will trawl through this thread, but if you want to send any to me, just short examples of a particular feature, not full applications, kindly email them: STARTbkaulerATgmailDOTcomEND
Put "gtkdialog" somewhere in the email title.
Rather than an examples_extra, why not add the new examples in with the old ones, upstream? It seems senseless to maintain puppy specific changes...
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

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

#97 Post by 8-bit »

It is also my understanding, maybe wrong, that /usr/doc/gtkdialog/examples is only available when you install devx for the version of Puppy you are using.
So I would suggest making it part of devx so as to keep the Puppy ISO small.

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

#98 Post by BarryK »

8-bit wrote:BarryK,
In including examples, when devx is loaded, the example in /usr/share/doc/gtkdialog3/examples called 07.02-list_actions is broken.
When it is run, the processor maxes out and the example has to be killed to recover.
So removal of that example is suggested.
Thanks, I've removed it.
[url]https://bkhome.org/news/[/url]

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

#99 Post by thunor »

Overhauled the menu and menuitem widgets - part 1

I've added quite a few useful things that I may as well announce now since I've got a fair amount of work left to do before the menu system is adequately updated and extended.
  • The "icon" tag attribute now loads icons set to 16x16 and not 20x20.
  • It's now possible to use the <menuitem use-stock="true" label="gtk-stock_id"> GTK property method of setting stock images as well as the easier custom stock="gtk-stock_id" method.
  • The menu widget now accepts tag attributes so that <menu label="_File" use-underline="true"> works.
  • Menu items now support accelerators using the "accel-key" and "accel-mods" custom tag attributes and both can be entered as either decimal or hexadecimal values.
  • Added support for the <visible> directive although it's already possible to use the GTK "sensitive" property.
The example below has got something of everything in it. Don't fail to realise that accelerators enable trapping any recognised key combination which will generate an "activate" signal which can perform some function upon some widget -- very powerful.

Submenu, checkbutton and radiobutton menuitems are to follow :)

<menu> and <menuitem> widgets example:

Updated 2011-08-02 16:46: example superseded by http://www.murga-linux.com/puppy/viewto ... 591#549591.

Regards,
Thunor
Last edited by thunor on Mon 08 Aug 2011, 22:03, edited 9 times in total.

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

#100 Post by BarryK »

A problem!

I cannot close a child window, I have described the problem on my blog:

http://bkhome.org/blog/?viewDetailed=02366

Ages ago, I know it did work, but I can't remember if we had to do anything special, or if "closewindow" used to work. Maybe that was with gtkdialog2.

Can anyone help?
[url]https://bkhome.org/news/[/url]

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

#101 Post by 8-bit »

Barry,
See the code I left on your Blog. Patriot changed Gtkdialog a while back to support closing of a child window from the main program.
And it still works.

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

#102 Post by technosaurus »

~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/

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
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
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#103 Post by 8-bit »

I concur with technosaurus.
As a matter of fact, we do not have a /usr/share/icons/Bluecurve directory in Puppy Lucid 520! So coding that in is not good.

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

#104 Post by thunor »

BarryK wrote:A problem!

I cannot close a child window...
Code that was added to Patriot's Edition went into Gtkdialog -- I created a diff patch -- so there shouldn't be any loss of functionality.

Patriot's closewindow fix is explained here. The parameter passed to the closewindow function should be any variable declared within the launched window. Patriot places this atop the child window, but I've used this function with the variable declared within the button that's being used to close the window.

It should actually be the launched dialog's shell variable name but I guess it didn't work so Patriot made a fix.
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
Last edited by thunor on Mon 25 Jul 2011, 20:34, edited 2 times in total.

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

#105 Post by 01micko »

:wink:

Image

:)
Puppy Linux Blog - contact me for access

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

Post Reply