question about gnomeappwin in obj-c
- From: George Farris <george gmsys com>
- To: gnome-devel-list gnome org
- Subject: question about gnomeappwin in obj-c
- Date: Mon, 08 Mar 1999 09:10:49 -0800
Can GnomeAppWin be used for creation of toplevel windows
for an application or is there something special about
it in that it should only be used once for any app?
I have the following code where "setup" is a child of
gnome property box. I can capture the "apply" signal
and everything works just fine when the user presses
the "apply" or "OK" button.
I'm trying to do the same thing with "phbook" which is
a child of GnomeAppWin (I'm using the menu and toolbar
routines from it) but when I run the code and call
"phbook" it says it can't lookup the "select_row" signal.
I've tried other signals as well and it seems that none of
them can be looked up. Anyone got any ideas?
The basic thing I'm trying to accomplish is updating of vars
in the main app when pressing a close button from inside the
phone book window which is created inside GfaxPhoneBook.
It works for setup quite well but is there a better way to
do this?
I'd really appreciate some help on this I've been struggling
over it all weekend. I can send the entire code if requested.
#include <obgnome/obgnome.h>
@interface GfaxApp : Gnome_AppWin
{
id myapp, pr, pb;
}
- initForApp: (id) myApp :(gchar **)argv;
- sendfax: (id) sender;
- applyProperties: (id) sender;
@end
@implementation GfaxApp
- initForApp: (id) myApp :(gchar **)argv
{
id hbox, vbox, vbox2, label, dateLabel, pix;
much deleted
[self create_menus:mainmenu]; // Make the menus
[self create_toolbar:mytoolbar]; // Make the toolbar
[self set_contents:vbox];
[self connect:"delete_event"]; // Set up the exit
return self;
}
- phbook:(id) sender
{
pb = [[GfaxPhoneBook alloc] init];
[pb connectObjMethod:"select_row" :self :@selector(myselect_row:)];
return self;
}
- myselect_row: (id) sender
{
g_print("Phone Book name -> %s\n", [pb get_name]);
}
- setup: (id)sender
{
pr = [PropertyDialogPopup new];
[pr connectObjMethod:"apply" :self :@selector(applyProperties:)];
return self;
}
// go here to update vars and widgets after setup
- applyProperties: (id) sender
{
sendnow_state = [pr get_sendNow];
[sendImmediate_cb set_active:sendnow_state];
coverPage_state = [pr get_useCoverPage];
[coverPage_cb set_active:coverPage_state];
resolution_state = [pr get_useFineRes];
[resolution_cb set_active:resolution_state];
strcpy(transmitAgent, [pr get_agent]);
return self;
}
much deleted
@end
@implementation GfaxObject
-initGfax:(gchar *)app_id :(int) argc :(gchar **) argv
{
self = [super initApp:app_id :VERSION :argc :argv];
window = [[[GfaxApp alloc] initForApp:self :(gchar **)argv] show];
return self;
}
@end
gint
main(int argc, gchar *argv[])
{
id myapp;
myapp = [GfaxObject alloc];
[myapp initGfax:"Gfax" :argc :argv];
[myapp run];
[myapp free];
return 0;
}
--
=======================================================================
George Farris - VE7FRG E-Mail : george@gmsys.com
G.M. Systems, Web page : http://www.gmsys.com
2570 Seaview Road, Phone/Fax : (250)743-1500
Mill Bay, B.C., Canada
V0R 2P0 We do pre-installed Linux systems.
-----------------------------------------------------------------------
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]