In a gui I have a grid. In this grid each row represents an order. To the right of each row, I would like to place a 'cancel button'to cancel the order. When new rows are added this should automatically come with a cancel button.
I did some seaching but apart from this FAQ-question which states that you have to design something yourself (did not help me much). Al other material was based on usage of Tkinter which I do not want to do.
So Two questions:
(1) Does anyone know of a way to place a button in a grid cell in wxpython?
(2) If not, does anyone know of a solution for my requirement?
Thanks,
Django
There isn't really a "built-in" way to do this. You would need to create a custom Renderer. According to Robin Dunn (creator of wxPython) in this thread, you could create a button using wx.RendererNative.DrawPushButton.
I would also recommend taking a look at the wxPython demo as it has some other examples of custom renderers too.
Related
I am currently building a simple app to encrypt files using AES encryption in python but the biggest downside of using Tkinter is the look of the UI. I did some research and found examples of what I want but do not know how to recreate it. (Example)
My problem is that when I replace buttons with images (like the OP of the Reddit post said he did in order to have a decent looking UI) I end up with an ugly bar of grey. (Image of the button)
I also want to remove the same type of bar with frames so if you have the answer for specifically that it would still be appreciated.
Support for for styles and themes has existed in tkinter for some time. A theme being a collection of styles for different widgets.
You can read more about style and themes here.
To the best of my knowledge, the standard widgets to not support rounded corners. All widgets have rectangular shapes.
You might be able to create something like that using a Canvas, but it would be a significant amount of work.
A more relevant point is that it might confuse your users if you don't reproduce the way the standard controls work.
UI elements are standardized for the same reason the controls in a car are; once you know one of them you can use all of them.
I have a splitter window with a list box on the left and a panel on the right. When I click on an item in the listbox, the panel changes to a panel that is specific to that item. Many of these panels look similar by design, and are all generated from the same class with settings taken from the item.
I would like to add some sort of feedback so the user can tell that something has changed. Something basic, like the panel switching to empty panel for a fraction of a second, and then switching to the new panel would suffice.
Do you have any suggestions on the best way to do this? Does wx have a feature that already handles this or something similar? Will I just have to do exactly what I outlined above, if so, if there a recommended time to display the blank panel? I could play around with timing to find what I feel is right, but I'm sure there has been studies into simple concepts like this. I may end up choosing a delay that is too quick and most users may miss it, but it may seem normal to me as I am the one testing it. I may prefer shorter delays so I can test more quickly, and my opinion will be biased.
I would like to implement a swipe or flipper view (widget) using PyGtk for my Quickly app. There should be a titlebar that contains the title of the currently showed content and the titles of the previous and next entry. To navigate threw the different entries you should be able to click the titles or swipe from left to right or vice versa.
But I do not know where to start.
Which Widget should I extend?
Would the Notebook widget the right choice?
How could I change the style of a Widget?
How do I implement the flip effect?
Do I have to combine different views (widgets) for the content pane and the titlebar?
For a better understanding of my problem view the screenshot below.
Thanks and best regards
Andreas
You might want to take a look at Clutter. Though I think, this kind of UI-Design could be very unintuitive on a desktop machine.
I'm new to PySide and Qt at all, and now need to create an application which has a tree view with styled items. Each item needs two lines of text (different styles), and a button. Many items are supposed to be in the view, so I chose QTreeView over QTreeWidget. Now I managed to add simple text items (non-styled) to the QTreeView and have almost no idea about how to place several widgets on one item. Could you please give me an example of how to create such design?
I've found some samples on the Internet, that are similar to what I want, but they all are in C++, and it's not obvious how to convert delegates and other things to Python. I'm now really confused about it all...
I'd recomend you use simple QTreeWidget and insert complex widgets with setItemWidget. While Qt's widhets are alien, they are not so heavy to draw, but:
You shouldn't create delegates.
You shouldn't handle events (If you are going to place button in view and draw it using delegates, you had to handle all its events, such as mouseOver, focus changing, etc. It is a lot of work.
Do you know if there is an easy way to drag-and-drop elements (icons or buttons) into a canvas and create different drawings on it as a result?
The idea is to have a set of objects and let the user drag them into a drawing space.
In the worst case the user could just click on the icon/button, and then click on the canvas and draw the element in the position, but I think the dragging is more intuitive.
There is an example of something more or less like this here: http://wiki.wxpython.org/wxOGL Although it is about wxOGL, they recommend you to use either SimpleCanvas or FloatCanvas and adapt their examples.
I assume you are building a browser app? If so, the jQuery UI Droppable plugin provides most of the standard functionality, and is pretty easy to modify to fit custom needs. Here's the link: http://jqueryui.com/demos/droppable/