Learning gtkDialog (pmenu project)
-
- Posts: 37
- Joined: Fri 29 Jan 2010, 16:09
Refreshing a pixmap image using a button.
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...
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: Select all
#!/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
Re: Refreshing a pixmap image using a button.
afishe2000,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.
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
jemimah
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
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
- Attachments
-
- desktop_view_edit.tar.gz
- (1.75 KiB) Downloaded 534 times
-
- desktop_edit.png
- (40.55 KiB) Downloaded 1798 times
-
- Posts: 37
- Joined: Fri 29 Jan 2010, 16:09
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
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
- Attachments
-
- desktop-edit2.png
- (43.5 KiB) Downloaded 1991 times
-
- desktop_view2.tar.gz
- (20.85 KiB) Downloaded 549 times
-
- Posts: 37
- Joined: Fri 29 Jan 2010, 16:09
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
pmenu-3.0.0.pet
The pet for 3.0.0 REQUIRES /usr/bin/switch2 from gtk-theme-switch-i386.pet.
Jeff
-
- Posts: 37
- Joined: Fri 29 Jan 2010, 16:09
-
- Posts: 37
- Joined: Fri 29 Jan 2010, 16:09
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
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
-
- Posts: 37
- Joined: Fri 29 Jan 2010, 16:09
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
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
-
- Posts: 37
- Joined: Fri 29 Jan 2010, 16:09
Here are two screen shots.
Is this what we are talking about?
Is this what we are talking about?
- Attachments
-
- Clearlooks.png
- (15.67 KiB) Downloaded 1770 times
-
- Brushed.png
- (40.22 KiB) Downloaded 1770 times
-
- Posts: 37
- Joined: Fri 29 Jan 2010, 16:09
-
- Posts: 37
- Joined: Fri 29 Jan 2010, 16:09
Ok,
Finally able to duplicate the problem, and it's a weird one.
I'm using a fresh full install of Puppeee 4.4 beta 2.
Change your theme to Brushed.
Open Chrome and Geany and test the menus work normally.
Open pmenu and select a program from either list so the icon shows.
While pmenu is still open test the menus on Chrome and Greany. (Should function normally)
Close pmenu and check the menus again. (No highlighting for the menu system)
Close and reopen Chrome and Greany and check the menus again. (Should function normally)
You can also fix the problem by re-applying the theme.
Doesn't seem to effect Firefox, still checking other programs.
May take some research to figure this one out....
Jeff
Finally able to duplicate the problem, and it's a weird one.
I'm using a fresh full install of Puppeee 4.4 beta 2.
Change your theme to Brushed.
Open Chrome and Geany and test the menus work normally.
Open pmenu and select a program from either list so the icon shows.
While pmenu is still open test the menus on Chrome and Greany. (Should function normally)
Close pmenu and check the menus again. (No highlighting for the menu system)
Close and reopen Chrome and Greany and check the menus again. (Should function normally)
You can also fix the problem by re-applying the theme.
Doesn't seem to effect Firefox, still checking other programs.
May take some research to figure this one out....
Jeff