Re: [gtkmm] project an interface



ok, i understand... is more simply than what i do.
But i want make with glade the window in two part, the first is
mainWindow where i have a menubar and the space for some forms (a
scrolled-window i mean) next i want make the forms, with glade too, that
will called by menu. When i start to make a new form i need to start
from a gtkWindow! next, i can add this form to the space created into
main_window? 
this is a very simply way to build and modify this forms without touch
the source code, i want try to use only .glade files for the ui.


On Sat, 2004-09-25 at 07:48, Max Vasin wrote:
> pallucchini roberto <r palluk virgilio it> writes:
> 
> > hi all,
> > i'd wish an advice for make a user interface with gtkmm and glade.
> > I'm started to write a simple program where i have a main application
> > window and some buttons (or menubar) that call 2 forms. Because this
> > forms are complex and have a lot of data i need to open it one of time,
> > only when are called from the user. Now, i want use glade2 files (xml)
> > and gtkmm, i have see what i need to do for manage windows, events and
> > mode, but i don't understand what i can do for make the forms structure
> > with glade. With the libglademm xml create function i can recall the
> > file and attach to the main window, but under glade i need to start to
> > write the interface from a gtkWindow!
> Yes, but you can call xml->get_widget(...) to get the widget you need.
> Another approach is not to write main window by hand, like this:
> class Application
> {
>     Glib::RefPtr<Gnome::Glade::Xml> xml;
> public:
>     Application();
> 
>     Gtk::Window* main_window()
>     {
>       return get_widget<Gtk::Window>("main_window");
>     }
> };
> 
> Application::Application()
>     : xml(Gnome::Glade::Xml::create("app.glade")),
> { 
>     connect_signals();
> }
> 
> void Application::connect_signals()
> {
>     get_widget<Gtk::MenuItem>("mi_exit")->signal_activate().connect(sigc::mem_fun(*main_window(), &Gtk::Window::hide));
>     get_widget<Gtk::MenuItem>("mi_help_about")->signal_activate().connect(sigc::mem_fun(*this, &Application::show_about));
>     ...
> }
> 
> int main()
> {
>   Gtk::Main kit(&argc, &argv);
>   Application app;
>   kit.run(*app.main_window());
> }
> 
> > i hope that you understand me... i'm sorry for my poor english :-)




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]