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 Tue 02 Sep 2014, 01:42
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 40 of 64 [949 Posts]   Goto page: Previous 1, 2, 3, ..., 38, 39, 40, 41, 42, ..., 62, 63, 64 Next
Author Message
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Mon 22 Aug 2011, 07:18    Post subject:  

disciple wrote:
What about gnocl? Because it would be much nicer to have GTK dialogues etc, as this is the standard for everything in Puppy.


That's why I was trying to use Gtkdialog3. Seems like GTK has LOTS of bindings in many languages. Gnocl is one of them (which I don't know much about).

Some things I'd be looking for:

Good run-time interaction for widgets; basic properties (like filters, etc); variables I can use for selected items of widgets (lists, etc); active community of developers/extensive documentation. I google searched for a tcltk combobox that a user can update (try this for gtkdialog3):

Code:

#!/usr/bin/env wish
set ff [frame .f]
set label [label $ff.label -text "Name:" ]
set name [ttk::combobox $ff.name -textvariable name]
set addButton [button $ff.addButton -text "+" -width 1 \
    -command [list addNameToComboBox $name]]
set removeButton [button $ff.removeButton -text "-" -width 1 \
    -command [list removeNameFromComboBox $name]]
grid $label $name
grid $ff.addButton -row 0 -column 2 -sticky w
grid $ff.removeButton -row 0 -column 3 -sticky sw -padx 5
pack $ff -side top -fill both -expand true

proc addNameToComboBox {name} {
    set values [$name cget -values]
    set current_value [$name get]
    if {$current_value ni $values} {
        lappend values $current_value
        $name configure -values $values
    }
}

proc removeNameFromComboBox {name} {
    set values [$name cget -values]
    set current_value [$name get]
    if {$current_value in $values} {
        set i [lsearch -exact $values $current_value]
        set values [lreplace $values $i $i]
        $name configure -values $values
    }   
}

combobox-tcltk.png
 Description   
 Filesize   9.61 KB
 Viewed   869 Time(s)

combobox-tcltk.png

Back to top
View user's profile Send private message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Fri 26 Aug 2011, 03:32    Post subject:  

thunar just added fileselect filters Very Happy


http://murga-linux.com/puppy/viewtopic.php?t=69188&start=218
Back to top
View user's profile Send private message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Mon 29 Aug 2011, 03:13    Post subject: with Xdialog  

