[x-posted to PyGTk mailing list as well]
Hello!
I'm trying to figure out how to use PYGTK to implement a rudimentary UI:
I want to have an Image as the background, and then be able to put buttons
(eventually icons, but buttons for now)
The PyGTK FAQ (pygtk.org) has some suggestions, but they have failed
to clear up the issue. Using their suggestions as a starting point,
I've arrived at the below. However, it fails in that I can't seem to
place the image behind the button. There is a FAQ entry specifically
on this at PyGTK.org, but that fails to show the pixmap (it is
obscured completely when we place a button in the Fixed widget), and
fails to allow the pixmap to be scrolled.
Can anyone show a minimal example of how I might achieve having the pixmap
as the background of the Fixed widget?
Thanks
Johan
def __init__(self):
# create the main window, and attach delete_event signal to terminating
# the application
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.connect("delete_event", self.close_application)
window.connect("destroy", self.close_application)
window.set_border_width(0)
hbox= gtk.HBox()
window.add(hbox)
hbox.show()
swin1 = gtk.ScrolledWindow()
swin1.set_policy(gtk.POLICY_ALWAYS, gtk.POLICY_ALWAYS)
swin1.set_size_request(600, 600)
hbox.add(swin1)
swin1.show()
fbox1 = gtk.Fixed()
swin1.add_with_viewport(fbox1)
fbox1.show()
ebox1 = gtk.EventBox()
fbox1.put(ebox1,0,0)
ebox1.show()
image1 = gtk.Image()
image1.set_from_file("/home/johan/bg.jpg")
ebox1.add(image1)
image1.show()
widgetinfo( image1)
b = gtk.Button("FOO")
fbox1.put(b, 200,200)
b.show()
widgetinfo(b)
ebox1.set_events(gtk.gdk.BUTTON_PRESS_MASK)
ebox1.connect("button_press_event", self.button_clicked)
window.show() 0 1315 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: zinc |
last post by:
Hi Pythoneers,
Im interested in trying some gui programming with the GTK2 toolkit. I
found this brief article,(http://www.linuxjournal.com/article.php?sid=6586),
that speaks about utilising...
|
by: Mark Mitchell |
last post by:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I have a program written in python that tells me it requires PyGTK, so I
DLed, ./configure, make, make install and the process seems to go ok. Some...
|
by: Samuele Giovanni Tonon |
last post by:
hi,
i'm trying to develop a trivial application which random copy files
from a directory to another one.
i made it using pygtk for the graphical interface, however i find
some problem with...
|
by: dcrespo |
last post by:
Hi all...
I think wxPython is much better than PyGTK. First of all, PyGTK needs
the GTK runtime installed, whereas wxPython is entirely Python's
modules, so It facilitates the apps'...
|
by: TPJ |
last post by:
GUI's etc: PyGtk on Windows
"(...) So if someone develops mainly for X and just wants to make sure
that it is not impossible to run on Windows, you can use PyGTK. (...)",
July 2nd, 1999
pyGTK...
|
by: Tim N. van der Leeuw |
last post by:
I tried to create a windows executable of a pygtk program. My first
attempt worked, kinda, except that no themes were applied and no
readable fonts were found by pango; so all letters where just...
|
by: krishnakant Mane |
last post by:
hello,
I will be writing some code in PyGTK to run on linux. but I want to
know if there are any installers or distutils available for PyGTK on
windows?
I have heard that installing gimp or even...
|
by: He Jibo |
last post by:
Hi, Everyone,
Could someone help me how to install pygtk? I get some problems with
it.
Here is the error I get while install pygtk:
https://netfiles.uiuc.edu/jibohe2/error.GIF?uniq=-k6678k
...
|
by: Michael Palmer |
last post by:
On Sep 16, 12:30 pm, binaryjesus <coolman.gu...@gmail.comwrote:
I haven't tried it myself, but I came across a blog post the other day
that describes a way of building windows installers for...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |