How to create a tab bar that imitates the look an feel of a GtkNotebook? - gtk

Im developing a GTK+ 3 application that should be able to display multiple files in tabs. But a GtkNotebook widget is not suitable for this, as it implies a functionality where every single page is a separate container. In the case of my application I just need some sort of tab bar to connect to application's logic, which will then change the data displayed by the ever same set of widgets.
How can this be achieved without ugly workarounds?

Related

Creating tabs ,each with different content in flutter

I am making a blogging application using flutter. I want to create a tab bar with each tab showing different content. The number of tabs is determined by the number of different categories obtained through an API. Also the content of each tab is obtained through api.
It is silimilar to what we see in Google news application.
How to ceate such tab view? Also I want to make sure that apis for fetching the content of each tab are called only once.
You can use persistent tabbar solutions.
Cupertino tabbar provides a solution. Also you can use these packages
https://pub.dev/packages/persistent_bottom_nav_bar_v2
https://pub.dev/packages/persistent_bottom_nav_bar

Updating URL from TabBar selection

I'm currently working on updating a Flutter Web app to support sharing pages via URLs. I currently have a screen that uses a TabBar, and shows different views based on the selected tab. I want to be able to do two things:
Update the URL when a tab is selected (e.g. append &section=tabName to the URL)
Paste the URL into a new browser tab and have the application open on the tab specified by the URL
The second part of this was simple enough, just take the &section=... argument and use that to set the initialIndex of the tab controller. Updating the URL however seems quite difficult.
I've tried using RouteInformationParser to generate a new route from a list of arguments, but that triggers the onGenerateRoute callback and just seems to re-navigate to the page with the initialIndex updated from the new URL. I can get around this by replacing the TabBarView with a nested Navigator that navigates to the selected tab's content, but it seems like this could quickly become quite clunky if you wanted to navigate deeper than just a selected tab.
A simpler option I've seen mentioned is window.history.replaceState, which seems a lot simpler but feels like a bit of a kludge. Are there any ways of doing this that I've missed?
Thanks!
It's a little hacky, but I was able to force a URL change on tabbed navigation by using the TabBar.onTap, which provides the tab index, and having navigation happen through that. It ruined the nice slide action, but I got the custom URL in the address bar, which was more important for my use.

ionic framework hide ion-tabs on certain tab state

I've been trying to find a solution but I can't find any.
I'll use basic examples so anyone who knows ionic can understand my problem well.
ionic start myApp tabs will create a new project with tabs ready to go.
Those tabs are Dashboard, Chat and Settings.
When you go to the Chat Tab you will then select a person to view its chat content (which directs you to the Chat-Detail Page in actuallity)
I wanted to hide the ion-tabs directive when I go to the chat-detail page so I can force the user to use the Back button instead of clicking anything on the ion-tabs.
Simply put : you will have a hard time doing that. At best it will not look good, IF you succeed to hide using css (I did it, and really, it's not pretty). Basically you would need to define a variable on the parent scope, that changes when entering the chat-detail state, and bind it to ng-class directives on multiple elements (the ion-tabs to hide it, the ion-content to translate it up to cover the area where the tabs were, and add some transition to make it not too brutal).
The logical thing to do would be to have the chat-detail state not being a child of the state containing the tabs. The problem you will have, though, is that there is a huge bug going to / from tabbed state. See details here : https://github.com/driftyco/ionic/issues/2997
At the end of this discussion you can find some posts by Jason and Jerrybels (that would be me), that could lead you on the right way to do it. Basically, you will have to get rid of the ion-tabs directive, and use Ionic's CSS for tabs instead, doing all the states manipulations yourself.
Good luck !
You can use "hidden" attribute of ion-tab like this -
<ion-tab hidden={{condition}}" />
Using this we can show/hide tab.

Web-site with two Composite per page. Due to bad design?

I'm creating a web-site using GWT for the first time. The aplication has two Composite class, one of them is a menu and the other one is where I show de info about the specific menu that has been clicked. I'm using MVP, the class History and the interface ChangeValueHandler to switch among different pages.
I have one pair presenter-view for each Composite. The app begins well creating the menu and the section info. When you click in the menu it works fine showing the information and the token browser is changed. The thing is that if you load a page(eg: myapp.com#register) without loading the home page, it doesn't show you the menu. It loads the Composite section info, but not the Composite menu (the Composite menu is load with myapp.com#home).
I think it's because of a bad design of the application, but I don't know how to do that in other way. If the app only had one Composite it wouldn't be a problem, but when there are 2 or more Composite per page I don't know how to manage the whole thing to work properly.
It's difficult to tell what exactly is wrong, because of the lack of code. So I'm guessing. You should design to act on the PlaceChangeEvent instead of the ValueChangeEvent. That means a menu click should fire the place change and then the application will handle this event. That way you unbind the menu actions from your content pages. And think more of each page as a separate entity. Also take a look at the GWT Activity mechanism and how it helps having a main page that is always the same and on that main page a content area that changes depending on the page actually shown.
You should include your menu in each page instead of creating it once in the home page and then keeping it on screen. I assume you create the menu and add it to the DOM via
RootPanel.get().add(myMenuWidget);
If you are using UIBinder it should be pretty straightforward to include the menu in each page, just a matter of adding the corresponding tag in each .ui.xml file of your pages.

use two different uitab bar in application

I want to use two different uitabbar control in the application. first UITABbar control i add in the starting windows. and in this after the navigation i want to show the other tab bar with 5 tabs. can any one suggest how i do this ?
Or we need to add a different window for add this and need to show this windows on the click or other?
Please suggest.
Thanks
The Human Interface Guidelines specifically recommend against having multiple tab bars in your application:
If your application provides different
perspectives on the same set of data,
or different subtasks related to the
overall function of the application,
you might want to use a tab bar. A tab
bar appears at the bottom edge of the
screen.
A tab bar gives users the ability to switch among different modes or
views in an application, and users
should be able to access these modes
from everywhere in the application.
However, a tab bar should never be
used as a toolbar, which contains
buttons that act on elements in the
current mode (see “Toolbars” for more
information on toolbars).
If you need to have context-specific actions, use a toolbar instead.