Creating window layout in PyGTK 2 - python

I am trying to create a simple aplication in Python 2.7 using PyGTK 2. The main window will contain several widgets (like buttons and a tree view). I know that I can place these widgets in window using options like gtk.Box, gtk.Fixed or gtk.Layout.
Which of these would be better to use? Are there any other possibilities?
Thanks.

Related

How to implement a toolstrip to my GUI?

I am creating a simple application to manage unknown words when learning a new language. The application is written in Python and I am using Tkinter to build the GUI.
As you can see, I am almost done - all I need is a toolstrip with several buttons on it, but it seems that there is no toolstrip widget in Tkinter. How can I overcome the issue?
There is no toolstrip widget when it comes to Tkinter.
You have three options:
1) If you want to continue building your application using Tkinter, you could create a frame at the top of your GUI and add some buttons into it, which would act as an alternative to a toolstrip.
2) You can design your own widget using Tcl, which is definitely a lot of effort for a beginner.
3) You can start from scratch by switching to PyQt which has QToolBar and QMenuBar (depending on whether you want icons or text as buttons in the toolstrip).

wxpython beautiful widgets

As I was looking into the widget creations tutorial in wxpython. I saw that all of them has the window look but I want a widget like the one you can see on windows 7 (clock widget etc.) or like the one advanced systemcare has.
So my question how can I make such a widget in wxpython if I can at all?
wxPython will look like the OS's native widgets. If you need to do something more advanced, then you'll have to write your own widget. There are lots of examples of custom widgets included with wxPython. Take a look at anything in wx.lib.agw. All of those are custom made widgets, written in Python.
Here are a couple of other links:
http://wiki.wxpython.org/CreatingCustomControls
http://zetcode.com/wxpython/customwidgets/

Combining 2 UI as one main app window in python

I created a main app with a mdiArea for loading map graphics with Qt Designer *.ui and coded with pyQt4 using uic.loadUi() in python.
I also created a separate *.ui file and tested the dockWidget successfully in a separate python script file.
I wish to combine these 2 UI so that the main_app window will have the mdiArea widget on the left, while the dockWidget as the info_panel on the right.
I tried to load the *.ui file in the main app python, but ended up the dockWidget as a separate window when show().
Any advice to resolve this?
I hope I need not have to use Qt Designer to combine the mdiArea main_app UI with the dockWidget info_panel and load them as a single UI. ;P
Thanks in advance.
I've worked on some software where every different pane is done as a separate. Ui file, so that they can be changed independently without requiring merges. It worked fine. Can you turn the map and dock parts into widgets, and then make a new "main window" ui, and then give that a layout and add the other two as child widgets to it?

where is the button widget in pyglet ?

i'm checking out pyglet, but, funny enough, i can't find how to do a simple button!
so
what is the standard way to create a standard button?
is there a standard way to create a Message-Box? open/save dialogs?
or am i missing the point of pyglet? isn't it yet-another gui toolkit
for creating (also) forms, windows, buttons, texts, standard widgets, etc. ?
i'm using Python 2.x on a windows PC if that matters.
I didn't use Pyglet yet, but is not a GUI library, it doesn't have to have widgets like buttons, or containers etc. It's a multimedia library like Pygame, it draws stuff on screen, plays sounds, and has some helper functions.
If you want to draw a button on screen, you should first draw a rectangle, print some text in it, and then listen mouse clicks to know if it's clicked on this rectangle.
See PyQT, PyGTK, WxPython for some examples of GUI libraries.
You can see an example of how to create a button and create yet another interface with Pyglet in the script:
http://www.pyglet.org/doc/programming_guide/media_player.py
But this is only an example interface created without complex items.
Current state of affairs 3 years later...
As previously stated Pyglet itself generally provides a lower level api than the UI widget library (e.g. closer to GDI or SDL).
That said there are gui's built on top of pyglet:
https://github.com/jorgecarleitao/pyglet-gui
https://code.google.com/p/kytten/
Also pyglet 1.2 now has buttons itself (though not much else as far as widgets are concerned).

Help in designing layout with qtdesigner for python

I am working on Qtdesigner for generating a GUI for my python app.
The problem is that I had manually made the widgets and then compiled it to py. But then I found out that the components did not resize when maximised.
So I opened the .ui file in designer and selected the group box for my widgets and chose layout in grid by right clicking on it.
Even now the widgets do not resize on maximising....
Do I have to do something else ???
Thanks a lot...
To have the widgets resized with the window, you must apply a layout to your top-level object (usually QMainWindow), and then place your new widgets where you want in the layout (and maybe other layouts for a more complicated window).
NOTE: the menu items allowing to apply a layout on the main window will be available only once you have placed your first widget in it.

Categories