Github User Fetcher 1.0.0
C Application with Server and GUI
|
Main application window for the GitHub user fetcher GUI. More...
Public Member Functions | |
GitHubUserFetcherWindow () | |
Constructs the main window, sets up widgets and signals. | |
Private Member Functions | |
void | on_button_clicked () |
Event handler for the fetch button. | |
void | show_message (const std::string &msg) |
Displays a message in the text view area. | |
Private Attributes | |
Gtk::Box | box |
Container for layout. | |
Gtk::Entry | entry |
Text field for GitHub username input. | |
Gtk::Button | button |
Button to trigger fetch. | |
Gtk::ScrolledWindow | scrolled_window |
Scrollable container for text_view. | |
Gtk::TextView | text_view |
Text view to display results or messages. | |
Main application window for the GitHub user fetcher GUI.
This class sets up the UI elements such as the input field, button, and display area. It fetches user data from GitHub in a background thread and updates the UI asynchronously using Glib's main loop.
|
inline |
Constructs the main window, sets up widgets and signals.
Applies CSS styling, initializes all widgets, and connects the button click signal to the event handler.
Definition at line 47 of file gui.cpp.
References box, button, entry, GTK_STYLE_PROVIDER_PRIORITY_USER, on_button_clicked(), scrolled_window, and text_view.
|
inlineprivate |
Event handler for the fetch button.
Starts a background thread to fetch GitHub user data and updates the text view with the results. Displays an error message on failure.
Definition at line 98 of file gui.cpp.
References User::company, entry, User::location, User::login, User::name, show_message(), and text_view.
Referenced by GitHubUserFetcherWindow().
|
inlineprivate |
Displays a message in the text view area.
msg | The message to display. |
Definition at line 133 of file gui.cpp.
References text_view.
Referenced by on_button_clicked().
|
private |
Container for layout.
Definition at line 86 of file gui.cpp.
Referenced by GitHubUserFetcherWindow().
|
private |
Button to trigger fetch.
Definition at line 88 of file gui.cpp.
Referenced by GitHubUserFetcherWindow().
|
private |
Text field for GitHub username input.
Definition at line 87 of file gui.cpp.
Referenced by GitHubUserFetcherWindow(), and on_button_clicked().
|
private |
Scrollable container for text_view.
Definition at line 89 of file gui.cpp.
Referenced by GitHubUserFetcherWindow().
|
private |
Text view to display results or messages.
Definition at line 90 of file gui.cpp.
Referenced by GitHubUserFetcherWindow(), on_button_clicked(), and show_message().