I am trying to create a GUI in Jython. I want to import a background image that I can place buttons and textfields on. I've already created the frame with the buttons and labels in their appropriate places, I just need to know how to import a background image. The GUI is implemented in Jython.
Take a look at the Java swing material, essentially you are just using the same api in python syntax. This might help: http://forums.sun.com/thread.jspa?threadID=599393
Related
We have an appointment schedule that fills up and I would like to display information about each square, graphically. See the picture.
I would love to find a graphics library that I can access via Python to build out something like this and update it. Note that each "cell" in the grid has multiple values we'd like to display.
Could you advise on libraries that may be appropriate for this task and the learning curve for a back-end dev forced to do front-end work?
I am not sure if it's something that you are looking for but would something like Tkinter or Kivi work? Both of them are GUI libraries and Kivi can be used to convert your programme into a mobile app.
You could potentially use PyGame and use it to create a cell using it.
There are lots of GUI environments for Python like Qt, tKinter, wx, PySimpleGUI, etc. so I have not been able to go through very many of them. I would like to know if there is one which is
somewhat similar to Visual Basic's (drag and drop and resize),
allows for arrays of textboxes and labels.
It should preferably be open source,
should create stand alone *.exe files,
and not requiring browsers.
The closest match to your requirements is probably PySimpleGUI. Doesn't have drag and drop, but you don't really need it. It takes 1 line of code to configure and place a widget into your window. You easily make an "array of textboxes and labels". Runs on tkinter or Qt.
Would that there were a simple drag and drop GUi builder for Python!
You might try appJar. It's not drag and drop but it seems pretty straightforward.
QtDesigner is drag and drop. It's part of the PyQT suite. QtDesigner creates XML (.ui) files which can then be translated to .py files. Michael Herrmann's site
shows how to do this with a minimum amount of overhead.
I personally recommend my project https://github.com/cdhigh/tkinter-designer.
tkinter-designer implemented a add-on in VB6, you can design your GUI in VB6 (drag and drop, resize, align, color, key-bind,...), and then this add-on generate a complete code frame. what you will do is add logic code in event method like coding in VB.
PS: You can install nano version of vb6.
I've created a gameboy color emulator using C++ and am ready to start developing the frontend that will display the emulator's viewport, emit audio, and also display some debug information.
I'm looking into using Kivy to create the UI frontend and boost.python (which looks pretty promising) to interop between the C++ core and the python UI.
What I would like to have in my front end are:
A window to show the emulator graphics. More specifically something that let's me update a raw bitmap (i.e. raw pixel data) on each frame.
A window to display some debug information. More specifically I want a large scrollable text box to show the disassembled code and another one to show the memory.
A way to emit audio that's generated by the emulator. The core doesn't support audio yet so I'm not sure what it'll look like on the C++ side.
Accept keyboard input to control the game.
Will Kivy allow me to do all of this? I see that it has dependencies on glew and sdl2 which should take care of the graphics and audio requirements, right? Are there widgets that will let me create the disassembly and memory viewer?
A window to show the emulator graphics, update a raw bitmap on each frame
Not sure how exactly, but you have access to textures and to a huge part of OpenGL through Kivy and Python, so this could be doable.
A window to display some debug information, large scrollable text box
Use RecycleView and Label's core. There's an example for ListView, but since the new changes it's kind of broken. However, in a similar way it could be done for RecycleView
A way to emit audio that's generated by the emulator
Should work without problems if you can pass it to the provider. The only issue I see with built-in audio support in Kivy is pause and seek, because those afaik either aren't implemented (most probably) or are broken. However with Gstreamer it should work.
Accept keyboard input to control the game.
Keyboard and multitouch work out of the box with Kivy, you only need to (for keyboard) extend one method and (for touch) check for collisions with Widgets
Are there widgets that will let me create the disassembly and memory viewer?
No. At least none that I know will do that out of the box. If by disassembly you mean text, dump it into a widget that can handle text. Memory viewer however isn't there and you'll need to create your own widget. That's not hard if you work with Kivy at least for a while.
Kivy by default doesn't do 3D. There are "plugins" that can allow you such thing, but I don't see any that's still maintained so there's this thing. Also I see the code isn't C, but C++ so I'm not sure how to bind those together. Cython should be the rescue here ^^
My goal is to capture frames from a webcam as efficiently as possible using OpenCV. At the moment I'm able to capture 30FPS 6408*480 drawing directly onto a wxPython panel using the standard drawing context (BufferedPaintDC), with about 15% CPU usage (older Core Duo processor). What I'm curious is what sort of performance boost (if any) I'll see if I embed a PyGame canvas within a wxPython frame, and draw directly to the PyGame canvas.
What I'm not sure about is whether the bottleneck is the wxPython frame, and if embedding a PyGame canvas will actually do anything. Or does the wxPython frame act simply like a container and has no influence on the PyGame canvas? I'm hoping I'm making sense here.
The other option would be to use PyGame exclusively, however I really like the functionality of the wxPython widgets, so I'd hate to lose that.
Or is there a faster canvas that I can integrate into wxPython that I'm not aware of?
Thoughts? Thanks.
I don't know why you'd want to embed a gaming library into wxPython in the hopes of gaining a performance boost. Personally, I don't think that will happen. You should take a look at the currently supported drawing canvases that wxPython provides instead or explain what you're trying to do. People have done in games in wxPython...
Anyway, the main drawing interfaces for wx today are wx.GCDC / wx.GraphicsContext, cairo, FloatCanvas, or GLCanvas. Of course, there are also wx.DC, wx.PaintDC and the one you found as well.
I'm developing a screen shot utility in Python. At the moment it is specifically for Linux. So far I have the ability to take a screen shot of the full desktop, and have it upload to Imgur, then copy the link to clipboard. Now I want to expand into functions such as screen shots of the active window, or of a specific selection. If anyone could help, I'd love to know what kind of module would work best for this, and how to implement such a module.
The functionality will depend on what you are using for image grabbing.
With PIL
http://effbot.org/imagingbook/imagegrab.htm
With GTK
To take a screenshot of active window :
http://faq.pygtk.org/index.py?req=show&file=faq23.039.htp
Also look at the pixbuf api
http://library.gnome.org/devel/gdk-pixbuf/
http://developer.gimp.org/api/2.0/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html
Off topic
There are some screen cast tools: http://pypi.python.org/pypi/castro/1.0.4