Page 22 of 42

Posted: Wed 18 Jan 2012, 02:35
by jpeps
Yeah...it's almost there. It would also be an improvement with selection involving a simple on/off toggle. Presently selection works like a text editor. The icon refresh would have to work in runtime. Probably just a variation of a checkbox widget...

Posted: Wed 18 Jan 2012, 07:24
by jpeps
Found a way to do it; a createchecklist function within a scrollable vbox.

http://murga-linux.com/puppy/viewtopic. ... 3&start=56


I would have liked to use an array with the variable, but couldn't find a way. A hack like STAT$i isn't as clean. To read it later, I needed something like

Code: Select all

  eval echo "\$STAT${i}"

Window Icons

Posted: Thu 19 Jan 2012, 17:20
by seaside
Right now you can only set a gtkdialog's window dialog icon with a "gtk-stock-item" such as this-

Code: Select all

<window title="Example Window" icon-name="gtk-dialog-warning">
It would be really great to provide a customized icon with any pixmap that would show as the window icon as well as minimized in a tray.

Having this feature would give gtkdialog programs a nice professional and polished look.

Cheers,
s

Posted: Thu 19 Jan 2012, 18:23
by vovchik
Dear seaside,

I agree with you fully. I requested that from thunor a while back and he has kindly listed that feature for inclusion (http://code.google.com/p/gtkdialog/issues/detail?id=48). It's pretty easy to do.

With kind regards,
vovchik

Posted: Thu 19 Jan 2012, 18:24
by vovchik
Sorry - the mail system on the forum had a hiccough and double posted.

Re: Window Icons

Posted: Fri 20 Jan 2012, 03:27
by Geoffrey
seaside wrote:Right now you can only set a gtkdialog's window dialog icon with a "gtk-stock-item" such as this-

Code: Select all

<window title="Example Window" icon-name="gtk-dialog-warning">
It would be really great to provide a customized icon with any pixmap that would show as the window icon as well as minimized in a tray.

Having this feature would give gtkdialog programs a nice professional and polished look.

Cheers,
s
Hi seaside,

You can add your own icon, vovchik and I discussed it a few post back, if you have the icon you wish to use, place it in any of the folders in /usr/share/icons/hicolor/.

System links also work, then run this command in the terminal to refresh the icon cache,

Code: Select all

gtk-update-icon-cache -f -i /usr/share/icons/hicolor
I've since found that petget refreshes the cache when a pet is installed
Example:

Code: Select all

<window title="A GTKDialog" icon-name="games48" resizable="false" decorated="true">
I placed a system link from /usr/local/lib/X11/themes/Ethereal/games48.png to /usr/share/icons/hicolor/48x48/apps, refreshed the cache and this is the result.

Geoffrey

Posted: Fri 20 Jan 2012, 23:42
by seaside
Geoffrey,

Just a great find. :idea: :idea: Many, many thanks.

Yes, I see you had this discussion over the holidays and I must have just missed it,

Since installing pets updates the cache, it would seem that (for Puppy at least) including that gtkdialog feature implementation of
gtk_window_set_icon(GTK_WINDOW(window), create_pixbuf("pixname.ext"));
isn't necessary.

Vovchik would have to comment on the merits between the two ways of showing icons, as I have no clue.

Regards,
s
(This should definitely be in the gtkdialog tips and tricks section) :!:

Posted: Fri 20 Jan 2012, 23:49
by vovchik
Dear seaside,

The advantage of:

Code: Select all

gtk_window_set_icon(GTK_WINDOW(window), create_pixbuf("pixname.ext"));
is that you can use any old pixmap - a special one for instance - that isn't registered in the GTK icon system. But Geoffrey's workaround is also very useful. I think the user-selected window pixmap will be implemented in due course. I also like the idea of a tray item. Yad does that very nicely, and I have done that with an unreleased radio stream player in BaCon. It's also not hard to implement, and it's nice to be able to choose the pixmap.

With kind regards,
vovchik

Posted: Sat 21 Jan 2012, 02:41
by RSH
GtkDialog-Feature? !

I would like to refer to the following.
http://murga-linux.com/puppy/viewtopic. ... 119#596119

My thought would be to create something in the style of <tree "selection_mode="3"> that gives back a tree like shown in the attached image.

Perhaps it could be tree also, but with selection_mode="5" (f.e.). I know, it seems to be easy to "hack" things like that (if you are familiar with bash), but it would be very useful for all non-bash-familiar-users/programmers, to handle this one just as easy as <tree selection_mode="3">

I am very familiar with pascal programming (older version, another OS) and I would surely be able to code stuff like that - if i could use "my" pascal system! Unfortunately, i can't.

As i see the code, you do have already everything to set this up.

Would you please "hack" this out to easy use for all non-bash-familiar-users/programmers?

Thank you!

RSH

Posted: Sat 10 Mar 2012, 16:58
by Argolance
Hello,
Am I silly? :shock: :D
These are the code lines: 8)

