Python GTK Notebook (Glade)

I am currently developing a small Python application using GTK + (and Glade). Until now, everything was pretty simple, until I came up with adding tabs instead of pop-ups. Note: Python 2.7+ is still in use.

Is there any simple way to implement existing pages inside a new tab (notepad), such as a structure? I'm having difficulty finding content to add to a separate tab created in a clearing. Perhabs is a more β€œunderstandable” question: What Notebook function is required to invoke a specific V / HBox with each individual tab? The current structure looks like (minus the menu / status bar):

[ mainWindow ] --> (1) mainOverview (gtkVbox) --> (2A) mainContent (gtkHbox) ... other non-related content

The structure I was hoping for would look like this:

[ mainWindow ] --> (1) mainOverview --> (2) noteBook --> (3) Tab1 --> (4) mainContent (gtkHbox) -- (3) Tab2 --> (4) secondaryContent (gtkHbox)

The application itself works fine (multi-threaded, fully working) without tabs, mainContent(gtkHbox) contains a file / recursive directory analyzer, several flags and a general overview. I was hoping for an easy way to display this main window ( gtkHbox ) ONLY when Tab1 selected.

You cannot find good help pages that display the proper way to call up content pages on a tab for a laptop. Any help pages or useful links are greatly appreciated! Thanks, bye! My apologies if this is pretty newbie, I'm not new to Python coding, but interfaces on the other hand ...;)

+6
source share
1 answer

Not an answer, but it looks like "another.anon.coward" already answered this in a comment ...

If you double-click on the tab, this page will be selected to add content to the clearing. You can continue and add content for this page. As for switching, you can use set_current_page to switch to the page whose contents you want to display. Register for the "switch-page" signal to find out which page was switched to.

0
source

Source: https://habr.com/ru/post/945809/


All Articles