I have created a listctrl with some of the data in the listctrl are very long, and instead of showing all of the text it ends with .... For example Att PSSM_r1_0_T is [-10.179077,0.944198]|Att PSSM_r1_0_Y is.... How would i be able to make it so it shows all of the text. Something like
Att PSSM_r1_0_T is [-10.179077,0.944198]|Att PSSM_r1_0_Y is
[-4.820935,9.914433]|Att PSSM_r1_2_I is [-8.527803,1.953804]|Att PSSM_r1_2_K is [-12.083334,-0.183813]|Att PSSM_r1_2_V is
[-14.112536,5.857771]|1
As the text is very long I would prefer if it covered more than one line.
I don't think that is possible to do with a standard listctrl.
Try poking around at the UltimateListCtrl, being a full owner drawn listctrl it has the ability to change the way its looks far more than a standard listctrl.
Related
I'm working on a shopping cart GUI. I have a list called my_order, which stores the information I get from the user. I want to update label text in a for loop so I can print all the elements of my_order list. Here's my code:
class PaymentScreen(QMainWindow):
def __init__(self):
super(PaymentScreen, self).__init__()
loadUi("paymentscreen.ui",self)
self.gobackbutton.clicked.connect(self.goback)
self.basket.setText("{}".format(my_order)) #the output looks like ["burger","fries"] and I dont want that
I'm trying to print all the elements one under the another instead of that list view. I looked for the similar cases but couldn't find the solution.
I want the output to look like this:
burger
fries
How can I do that?
I want to update label text
I am no expert in Python GUI but i am good in python programming and I assume you want the string inside setText to be a multiline string. I could help with that.
You can use something line this:
self.basket.setText("\n".join(my_order))
I created a Map using python folium in jupyter lab. On the Map I display some geoJson-Files as shapes.
What Works so far:
The Shapes from the GeoJson file are displayed nicely on the map. I can change the color of the shapes based on a self generated style_function which checks feature['properties']['id'] to adjust the style type accordingly.
I'm also able to get a GeoJsonPopup on_click to a shape. The Popup shows id and the content of the id property of that shape.
geo_popup = folium.GeoJsonPopup(fields=['id'])
my_json = folium.GeoJson(file.path, style_function=style_function, popup=geo_popup)
my_json.add_to(map)
What I want:
I want to display in the popup some content based on the id. Very basic Example: if id = 1 i want to display 'This is the region Alpha' or if id = 2 -> 'This area is beautiful'.
Alternatively, if that is not possible, I would like to present a Link in the Popup where i can Access a Page with a parameter to show dedicated content for that id.
What I tried
I tried to derive a class from folium.GeoJsonPopup and somehow write content to the render function. But, however, I don't really get how it works and therefor all I did wasn't successful. Probably I took somewhere the wrong path and the solution is pretty easy.
Thanks for advice!
I followed the linked sample in the comment to the question. Therefore I had to add the needed dict entries to the the features properties.
Therefore I can link to this question. I used the .update from the solutions last comment to add the values.
I have a Python output in a Zapier output that looks like this:
I want to be able to use this in the body of gmail as separate lines. However, presently, it looks like this when I use that python output as the step. The screenshot below is the email returned after I test.
Is there a filter or a pythonic way to do this within Zapier?
The output would ideally look like this:
https://hectv.sharefile.com/dxxxxxxxfcebd247d09
https://hectv.sharefile.com/dxxxxxxx729cd9494
https://hectv.sharefile.com/d-xxxxxx84622a
Thank you.
William from Zapier answered this for me.
If we're generating a line item array with the code step and we need individual items, you'll want to add a Formatter - Utility - Line Item to Text action.
This action will go just after the Run Python step and should take the Sharefile Output as the input for the formatter. From there, the formatter can break the line item array down into individual text strings that you can assign in the zaps remaining steps. :)
For more information on Formatter check out our article here: https://zapier.com/help/create/format/get-started-with-formatter
For more info on Line Item to Text, check out this article: https://zapier.com/help/create/format/convert-line-items-into-text-strings
Using Line Item to Text, the zap won't care if there are 10 items or a single item, it should still return the same individual items. The main concern there is that the test that is done with Line Item to Text should be a test that include the MAX number of items. This way those items can be assigned in the following steps and used when they're present or ignored when they are not.
just a simple question on a wx.TextCtrl element.
i have this text field where on an application, where the user can add a string on it.
i want a text field with a red text on it.
so i've generated this code:
self.hRepositoryTextfield = wx.TextCtrl(self.hPanel)
self.hRepositoryTextfield.SetDefaultStyle(wx.TextAttr(wx.RED))
if the user copy on this text field some string with applied font on it (for example a black coloured string, or a string with a particular font) the red color, anyway the default style is not respected.
i would like the style i decide for my wx.TextCtrl is always forced according my settings.
how can i do?
thank you in advance
axel
The SetForegroundColor might work on one OS and not on another. It depends on the native widget. I would set the TextCtrl's style flag to wx.TE_RICH. Check out the wxPython demo for an example. You can also use the StyledTextCtrl or FancyText of even the HTMLCtrl.
self.hRepositoryTextfield.SetForegroundColor(wx.RED)
that should work ....
i solved the problem in this way:
in the first part of the code it is defined my textfield style...
self.hRepositoryTextfield.SetStyle(0, len(self.hRepositoryTextfield.GetValue()), wx.TextAttr(wx.RED))
self.hRepositoryTextfield.SetFont(self.hFontLabel)
self.hRepositoryTextfield.Bind(wx.EVT_TEXT, self.forceDefaultStyle)
... then i bind every text change to my forcing-style function:
def forceDefaultStyle(self, event):
hEventObject = event.GetEventObject()
hEventObject.SetStyle(0, len(self.hRepositoryTextfield.GetValue()), wx.TextAttr(wx.RED))
hEventObject.SetFont(self.hFontLabel)
and it works!
I'm experimenting with wxPython,
I have a tabbed interface (notebook) and each tab is basically a file list view (yes, I'm trying to make a file manager)
The file list inherits from wx.ListCtrl, and the tabbed interface inherits from wx.Notebook
I'm just starting .. and I had it so double clicking on a folder will cd into that folder, but I want to also change the title of the tab.
How do I do that?
I have the object that represents the file list and the title I want to set it to,
[ EDIT Notebook.SetPageText() takes a number, so I can't pass the tab object directly to it ]
my current approach is to cycle through the tabs until one of them matches my tab:
for tab_id in range(self.GetPageCount()):
if self.GetPage(tab_id) == tab:
self.SetPageText(tab_id, title)
break
This seems rather naive though, isn't there a smarter approach?
I don't know wxPython, but I assume it wraps all the methods of the C++ classes.
There is wxNotebook::GetSelection() which returns wxNOT_FOUND or the index of the selected page, which can then be used to call wxNotebook::SetPageText().
Or use wxNotebook::GetPage() with this index to check whether it is equal to tab.
I think doing something like this helps :
notebook.get_tab_label(notebook.get_nth_page(your_page_number)).set_text("Your text")
If you want to have a reference to the current tab always, you must connect the "switch-page" signal, and save the page in a variable.
As .GetPage returns a wx.Window, I think tab.Label = title should work.