Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 24 Oct 2014, 07:44
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
GtkDialog - tips
Post new topic   Reply to topic View previous topic :: View next topic
Page 35 of 64 [955 Posts]   Goto page: Previous 1, 2, 3, ..., 33, 34, 35, 36, 37, ..., 62, 63, 64 Next
Author Message
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Wed 15 Jun 2011, 10:47    Post subject:  

seaside wrote:
There is one item missing from Gtkdialog - the ability to do multiple selection of items.

[EDIT] Updated 20110621-18:38

Hi seaside

Implemented in SVN r12 Smile

See this post for syntax and example code.

Regards,
Thunor

Last edited by thunor on Tue 21 Jun 2011, 13:26; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Wed 15 Jun 2011, 13:56    Post subject: no more gif animation  

Dear thunor,

I just noticed that the latest patches prevent gtkdialog from showing animated gifs Sad. Standard issue does, and I use it to show animations as follows:



Code:
#! /bin/bash

# -----------------
# Functions
# -----------------

# --------------
# get pic info
# --------------
init_vars()
{
mypicsize=`stat --format=%s "$mypic"`
mypicinfo=`nconvert -info -quiet "$mypic"`
mypicinfo=`echo "$mypicinfo" | grep -v Success`
mypicbase=`basename $mypic`
mypicinfo="    Image           : ""$mypicbase""$mypicinfo""
    Size            : $mypicsize"" bytes"
}


# --------------
# make pic gui
# --------------
make_pic_gui()
{

export show_pic='
<window title="PShowPic: '$mypicbase'" icon-name="gtk-refresh">
   <vbox>
      <frame>
         <pixmap>
            <input file>'$mypic'</input>
         </pixmap>
      </frame>
      <hbox>
         <button help>
            <action>launch:show_pic_help</action>
         </button>
      </hbox>
   </vbox>
</window>
'
}

# --------------
# make help gui
# --------------

make_help_gui()
{
export show_pic_help='
<window title="PShowPic Info" icon-name="gtk-about">
   <vbox>
      <frame>
         <text use-markup="true">
            <label>"<tt><b>'$mypicinfo'</b></tt>"</label>
         </text>
      </frame>
      <hbox>
         <button cancel>
            <action>closewindow:show_pic_help</action>
         </button>
      </hbox>
   </vbox>
</window>
'
}

# --------------
# display gui
# --------------

display_gui()
{
   gtkdialog3 --program=show_pic --center
}

# -----------------
# End Functions
# -----------------

# -----------------
# Main
# -----------------

mypic="$1"
init_vars
make_pic_gui
make_help_gui
display_gui

# -----------------
# End Main
# -----------------


Can anything be done to preserve this ability and still enable scaling? Could be a "trade-off" or a regression error.

With kind regards,
vovchik
Back to top
View user's profile Send private message 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Thu 16 Jun 2011, 08:21    Post subject: Re: no more gif animation  

vovchik wrote:
I just noticed that the latest patches prevent gtkdialog from showing animated gifs...

[EDIT] I have modified the code. Therefore [currently] animated gifs will scale but they'll stop animating. Viewnior manages to scale them so I just need to look into it.

01micko wrote:
How do we set up a sourceforge or google account for this? It's getting a bit hard to keep up! I compiled thunor's patches in and thought everything was rosy until I realised I forgot the Moose patch!

[EDIT] I have created a project page for gtkdialog and am in the process of setting it up.

Regards,
Thunor
Back to top
View user's profile Send private message Visit poster's website 
01micko


Joined: 11 Oct 2008
Posts: 7835
Location: qld

PostPosted: Fri 17 Jun 2011, 20:13    Post subject:  

Thanks for setting up the project page thunor!

IMHO it assures the continuation of development for gtkdialog. I did a checkout and the animated gifs work fine for me if left unscaled. I'm sure that will please vovchik as well.

_____