Here's a combo I found with Xdialog's logbox, which allows text colors. This example shows (potentially) clobbered files in red. (think I'll put the builtins in another color).

(Thunor's fileselect filter got me inspired to experiment a bit)
logbox.png
 Description   
 Filesize   61.83 KB
 Viewed   777 Time(s)

logbox.png

Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3365
Location: Oregon

PostPosted: Mon 29 Aug 2011, 15:16    Post subject:  

jeps,
Do you care to share that script so others can check it out?
It looks interesting and what with installation or removal of a pet package that contains library files that already exist, it would be good to not have those libraries trashed on uninstalling a pet.
And for some reason unknown to us, the library files are not part of /root/.packages/builtin.
That means if a pet is uninstalled that contained library files that already exist they would be removed.
That is not a good thing at all.

Also, if a library file is used by more than one installed PET, and installed by it, uninstalling one PET can break another.
Back to top
View user's profile Send private message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Mon 29 Aug 2011, 19:34    Post subject:  

8-bit wrote:
jeps,
Do you care to share that script so others can check it out?


I'm having fun making lots of changes. For basic use, probably a cut back version would be suitable. Generating the initial builtin list takes about 9M.. I like it to prioritize (in color! ), but most users just need to see what's installed*. I've always used my own installers/uninstallers, but don't want to step on anyone's toes.

The other problem is that I'm using Thunor's latest gtkdialog3 with the fileselect filters.

* second thought..most users do NOT want to see what's installed
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4348

PostPosted: Mon 29 Aug 2011, 22:00    Post subject:  

there is an example of how to parse all of the puppy repos (from the files in $HOME/.packages) in my jwm_tools pet
http://www.murga-linux.com/puppy/viewtopic.php?t=70804

the jwm_install_menu_create script builds an install menu for all of the supported repos (puppy2,3,4,5 quirky and wary) in ~2s in a format mirroring the program menu (if only all of linux were that intuitive) ... anyhow modding it for gtkdialog would be pretty straightforward if anyone wants to speed it up (using only shell it is 15x faster than the similar purposed C program, jwm-xdgmenu ... or rather the script that calls it, fixmenus)

I understand about the "stepping on toes", there have been several enhancements that never make it (or at least haven't yet) into ppm... even a few total/partial rewrites The code seems to be overly complex and can be finnicky (as programs 10 yrs in the making tend to be... corner cases and such), so I understand the caution & not wanting to break other chunks.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Mon 29 Aug 2011, 22:16    Post subject:  

Here's a look with builtins RED, installed BLUE. Notice any potential clobbering issues here? Smile

Edit: updated to show target files for links that are getting clobbered. The pet in the example was clobbering built-in links, leaving orphaned target libs of no use. Also, installing new target libs without clobbering the links would be useless. The 'install noclobber' button brings up the install list in an editor with "?" in front of clobbered files. Removing the "?" installs the file.
logbox.png
 Description   
 Filesize   63.96 KB
 Viewed   755 Time(s)

logbox.png

Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3365
Location: Oregon

PostPosted: Thu 01 Sep 2011, 11:30    Post subject:
Subject description: Seeing what a PET is going to install
 

Since I do not have the benefit of having your (jpeps) PETCheck, I rename the downloaded PET with a "tar.gz" extension and open it to see what files the PET contains.
I suppose I could write a script to take those files and do a check to see if they exist in my install of Puppy and act accordingly.

That is basically what PETCheck does with the option to not install some of the files.

If I added all the files I wanted to keep from installing PETs to the /root/.packages/builtin_files directory, it would most likely become huge.

But if I did that, would those files be safe guarded from removal by an uninstall of a PET?
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3365
Location: Oregon

PostPosted: Thu 01 Sep 2011, 12:46    Post subject:
Subject description: followup
 

I tried putting the files in a PET into /root/.packages/builtin_files and then installing the same pet.
I then tried removing the PET using Puppy Package Manager.
And I found that files listed as built in are not safe from removal!
So evidently, no files in Puppy are safe from being removed!
The only solution I can see is to back up your pupsave frequently so you have a backup just in case.

Actually, there are two other solutions.
One is called a Remaster.

The other is a rewrite of Puppy Package manager to look at the built in files and not remove any that are there.
Back to top
View user's profile Send private message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Thu 01 Sep 2011, 14:07    Post subject:
Subject description: followup
 

8-bit wrote:
I tried putting the files in a PET into /root/.packages/builtin_files and then installing the same pet.
I then tried removing the PET using Puppy Package Manager.
And I found that files listed as built in are not safe from removal!

Hi 8-bit,

It's best not to touch the built-ins; it's a constant. The NoClobber install in PetCheck simply gives the option not to include the builtins in the installed package. Since they're not included in the installed package, they won't be deleted.

BTW; this is really getting OT...initially, I was only demoing the fileselect and then the color options for the logbox.

maybe better:
http://murga-linux.com/puppy/viewtopic.php?t=70582

edit: guess it was a good idea not to list an app using updated gtkdialog
until gtkdialog4 is established.
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3365
Location: Oregon

PostPosted: Thu 01 Sep 2011, 14:46    Post subject:  

Moderator,
Would it be possible to move a few posts, mine included http://murga-linux.com/puppy/viewtopic.php?p=559419#559419 and the following one over to the thread here.

It seems they fit better there.
Thanks
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4348

PostPosted: Fri 02 Sep 2011, 12:27    Post subject:  

here is a little script that will generate a folder full of 1x1 pixmaps for each color in rgb.txt
Its nice to be able to browse them in alphabetical order in rox with thumbnails and large icons turned on.

Code:
#!/bin/sh
[ ! -d colors ] && mkdir colors
for x in `cat /usr/X11R7/lib/X11/rgb.txt|grep -v Xorg|cut -f3|tr " " "_"`; do
echo '/* XPM */
static char *'${x}'_xpm[] = {
"1 1 1 1",
"0   c '${x//_/ }'",
"0"
};' >colors/${x}.xpm
done
colors.tar.bz2
Description  here is a tarball of all the pixmaps
it is actually quite small for having 659 images
bz2

 Download 
Filename  colors.tar.bz2 
Filesize  6.68 KB 
Downloaded  180 Time(s) 

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
zigbert


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

PostPosted: Tue 06 Sep 2011, 08:25    Post subject:  

Some cleanups in the main post today
_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
8-bit


Joined: 03 Apr 2007
Posts: 3365
Location: Oregon

PostPosted: Thu 08 Sep 2011, 18:46    Post subject:  

technosaurus wrote:
here is a little script that will generate a folder full of 1x1 pixmaps for each color in rgb.txt
Its nice to be able to browse them in alphabetical order in rox with thumbnails and large icons turned on.

Code:
#!/bin/sh
[ ! -d colors ] && mkdir colors
for x in `cat /usr/X11R7/lib/X11/rgb.txt|grep -v Xorg|cut -f3|tr " " "_"`; do
echo '/* XPM */
static char *'${x}'_xpm[] = {
"1 1 1 1",
"0   c '${x//_/ }'",
"0"
};' >colors/${x}.xpm
done


I run Puppy Lucid 520 and I do not have the file "/usr/X11R7/lib/X11/rgb.txt".
So I am unable to use your script.
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4348

PostPosted: Thu 08 Sep 2011, 20:07    Post subject:  

you should have a rgb.txt _somewhere_
I don't do *buntu, so its based on T2 location
but it is probably /usr/lib/X11/rgb.txt

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 40 of 64 [949 Posts]   Goto page: Previous 1, 2, 3, ..., 38, 39, 40, 41, 42, ..., 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.1028s ][ Queries: 13 (0.0179s) ][ GZIP on ]