How can I change the size of the main interface (where most of the dashboard is)?
I made a dashboard using Streamlit. This dashboard has a sidebar and the main interface. I realized I need to hide the sidebar if I want to see the entire dashboard. Of course I can scroll right if I want to see the entire main interface, but this is exactly what I want to avoid.
How can I do this?
Related
What is the equivalent to the browser's "Box Model" Layout Inspector in the browser debugger, but for kivy?
I come from a background of web development, where "UI" debugging is done in a browser. Probably because of widespread rendering issues (w3c standards ambiguity or implementation errors in web browsers), the tools for debugging "why did my HTML render like that!?!" are quite sophisticated in web browsers.
I can simply press F12 in Firefox (also now Chromium) to open a debugging window, click on the top-left-most button (the element picker), then as I drag my mouse across the page, every distinct element (as well as a tree of breadcrumbs to the given child element) is highlighted.
If I click on a given UI element, then the html element cooresponding to the UI element is highlighted, all CSS elements are also shown, as well as a "Box Model" in the Layout tab that shows me clearly the width, height, margin, padding, and border of the element. This "Box Model" is so extremely helpful to figure out, tweak, and fix UI rendering issues when designing web pages.
Enter UI development with kivy, it takes me days instead of minutes to figure out what's going on because I don't know of a similar tool.
I want a way to be able to wrap a given kivy app with some debugger such that, as I hover over widgets in my kivy app, the full tree (breadcrums) of that tree is shown in real-time as I move my mouse across the screen. And if I click somewhere in the app, it dumps for me all of the properties of that widget, such as width, height, spacing, padding, etc (actually just enumerating the entire __dict__ of the given widget object). And, ideally, a visual representation of that widget and its sizing is displayed, like the "Box Model" screenshot above.
What's the best equivalent in kivy development for the web browser's debugger and "Box Model"?
I am quite new to wxPython and want to build a wizzard. I used this guide as a base ("wxPython: How to Create a Generic Wizard"). I tried to add some widgets the panel, e.g. some radio buttons at the second page by inserting the following code at line 56 in add_page():
if(title=="Page 2"):
k1=wx.RadioButton(panel,-1,'Argument1',(35,60),(150,20), style = wx.RB_GROUP)
k2=wx.RadioButton(panel,-1,'Argument2',(35,80),(150,20))
But as soon as I try to add some sizer to the the second panel, all pages are affected. I tried quite a few variations of where to place the sizers, but without success. So my question is: is this the appropriate place to modify the individual pages and could someone give me a hint of how to write a minimalistic example of e.g inserting a boxSizer and a button in the first page and a boxSizer and a RadioButton in the second page?
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've got a text view and a web view, each inside a scrolled window of their own and I'm trying to achieve synchronized scrolling between the two but I can't seem to get it to work.
The web view is basically taking the text from the text view and rendering it as marked up HTML via webview.load_html_string(). I think the problem could be the delay in loading the HTML as every time the web view is refreshed it is scrolled back to the very start.
Right now I call a function every time the content of the text view is changed and then modify the vadjustment.value of the scrolled window containing the web view.
But this doesn't work. Is it because of the delay? I can't think of any way to solve this issue.
why do you want sync those scrollbars? You can achieve this by using the same Gtk.Adjustment (number of pages sets to 0).
I haven't use much of webkit but it essentialy a widget. so maybe a workaround would be disconnect a signal "value-changed" from Gtk.Adjustment until "load-status" signal from WebKitView reached Webkit.LoadStatus.FINISHED (if that's the correct syntax).
If that doesn't work, maybe you use WebKitView.move_cursor () (if i remember the function properly) based on Gtk.Adjustment on your text view (we use 2 adjustments this time)
I'm currently developing a small application in Python with the use of GTK+ (and Glade). Everything has been fairly simple to integrate so far, until I came up with the idea to add tabs instead of pop-ups. Note: Still using Python 2.7+
Is there any easy way to implement already existing pages inside a new tab(notebook) like structure? I'm having difficulties to find how to add content per separate tab created in glade.
Perhabs a more 'clear' question: What Notebook function will be required to call a specific V/HBox with every different tab? The current structure looks like (minus Menu / statusbar):
[ mainWindow ] --> (1) mainOverview (gtkVbox) --> (2A) mainContent (gtkHbox) ... other non-related content
The structure I was hoping for would look like:
[ mainWindow ] --> (1) mainOverview --> (2) noteBook --> (3) Tab1 --> (4) mainContent (gtkHbox) -- (3) Tab2 --> (4) secondaryContent (gtkHbox)
The application itself works fine (multithreaded, fully functioning) without the tabs, the mainContent(gtkHbox) contains a file/recursive directory analyzer, a few checkboxes and a general overview. I was hoping for an easy way to display this main window (the gtkHbox) ONLY when having Tab1 selected.
Having difficulties to find good reference pages that display a proper way to call content pages per notebook tab. Any reference-pages or useful links are very much appreciated! Thanks so far! My apologies if this is a rather newbish question, I'm not new to Python coding, but interfaces on the other hand... ;)
Not an answer, but it looks like "another.anon.coward" already answered this in a comment...
If you double click on the tab, then that page is selected for adding content in glade. You can go ahead and add content for that page. As for switching you can use set_current_page to switch to page whose content you want to display. Register for "switch-page" signal to find out which page has been switched to.
click on the notebook widget on the widget explorer(object inspector) on the left of glade. Then use your left and right keyboard arrow keys to move from tab to tab. You can also double click on the label of the tab as pyrotherm has said in his answer. But if you want to do it programatically get the notebook object from the ui using the get_object method of Gtk.builder class. Then do this to add a page
builder = Gtk.Builder()
builder.add_from_file("example.glade")
self.notebook = builder.get_object("notebook1") # set the id of the notebook in glade
self.page1 = Gtk.Box()
self.page1.add(Gtk.Label(label="Default Page!"))
self.notebook.append_page(self.page1, Gtk.Label(label="Plain Title"))
Now add the content you want to it. Now on to signals. Pyrotherm has already answered it. though there is no signal named switch-page. its named switch_page. You can look at the list of signals of notebook here