OT.. checked out a couple of your games, "pipe panic" is a fun spin on that old dos version Smile . I might make a post in the games thread.

Cheers

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5753
Location: Valåmoen, Norway

PostPosted: Sat 18 Jun 2011, 01:09    Post subject:  

thunor wrote:
I have created a project page for gtkdialog and am in the process of setting it up.
This makes me emotional.
_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
sc0ttman


Joined: 16 Sep 2009
Posts: 2385
Location: UK

PostPosted: Sat 18 Jun 2011, 06:46    Post subject:  

zigbert wrote:
thunor wrote:
I have created a project page for gtkdialog and am in the process of setting it up.
This makes me emotional.

I love gtkdialog, if it can be extended, I'd love to help (if I can) and would LOVE to see the results Very Happy


Forgive me if this is already a working feature, but I dont know about it:
I'd like to ability to make non-editable comboboxes

<combobox editable="false">

or whatever

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Sat 18 Jun 2011, 09:55    Post subject:  

01micko wrote:
Thanks for setting up the project page thunor!

IMHO it assures the continuation of development for gtkdialog. I did a checkout and the animated gifs work fine for me if left unscaled. I'm sure that will please vovchik as well.

You're welcome. Scaling animated gifs and enabling different selection modes in the tree widget I am already tackling.

zigbert wrote:
This makes me emotional.

It makes updating and extending it so much more productive. I guess folk [from any distro] didn't have time to set it up before.

sc0ttman wrote:
I love gtkdialog, if it can be extended, I'd love to help (if I can) and would LOVE to see the results Very Happy

Forgive me if this is already a working feature, but I dont know about it:
I'd like to ability to make non-editable comboboxes

<combobox editable="false">

or whatever

Hi sc0ttman

Once I've set-up the issue tracking system I'll add some feature requests for the functionality people are requesting Smile

This is Gtkdialog's new home: http://code.google.com/p/gtkdialog/

I went through all the patches that I've found and applied them if necessary. I've fixed all the warnings and removed all the auto-generated files. Everything I've done is recorded in the ChangeLog and the SVN logs.

http://code.google.com/p/gtkdialog/source/checkout explains how to check it out. Initially you'll need to run autogen.sh rather than configure because the auto-generated files will require creating. Then type make.

Possibly there are people here who'd like to assist with extending or maintaining the project -- especially since Puppy uses it so extensively -- so if you'd like write access to the repository (project committer in Google parlance) then PM me your Google account email address.

Personally I like to review my changes with "svn status" before committing and keep the version in the repository stable. This means that whoever checks it out (developer or user) can expect it to be in a usable condition.

Regards,
Thunor
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5753
Location: Valåmoen, Norway

PostPosted: Sun 19 Jun 2011, 14:42    Post subject:  

I have updated the main post to reflect the new situation with thunor in the front seat, and added info about how to scale/refresh pixmaps.


Sigmund

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5753
Location: Valåmoen, Norway

PostPosted: Sun 19 Jun 2011, 14:48    Post subject:  

Also made some cleanup for <entry> information.

I have removed the info about patriots fix - Now when this is covered by thunor, this 'tips and tricks' thread is only about features (not bugfixes)


Sigmund

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Tue 21 Jun 2011, 13:20    Post subject:  

Added tree widget additional selection modes

Code:
<tree selection_mode="none"> or <tree selection-mode="0">
<tree selection_mode="single"> or <tree selection-mode="1">
<tree selection_mode="browse"> or <tree selection-mode="2">
<tree selection_mode="multiple"> or <tree selection-mode="3">

None mode prevents selection.
Single mode is the default that Gtkdialog already supported.
Browse mode prevents deselection.
Multiple mode allows the user to select multiple rows with the rows being returned seperated by newlines "\n", so if 3 rows were selected in TREE then TREE would return:
"row 1
row 2
row 3"

Here's an example of all modes (run it in a terminal to see the output):
Code:
#!/bin/sh

