![]() |
2007-12-17
, 03:00
|
|
Posts: 693 |
Thanked: 502 times |
Joined on Jul 2007
|
#2
|
![]() |
2007-12-17
, 03:04
|
|
Posts: 1,310 |
Thanked: 820 times |
Joined on Mar 2006
@ Irving, TX
|
#3
|
![]() |
2007-12-17
, 03:29
|
|
Posts: 69 |
Thanked: 3 times |
Joined on May 2007
@ St.Petersburg, FL
|
#4
|
The Following User Says Thank You to blakboy98 For This Useful Post: | ||
![]() |
2007-12-17
, 03:52
|
Posts: 662 |
Thanked: 238 times |
Joined on Jul 2007
|
#5
|
All you should need is the line below.
browserpic = open('/home/user/iTablet/browserpic1.txt', 'r').readline().strip()
browser = gtk.Button()
image3 = gtk.Image()
browser.connect('clicked', browserf)
image3.set_from_file(browserpic)
image3.show()
browser.add(image3)
![]() |
2007-12-17
, 04:44
|
|
Posts: 69 |
Thanked: 3 times |
Joined on May 2007
@ St.Petersburg, FL
|
#6
|
HTML Code: buttonConfig = open('/??/??/buttons.ini').readlines() for b in buttonConfig: if b.find('button1 =') != -1: button1 = b.split('=')[1].strip() if b.find('button2 =') != -1: button2 = b.split('=')[1].strip() if b.find('button3 =') != -1: button3 = b.split('=')[1].strip()
|
2007-12-17
, 07:57
|
Guest |
Posts: n/a |
Thanked: 0 times |
Joined on
|
#7
|
[button1] image=/home/user/browser.png othersetting=whatever [button2] image=/home/user/somethingelse.png ...
import ConfigParser cfg = ConfigParser.ConfigParser() cfg.read("settings.ini") browserpic = cfg.get("button1", "image") ...
The Following User Says Thank You to For This Useful Post: | ||
![]() |
2007-12-17
, 13:18
|
|
Posts: 69 |
Thanked: 3 times |
Joined on May 2007
@ St.Petersburg, FL
|
#8
|
Just having a bit of trouble with some code here. Basically, what I'd like to do is read a text file that contain this:
But the picture only shows up as an X... I have figured out that I can use a variable for image3.set_from_file() but the data that is outputed from text2.read() will not work in it. (Oh, and any typos are not in the actual code, I just had to re-type all that from looking at another screen)
Help, please?
Thanks