Code: Select all

#!/bin/sh

GTKDIALOG=gtkdialog

export MAIN_DIALOG='
<window title="Example Window" icon-name="gtk-dialog-warning">
  <vbox>
    <frame Question:>
      <text>
        <label>How could I get stock icons ("gtk-dialog-warning" for example) and... others working?</label>
      </text>
    </frame>
    <hbox>
      <button ok></button>
      <button cancel></button>
    </hbox>
  </vbox>
</window>
'

case $1 in
	-d | --dump) echo "$MAIN_DIALOG" ;;
	*) $GTKDIALOG --program=MAIN_DIALOG ;;
esac
Cordialement.
This is what I get! :?

Posted: Sat 10 Mar 2012, 18:38
by technosaurus
You'll find that and a lot more here:
http://www.murga-linux.com/puppy/viewtopic.php?t=38608

Posted: Sun 11 Mar 2012, 00:55
by Argolance
Hello,
Thank you for replying.
I already know this great topic, and learned a lot while looking at zigbert tips!!! But I didn't find the answer to my question. I know how to display my own icon in the window title bar but don't how to display some gtk stock icons like gtk-dialog-info or gtk-dialog-warning for example (which could be useful and used without having to add copies manually to /usr/share/icons/hicolor) though it curiously works quite well with gtk-preferences...

I was wondering if something like icon-stock-name=... would exist?
This was just a question...

Cordialement.

Posted: Sun 11 Mar 2012, 04:24
by technosaurus
It's in zigbert's first post, just search for stock
http://www.murga-linux.com/puppy/viewto ... 035#274035

Posted: Sun 11 Mar 2012, 10:23
by Argolance
Hello,
Thank you for your patience.
I red the topic as seriously as I could: nada! :oops: For menuitem and buttons icons, no problem, solutions are there, and I know them...
But for window title bar icon, I tried to adapt several things... without success and din't see anything directly telling about! :?

No matter.
Have a good Sunday!

Regards.

Posted: Sun 11 Mar 2012, 13:40
by technosaurus
yeah sorry, I was misreading your post, the way I have always hacked it was make a symlink of my program to the name of the icon with no extension

Code: Select all

ln -s gtkdialog gtk-dialog-warning
#need an icon in jwm's icon path named gtk-dialog-warning.png (or xpm)
gtk-dialog-warning -P ....

Posted: Sun 11 Mar 2012, 16:17
by Argolance
Merci... :)

Posted: Sat 09 Jun 2012, 15:50
by technosaurus
I switched out the find_pixmap code in my compile with this - speeds up not finding missing images with locate (especially if it is missing) and gives a convenient way to tell where the global gtkdialog images are (using an environment variable - GTKDIALOG_PIXMAP_DIR) - better suggestions welcome though
char *find_pixmap(char *filename)
{
char tmp[128];
static char *line = NULL;
static uint length = 0;
FILE *locate;

if (access(filename, R_OK) == 0)
return filename;

//snprintf(tmp, 127, "/usr/share/icons/Bluecurve/16x16/stock/%s",
snprintf(tmp, 127, "/usr/share/pixmaps/%s", filename);
tmp[127] = '\0';
if (access(tmp, R_OK) == 0)
return strdup(tmp);

snprintf(tmp, 127, "/usr/share/mini-icons/%s", filename);
tmp[127] = '\0';
if (access(tmp, R_OK) == 0)
return strdup(tmp);


snprintf(tmp, 127, "%s/%s",getenv("GTKDIALOG_PIXMAP_DIR"), filename);
tmp[127] = '\0';
if (access(tmp, R_OK) == 0)
return strdup(tmp);

return 0;
}