# NOTE: This example requires at least gtkdialog-0.7.21 (please visit
# http://code.google.com/p/gtkdialog/). Additionally if you are using
# Puppy Linux then you may find that an historical version of gtkdialog
# already exists in /usr/sbin, and if that is the case then you should
# modify the shell variable below to point to the new gtkdialog binary.

GTKDIALOG=gtkdialog

function funcfiletreCreate() {
   if [ -f $1 ]; then rm $1; fi
   for ((f = 0; f < $2; f++)); do
      echo "#$f This is selection_mode=\"$3\"" >> $1
   done
}

function functreCreate() {
   echo '<tree selection_mode="'$2'">
         <variable>'$1'</variable>
         <label>Items</label>
         <width>300</width><height>200</height>
         <input>cat file'$1'</input>
      </tree>
      <hbox homogeneous="true">
         <button>
            <label>"    Delete    "</label>
            <action>echo "Deleting $'$1'"</action>
            <action type="removeselected">'$1'</action>
         </button>
         <button>
            <label>"    Reload    "</label>
            <action>echo Reloading file'$1'</action>
            <action type="refresh">'$1'</action>
         </button>
      </hbox>'
}

funcfiletreCreate filetreNone 3 none
funcfiletreCreate filetreSingle 3 single
funcfiletreCreate filetreBrowse 3 browse
funcfiletreCreate filetreMultiple 16 multiple

export MAIN_DIALOG='
<window title="treSelectionModes" resizable="false">
   <vbox>
      <frame tree widget selection modes>
         <hbox>
            <vbox>
               '"$(functreCreate treNone none)"'
               '"$(functreCreate treSingle single)"'
            </vbox>
            <vbox>
               '"$(functreCreate treBrowse browse)"'
               '"$(functreCreate treMultiple multiple)"'
            </vbox>
         </hbox>
      </frame>
      <hbox homogeneous="true">
         <button ok></button>
      </hbox>
   </vbox>
   <action signal="hide">exit:Exit</action>
</window>
'

$GTKDIALOG --center --program=MAIN_DIALOG

[EDIT] Added note about required version.

Regards,
Thunor

Last edited by thunor on Tue 05 Jul 2011, 16:16; edited 4 times in total
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5753
Location: Valåmoen, Norway

PostPosted: Tue 21 Jun 2011, 14:33    Post subject:  

Hello thunor
It is amazing to see that you are improving the gtkdialog source.
I want to share some thoughts for further improvements.
I don't want to nag about new widgets or heavy new features.
I don't want to focus on 'the look' - like widget-placement, scaling, alignment....
I see it as more important to improve some weak functions. I think some of these thoughts could be easy to add, and give great new developer tools.

1.)
Today gtkdialog supports drag'n drop as explained in my main post.
To build drag'n drop support between <tree> widgets, they must be set to <tree hover-selection="true">. Most common, and most flexible is to use a normal selection mode. The reason why normal selection doesn't support drag'n drop is because <action signal="button-press-event"> is executed before item is selected. If it was the other way around, drag'n drop would be possible.

2.)
Would it be hard to add a right-click-menu:
- First we need the fix mentioned above.
- The <menu> widget must be loadable without a <menubar>.
- Now we could launch a new gui with a <menu> if user right-clicks.
- The launched gui must use <window decorated="false" skip_taskbar_hint="true" window_position="2">.
- This will work, though the window_position=2 (at mouse position) places the mouse-pointer in the middle of the gui, rather than up-left which is normal.

3.)
Click on <table> header doesn't sort.

4.)
I prefer the <tree> widget over the <table> widget because of more options. But it is one thing that <table> does much better than <tree>; rendering of huge lists.
While a gui including a <tree> must load it's content before the gui shows up, a gui with a <table> shows up at once, and _then_ starts rendering the content of the list. If this is possible for the <tree> widget, I see no reason for not doing so.

