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 Sun 23 Nov 2014, 22:58
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Learning gtkDialog (pmenu project)
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 3 [41 Posts]   Goto page: Previous 1, 2, 3 Next
Author Message
afishe2000

Joined: 29 Jan 2010
Posts: 37

PostPosted: Sun 01 Aug 2010, 11:11    Post subject:  

Oops,

Updated the first post to pmenu-2.0.2.

Had some of the button icons backwards.
Back to top
View user's profile Send private message 
afishe2000

Joined: 29 Jan 2010
Posts: 37

PostPosted: Sun 01 Aug 2010, 12:02    Post subject: Refreshing a pixmap image using a button.
Subject description: On going struggle with pixmap...
 

As I mentioned, the more I learn the less I seem to know.

I'm using to following code to try to have the pixmap change from speaker on image to the speaker off image by pushing the corresponding button.

The popup button then would open a new dialog and show that same image.

Obviously it isn't working as I'd envisioned.

Everyone has been so helpful, I feel like I just keep running into the wall every time I turn the corner...

Code:


#!/bin/bash

echo 1 >/tmp/file_name

get_Pic() {
   path="/usr/local/lib/X11/mini-icons/"   
   if [ $(cat /tmp/file_name) = 1 ]; then
      file="mini-speaker.xpm";
   else
      file="mini-speaker-off.xpm";
   fi
   echo $path$file
}
export -f get_Pic

export NEW_DIALOG="
  <vbox>
  <pixmap>
   <input file>$(get_Pic)</input>
 </pixmap>
  <text>
      <input>get_Pic</input>
   </text>
   </vbox>
"

export MAIN_DIALOG="
<vbox>
    <pixmap>
      <variable>PIC</variable>
      <input file>$(get_Pic)</input>
    </pixmap>
    <text>
      <variable>NAME</variable>
         <input>get_Pic</input>
      </text>     
  <hbox>
    <button>
      <label>Pop-up</label>
      <action type=\"launch\">NEW_DIALOG</action>
    </button>
       <button>
         <input file>\"/usr/local/lib/X11/mini-icons/mini-speaker.xpm\"</input>
         <action>\"echo 1 >/tmp/file_name\"</action>
         <action>Refresh:NAME</action>
         <action>Refresh:PIC</action>
      </button>
      <button>
         <input file>\"/usr/local/lib/X11/mini-icons/mini-speaker-off.xpm\"</input>
         <action>\"echo 2 >/tmp/file_name\"</action>
         <action>Refresh:NAME</action>
         <action>Refresh:PIC</action>
      </button>
    <button ok></button>
  </hbox>
</vbox>
"
gtkdialog3 --program=MAIN_DIALOG

unset MAIN_DIALOG
unset NEW_DIALOG
unset get_Pic

rm /tmp/file_name

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

Joined: 11 Apr 2007
Posts: 887

PostPosted: Sun 01 Aug 2010, 15:53    Post subject: Re: Refreshing a pixmap image using a button.
Subject description: On going struggle with pixmap...
 

afishe2000 wrote:

I'm using to following code to try to have the pixmap change from speaker on image to the speaker off image by pushing the corresponding button.


afishe2000,

You might be able to do something with "flip-flops" (see section 10 of the Gtkdialog Tips below)
http://murga-linux.com/puppy/viewtopic.php?t=38608

Perhaps something where the image is made invisible -
<button visible=\"false\"> and is toggled on and off.

Cheers,
s
Back to top
View user's profile Send private message 
big_bass

Joined: 13 Aug 2007
Posts: 1747

PostPosted: Tue 07 Sep 2010, 11:13    Post subject:  

jemimah
Quote:
Personally, I think the startup item editor should be a separate program from pmenu. Otherwise I'm confused what to call it on the menu.




well I did a chainsaw hack of afishe2000's pmenu2
I removed only the desktop editor and made it a stand alone app called
desktop_view_edit

so nothing gets touched in pmenu


*I didnt "package" it since I use TXZ format and this way anyone could test it
add the icon and desktop of your choice



@Hey afishe2000 great coding !

Joe
desktop_view_edit.tar.gz
Description 
gz

 Download 
Filename  desktop_view_edit.tar.gz 
Filesize  1.75 KB 
Downloaded  372 Time(s) 
desktop_edit.png
 Description   
 Filesize   40.55 KB
 Viewed   1680 Time(s)

desktop_edit.png


_________________
debian wheezy ,linux mint, slackware I use them all and they all have good points
Mint would be best for general users though
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1287
Location: Ukraine

