| Author |
Message |
afishe2000
Joined: 29 Jan 2010 Posts: 34
|
Posted: 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
|
|
 |
afishe2000
Joined: 29 Jan 2010 Posts: 34
|
Posted: 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
|
|
 |
seaside
Joined: 11 Apr 2007 Posts: 836
|
Posted: 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
|
|
 |
big_bass

Joined: 13 Aug 2007 Posts: 1736
|
Posted: 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
| Description |
|

Download |
| Filename |
desktop_view_edit.tar.gz |
| Filesize |
1.75 KB |
| Downloaded |
314 Time(s) |
| Description |
|
| Filesize |
40.55 KB |
| Viewed |
1561 Time(s) |

|
_________________ slackware 14
|
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1231 Location: Ukraine
|
Posted: 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
|
|
 |
jemimah

Joined: 26 Aug 2009 Posts: 4309 Location: Tampa, FL
|
Posted: 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
|
|
 |
afishe2000
Joined: 29 Jan 2010 Posts: 34
|
Posted: 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
|
|
 |
big_bass

Joined: 13 Aug 2007 Posts: 1736
|
Posted: 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
Joe
| Description |
|
| Filesize |
43.5 KB |
| Viewed |
1599 Time(s) |

|
| Description |
|

Download |
| Filename |
desktop_view2.tar.gz |
| Filesize |
20.85 KB |
| Downloaded |
328 Time(s) |
_________________ slackware 14
|
|
Back to top
|
|
 |
afishe2000
Joined: 29 Jan 2010 Posts: 34
|
Posted: 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
|
|
 |
jemimah

Joined: 26 Aug 2009 Posts: 4309 Location: Tampa, FL
|
Posted: 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
|
|
 |
afishe2000
Joined: 29 Jan 2010 Posts: 34
|
Posted: Wed 22 Sep 2010, 06:07 Post subject:
|
|
Hum,
That's not good, trying to recreate it...
|
|
Back to top
|
|
 |
afishe2000
Joined: 29 Jan 2010 Posts: 34
|
Posted: 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
|
|
 |
afishe2000
Joined: 29 Jan 2010 Posts: 34
|
Posted: 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
|
|
 |
jemimah

Joined: 26 Aug 2009 Posts: 4309 Location: Tampa, FL
|
Posted: 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
|
|
 |
afishe2000
Joined: 29 Jan 2010 Posts: 34
|
Posted: Wed 22 Sep 2010, 10:03 Post subject:
|
|
Here are two screen shots.
Is this what we are talking about?
| Description |
|
| Filesize |
15.67 KB |
| Viewed |
1476 Time(s) |

|
| Description |
|
| Filesize |
40.22 KB |
| Viewed |
1483 Time(s) |

|
|
|
Back to top
|
|
 |
|