Article View: comp.windows.interviews
Article #1651[IV3.1beta] begin_style(), how ?
From: Kolja Kaehler
Date: Sun, 10 Jan 1993 18:22
Date: Sun, 10 Jan 1993 18:22
42 lines
1634 bytes
1634 bytes
Hi,
I built an application which consists of a canvas and a menu. To allow
customization of colors, I want to specify something like this in my
.Xdefaults:
App.background: blue # bg color of canvas
App.menu.background: white # bg color of menubar/items
The first one was no problem, but - of course - all glyphs got a blue
background.
To customize my menu, I thought the way to go would be like this:
AppMenu::AppMenu(void)
{
WidgetKit *kit = WidgetKit::instance();
BarInfo *i;
MenuItem *item;
kit->begin_style("menu"); // this should set the current style
MenuBar = kit->menubar(); // use the new style to build menu
for (i = menubar; i->name != nil; i++) {
item = kit->menubar_item(i->name);
item->menu(MenuPane(i->menu));
MenuBar->append_item(item);
}
kit->end_style(); // return to root style
}
If I run this, my program segfaults somewhere in ivResource::ref() ... :-(
(*after* working through the above, but before mapping anything to the screen)
Please help!
Kolja
--
------------------------------------------------------------------------------
Kolja Kaehler <kk@cs.tu-berlin.de>
Technical Details
Message-ID:
<1993Jan10.182228.17547@cs.tu-berlin.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!cs.tu-berlin.de!kkShow Full Headers
Complete Article Headers
Newsgroups: comp.windows.interviews Path: arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!cs.tu-berlin.de!kk From: kk@cs.tu-berlin.de (Kolja Kaehler) Subject: [IV3.1beta] begin_style(), how ? Message-ID: <1993Jan10.182228.17547@cs.tu-berlin.de> Sender: news@cs.tu-berlin.de Organization: Techn. University of Berlin, Germany X-Newsreader: TIN [version 1.1 PL8] Date: Sun, 10 Jan 1993 18:22:28 GMT Lines: 42