PostPosted: Tue 07 Sep 2010, 15:39    Post subject: nice job  

Dear afishe2000 and big_bass,

Both your little apps are useful. Thanks.

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


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: Tue 07 Sep 2010, 16:20    Post subject:  

This latest Pmenu is really quite nice. I've added it to Puppeee 4.4 and I'm hoping Barry will add it to woof soon.
Back to top
View user's profile Send private message Visit poster's website 
afishe2000

Joined: 29 Jan 2010
Posts: 37

PostPosted: Thu 09 Sep 2010, 14:28    Post subject:  

Thanks to all for the kind words.

It is fairly amazing what can be done with gtkDialog considering it's limitations.
Back to top
View user's profile Send private message 
big_bass

Joined: 13 Aug 2007
Posts: 1747

PostPosted: Sat 11 Sep 2010, 17:52    Post subject:  

Hey afishe2000

well I made another small edit and added the Exec=
to see the code used to launch the desktop with

*I added an icon this time and desktop so it could be packaged
for another version (I use a TXZ format)

the reason I hacked out this part of the code is because it can be re used
for other apps the way you set up the reading of the comments is very clever Very Happy




Joe
desktop-edit2.png
 Description   
 Filesize   43.5 KB
 Viewed   1837 Time(s)

desktop-edit2.png

desktop_view2.tar.gz
Description 
gz

 Download 
Filename  desktop_view2.tar.gz 
Filesize  20.85 KB 
Downloaded  384 Time(s) 

_________________
debian wheezy ,linux mint, slackware I use them all and they all have good points
Mint would be best for general users though
Back to top
View user's profile Send private message 
afishe2000

Joined: 29 Jan 2010
Posts: 37

PostPosted: Mon 20 Sep 2010, 04:11    Post subject:  

See the first post for more details...

pmenu-3.0.0.pet

The pet for 3.0.0 REQUIRES /usr/bin/switch2 from gtk-theme-switch-i386.pet.

Jeff
Back to top
View user's profile Send private message 
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: Tue 21 Sep 2010, 23:47    Post subject:  

After I run pmenu, depending on what gtk theme I was using, the gtk menus are messed up - the highlight color doesn't show.

Do you have any idea if it can be fixed? Otherwise, it's brilliant.
Back to top
View user's profile Send private message Visit poster's website 
afishe2000

Joined: 29 Jan 2010
Posts: 37

PostPosted: Wed 22 Sep 2010, 06:07    Post subject:  

Hum,

That's not good, trying to recreate it...
Back to top
View user's profile Send private message 
afishe2000

Joined: 29 Jan 2010
Posts: 37

PostPosted: Wed 22 Sep 2010, 06:21    Post subject:  

jemimah,

Ah, found the issue - seems to happen to the right click menus.

Looking to see if zigbert's code causes the same problem?

Just wondering if it's a gtk-theme-switch problem or if I implemented his technique incorrectly.

Thanks,

Jeff
Back to top
View user's profile Send private message 
afishe2000

Joined: 29 Jan 2010
Posts: 37

PostPosted: Wed 22 Sep 2010, 09:48    Post subject:  

Ok,

After further research I cannot recreate the problem.

I'm switching between the Brushed and Clearlooks themes using CHThemes.

Brushed looks perfect.

Clearlooks has white highlight text and is hard to read when you use the right click menus. (That is what I thought the problem was.)

This is a problem on my machine with the theme straight out of the box un-modified.

Maybe you can post a screenshot of the problem.

Unless you are talking about "Atom", "Barbee", "Celeron"... themes.

Jeff
Back to top
View user's profile Send private message 
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: Wed 22 Sep 2010, 09:59    Post subject:  

I have the problem with both Brushed and Faraway. (No problem with IceWM themes).
It is a problem with the right click menus - you can't tell what item you're hovering over.

A screenshot would just look like a menu with nothing highlighted.
Back to top
View user's profile Send private message Visit poster's website 
afishe2000

Joined: 29 Jan 2010
Posts: 37

PostPosted: Wed 22 Sep 2010, 10:03    Post subject:  

Here are two screen shots.

Is this what we are talking about?
Clearlooks.png
 Description   
 Filesize   15.67 KB
 Viewed   1632 Time(s)

Clearlooks.png

Brushed.png
 Description   
 Filesize   40.22 KB
 Viewed   1643 Time(s)

Brushed.png

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 3 [41 Posts]   Goto page: Previous 1, 2, 3 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.0797s ][ Queries: 12 (0.0049s) ][ GZIP on ]