5.)
Icons in the <tree> widget is working very well as long as these are defined as
<item stock=gtk-open>coloumn1|coloumn2</item>
I wonder if it would be possible to add this feature for an <input file>. With your pixmap-refresh-improvement, I see huge possibilities if icons in <tree> could be refreshed the same way. This requires to work with <input file>, because <items> are statically loaded before gui execution, and can't be refreshed.

6.)
I see on the new gtkdialog homepage that slider widget is on your todo list. Hopefully this includes the possibility to refresh its status, so the slider can move (without user interaction) to show new status in case it has changed.

7.)
I don't know gtk or C, but I find it strange that the existing <menu> widget doesn't support submenus. Not VERY important, but as gtdialog becomes better, we use it for more complex tasks, and then this feature becomes handy.


Best wishes
Sigmund

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
8-bit


Joined: 03 Apr 2007
Posts: 3382
Location: Oregon

PostPosted: Tue 21 Jun 2011, 16:04    Post subject:  

One thing I am a little concerned about is that Puppy was using gtkdialog3.
And all your scripts show using gtkdialog, which was the starting one and went from it to gtkdialog2 and finally 3.
I realize I can create syslinks for gtkdialog using other version names.
The reason for the syslinks is so existing gtkdialog scripts used in Puppy will still work.
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2385
Location: UK

PostPosted: Tue 21 Jun 2011, 16:11    Post subject:  

zigbert wrote:
Hello thunor
It is amazing to see that you are improving the gtkdialog source.
...
I don't want to nag about new widgets or heavy new features.

I would like to see a very high priority put into making backwards compatibility 100% stable..

For example, the IPConfig tool breaks (in Wary, I think) when the new gtkdialog is used, apparently..

I must say, I am not going to try influence this project at all,
as I am not knowledgeable enough about GTKdialog, GTK widgets, etc, etc,...

And Sorry if this is the wrong place to post.. but..

I have heard lots of people prefer Yad to GTK-Dialog..

One reason is that is has mutliple select boxes..
Not sure of any other reasons.. But it got me thinking..

Maybe we could identify (important) things in Yad that are missing in GTKdialog.

Just a thought... I don't know enough to take the thought further - but users on this forum are now creating more and more Yad GUIs, especially Stu90, Vovchik - maybe they could weight in and say what is missing from GTK-Dialog, and why they chose Yad (or even BaCon)..

I'm sure no one would mind if thunor PM'ed a few people with such questions..
And if no one wants to do that, I would be happy to.

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
zigbert


Joined: 29 Mar 2006
Posts: 5753
Location: Valåmoen, Norway

PostPosted: Tue 21 Jun 2011, 16:34    Post subject:  

sc0ttman
What is wrong with using yad, bacon or xdialog?

regarding backwards compatibility, what is the problem with fixing the xml code in IPConfig or other. The big deal about gtkdialog (as I see it) is that
- it is EXTREMELY easy to set up a gui. Probably much easier than refining the gtkdialog source code to be backward comapatible.
- Using bash, the code is very transparent for the community. When a user got trouble with ie. Pburn, I can ask her/him to change line 245 in /usr/local/pburn/func to ...


Sigmund

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
smokey01


Joined: 30 Dec 2006
Posts: 1829
Location: South Australia

PostPosted: Tue 21 Jun 2011, 16:45    Post subject:  

Hi Thunor, another simple thing that i find annoying is the inability to just press the enter key when entering data. Clicking the OK button works but pressing the enter key is more intuitive.

I'm not suggesting removing the OK button, rather implement the Enter Key = OK button.

_________________
Puppy Software <-> Distros <-> Puppy Linux Tips
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 35 of 64 [955 Posts]   Goto page: Previous 1, 2, 3, ..., 33, 34, 35, 36, 37, ..., 62, 63, 64 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1355s ][ Queries: 13 (0.0182s) ][ GZIP on ]