Posted: Mon 11 Jun 2012, 14:35
by Argolance
Hello,
Did not test this yet... but guess that, at first sight, the small "amateur" I am finds these code lines impressive and somewhat "hermetic"... :shock: !

Thank you a lot!

gtkdialog-C-example

Posted: Wed 11 Jul 2012, 21:38
by sklimkin
The site http://code.google.com/p/gtkdialog/ wasn't updated for a long time.
Can be here will on a subject.
gtkdialog has many good examples bash-script.
The author Laszlo Pere has given possibility to do the program and in C-language, but an example of such program only one (and very small).
Program possibilities gtkdialog in this case are much poorer, than at bash-script.
Some users can write on bash-script worse, than on C-language (as I for example).
Considering it I has made an example in C-language.
Designs gtkdialog for C-language don't allow for example such things:
<window window_position = "1" title = "System Tools">
Or:
<action when = "file-activated"> echo File: $FILE </action>
It managed to be bypassed in such a way:
"<action> cat [echo $FILE] | zenity - text-info - width=720 - height=400 - title $FILE </action>"
But even with such restrictions it was interesting to me to make the program which doesn't demand heavy libraries (so I anyway think).
If will consider it possible add my example in/gtkdialog/examples/

Posted: Fri 27 Jul 2012, 19:58
by oldyeller
Hello Everyone,

I made me a notebook like menu for Manna OS, but iI have one problem that I need help with.

When I hit a button the menu stays open. How do I close it after hitting a button?

Code.
#! /bin/bash

export MAIN_DIALOG='
<window title="Manna Menu" icon-name="Bible">
<vbox>
<notebook labels="Bible Software|Books|Dictionaries">
<frame>
<hbox>
<button>
<input file>/usr/share/icons/hicolor/48x48/apps/bibletime.png</input>
<label>bibletime</label>
<action type="exec">bibletime</action>
</button>
<vbox>
<text wrap="true" width-chars="50"><label>An excellent stand alone program. There are a lot of books one can get for this and maps as well.</label></text>
</vbox>
</hbox>
<hbox>
<button>
<input file>/usr/share/pixmaps/75DE_BibleAnalyzer4.0.png</input>
<label>BibleAnalyzer</label>
<action type="exec">bibleanalyzer4.sh</action>
</button>
<vbox>
<text wrap="true" width-chars="50"><label>An excellent program to disect the Word and get more out of it. It has many ways in which one can do this. This has others resources one can buy.</label></text>
</vbox>
</hbox>
<hbox>
<button>
<input file>/usr/share/pixmaps/esword.png</input>
<label>e-sword</label>
<action type="exec">/usr/bin/e-Sword.sh</action>
</button>
<vbox>
<text wrap="true" width-chars="50"><label>There is a lot of free Bibles and other resources plus you can get step books (examples) as well. There is also bibles and books you can buy too.</label></text>
</vbox>
</hbox>
<hbox>
<button>
<input file>/usr/share/pixmaps/CB2C_theword.0.png</input>
<label>theWord</label>
<action type="exec">theword.sh</action>
</button>
<vbox>
<text wrap="true" width-chars="50"><label>This program is one in which you can open up more than just one book, bible or any other window. There is a lot of resources for this program on line to get.</label></text>
</vbox>
</hbox>
</frame>
<frame>
<vbox>
<text wrap="true" width-chars="50"><label>Books will be coming soon.</label></text>
</vbox>
</frame>
<frame>
<vbox>
<text wrap="true" width-chars="50"><label>Dictionaries will be coming soon as well. There will be more stuff added as time goes by.</label></text>
</vbox>
</frame>
</notebook>
<hbox>
<button cancel></button>
<button ok></button>
</hbox>
</vbox>
</window>
'

gtkdialog --program=MAIN_DIALOG
Any ideas?

thanks