I wender if there is standard or custom control on wxpython to display text and other media to gather ,i mean something similar to web browser.
i tried webview but it is not support html5 elements of media.
The simple answer is "No". wxPython does not have such a control. I do think webview will get you the closest to what you want. For video, you will have to use wx.Media:
http://www.wxpython.org/docs/api/wx.media.MediaCtrl-class.html
If you really need to have an all-in-one control, then you'll have to create your own custom widget or look at a different UI toolkit to see if they have the widget you need.
Related
I've made a GUI for my application but I've to make it look professional. Currently, I think it's looking casual. Also, I want to print some outputs to the textbrowser widget. How should I do that?
I've tried making some changes to stylesheets of widgets, but the options available are not adequate.
My GUI looks like this
The QTextBrowser class provides a rich text browser with hypertext navigation. It opens a URL to display, not plain text.
Use something like a QPlainTextEdit, or a QTextEdit for doing this.
They have methods like appendText, or appendPlainText.
Alternatively, you could have a website and host your text there, but that seems overly complicated.
I wanted to make a program that will view this website in a window with sound not opening any sort of browser but I can not seem to find any thing what would help me
PyQt Designer should be able to do this. You can tell it what website you want it to go to, and then just either make the window transparent, or make it hidden. The Widget you would use for this is QWebEngineViewer.
I have been able to create normal popup menus (such as context ones) using self.PopupMenu(menu, pos) and constructing a menu however one issue I run in to is that whenever I pop it up (say when I change the text in a text box ala search such as in Google Suggestions or iTunes) it will change the focus to the context menu. This seems to be built into the PopupMenu system, is there a way to show a menu but not give it focus.
Examples
Similar to (but not exactly) SuperTooltip in wxPython Demo
What these are (but in wxPython) https://developer.apple.com/library/mac/documentation/userexperience/conceptual/applehiguidelines/Windows/Windows.html#//apple_ref/doc/uid/20000961-SW4
Right now it looks like I just should create it out of a dialog with no title etc.
iTunes
Google Search
It sounds like you want an autocomplete window. There's an article on this topic on the wxPython wiki here:
http://wiki.wxpython.org/TextCtrlAutoComplete
You might also find this article helpful:
http://megamicrobase.wordpress.com/2009/01/16/adventures-in-wxpython-autocompleting/
Or perhaps this thread:
https://groups.google.com/forum/#!topic/wxpython-users/tgQcNj0b1kY
I'd like to make a small desktop editor to take notes, that uses markdowns to format text quickly. The application should transcribe markdowns instantaneously or after clicking on a button.
For this I'd like to use Qt4 and Python.
What, in your opinion, is the most efficient way to proceed?
In the case the rich text is rendered after pressing a button, I suppose I could use QTextEdit widget for the edit-mode, but what to use to display the rich text? I want this to look good. Should I render the text in HTML? Or something else?
Please advise.
You can look at how ReText has done it. Maybe even ReText is the app you want to code :-)
I came here because I'm looking for a solution for the same task.
Here is what I would (or hopefully will) try:
Subclass QTextEdit, which can display both plain and rich text.
supply two string properties, one containing Markdown source, the other generated HTML.
For entering "edit mode" (however your UI will handle this)
self.setText(self.markdown)
self.setReadOnly(False)
For leaving "edit mode":
self.markdown = self.toPlainText()
self.toHtml() # convert self.markdown to self.html
# don't know yet how to achieve that
self.setHtml(self.html)
self.setReadOnly(True)
For displaying the HTML one can use a CSS stylesheet.
As UI interface I could imagine: clicking on the readonly display mode switches to edit mode, [Ctrl]-[Enter] triggers HTML generation.
Is there a widget for wxPython like the SuggestBox in Google Web Toolkit? It is basically a magic text box that can invoke some code to come up with suggestions relevant to whatever the user has entered so far. Like the search box on Google's web page.
If such a widget isn't already floating out there, I'd appreciate a sketch of how I might implement it with the existing widgets.
You might want to look at Combo Box that Suggests Options.
I hope this is what you were thinking of.
Few years ago I made a control like this by subclassing TextCtrl. It supports HTML formating for suggestions. Here you go.