Design problem
From: Stefan Chrobot (chrobot_at_ii.ujocik.pl)
Date: 12/31/04
- Next message: Mike Wahler: "Re: Design problem"
- Previous message: ma740988_at_pegasus.cc.ucf.edu: "Re: exception handling .. more"
- Next in thread: Mike Wahler: "Re: Design problem"
- Reply: Mike Wahler: "Re: Design problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 31 Dec 2004 19:39:01 +0100
Hello!
I'm creating a text-mode gui library.
This is my idea: class Layer with size, style and event handlers like
onPaint, etc., and a vector of Layer* to hold its sublayers (for examle:
MessageBox has a border and an "OK" button). Every widget - like Label,
Border, etc. - will inherit from Layer and extend it as needed. In main
header file I added an object of class Layer called "screen", so that
the user will use it to add components to the program.
Adding elements is easy and looks like this:
screen->add(new Label("Hello World!"));
The problem is, how do I access this Label's properties? Is it possible
to do it without casting (if not, it's a poor library if you have to use
casting every now and then, IMHO)?
Thanks in advance.
Stefan Chrobot
-- To reply via e-mail remove c-i-k from my address.
- Next message: Mike Wahler: "Re: Design problem"
- Previous message: ma740988_at_pegasus.cc.ucf.edu: "Re: exception handling .. more"
- Next in thread: Mike Wahler: "Re: Design problem"
- Reply: Mike Wahler: "Re: Design problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]