Re: How to bind a GTKWindow in C++ code to the .UI file
- From: Luca Bacci <luca bacci982 gmail com>
- To: Arvind Arvind Pro <arvind_dev arvind pro>
- Cc: gtkmm-list <gtkmm-list gnome org>
- Subject: Re: How to bind a GTKWindow in C++ code to the .UI file
- Date: Thu, 23 May 2019 13:45:48 +0200
Try with:
builder->get_widget("main_win", main_win);
if (main_win == nullptr) {
/* handle error */
}
Gtk::Builder::get_widget() method reference:
Have a look here for a detailed guide:
Hi
I have a .UI file where a window with some custom widgets is declared.
Now the main window is named "main_win"
This is how the UI file is initialized in the main function of the application- the path+ name of UI
file is stored in the constant named "UI"
//Load the Glade file and instiate its widgets:
Glib::RefPtr<Gtk::Builder> builder;
try
{
builder = Gtk::Builder::create_from_file(UI);
}
catch (const Glib::FileError & ex)
{
std::cerr << ex.what() << std::endl;
return 1;
}
Gtk::Window* main_win = 0;
Now, my question is this-
How to link the GTK Window variable declared above- "main_win" with the window in the UI file and initialise it to show everything? I am sorry if this sounds like a newbie question :)
Any help would be appreciated:)
Yours sincerely,
Arvind.
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
https://mail.gnome.org/mailman/listinfo/gtkmm-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]