show/hide widget within other widget
- From: Andreas Kotowicz <kotoml mynetix de>
- To: gtk-app-devel-list gnome org
- Subject: show/hide widget within other widget
- Date: Tue, 04 Apr 2006 19:36:57 +0200
I have a main.c file like this:
int main(int argc, char **argv)
{
GnomeProgram *program;
program = gnome_program_init(bla, bla, ..)
create_mainwindow();
gtk_main();
return 0;
}
where create_mainwindow reads like following:
void create_mainwindow (void)
{
GnomeApp *window;
window = create_ui();
GtkWidget *calendar;
calendar = create_calendar();
gnome_app_set_contents(window, GTK_WIDGET(calendar));
gtk_widget_show_all(GTK_WIDGET(window));
}
as you may guess, create_ui just sets up the window with menu and tool
bars, etc.
create_calendar creates a gtkcalendar.
Now in my create_ui function I have a menu option for enabling/disabling
the calendar. as the calendar is enabled by default, how should I now
disable (maybe hide) it? what's the most elegant solution for this
problem? I also think about the possibility to choose from a variety of
widgets to be displayed inside the contents window. and in my eyes it
doesn't make sense to first create all those widgets and then manually
show/hide them as needed (suppose I just want to have one widget at a
time).
I'm welcome for any suggestions,
cheers,
Andreas
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]