-
jabirali
-
RE: Distro question (experts, please read)
-
If you want to stick to C++, then [url=http://doc.trolltech.com/4.0/aboutqt.html]Qt[/url] is a good choice. The libraries have predefined widgets for almost everything, and defining your own widgets is also quite easy. The GUI itself can either be designed graphically (using Qt Designer), or manually (by instantiating and initializing the widgets yourself). When the GUI has been defined, you simply use the "connect" macro to map events (signals) to your own methods (slots). If you're interested, they have extensive tutorials and examples [url=http://doc.trolltech.com/4.0/examples.html]here[/url] to get you started.
Here's an example of defining your own widget in Qt, I wrote it when going through their tutorial:
[code]class LCDRange : public QWidget
{
public:
LCDRange(QWidget *parent = NULL);
};
LCDRange :: LCDRange(QWidget *parent) : QWidget(parent)
{
// Instantiate widgets
QLCDNumber *lcd = new QLCDNumber(2);
QSlider *slider = new QSlider(Qt::Horizontal);
QVBoxLayout *layout = new QVBoxLayout;
// Initialize widgets
lcd -> setSegmentStyle(QLCDNumber::Filled);
slider -> setRange(0,99);
slider -> setValue(0);
// Connect signals to slots
connect(slider, SIGNAL(valueChanged(int)), lcd, SLOT(display(int)));
// Configure layout
layout -> addWidget(lcd);
layout -> addWidget(slider);
setLayout(layout);
}[/code]
Other popular alternatives include [url=http://wxwidgets.org/]wxwidgets[/url] and [url=http://www.gtkmm.org/en/]gtkmm[/url]. I've never used them before, so I can't speak for those libraries :)
[b][edit][/b]
If you're interested in creating your own distribution, you should also take a look at the [url=http://www.linuxfromscratch.org/lfs/]Linux From Scratch[/url] project. They provide a mature handbook that'll hold your hand through the entire process ;)
-
25 Jun 11
If you want to stick to C++, then Qt is a good choice. The libraries have predefined widgets for almost everything, and defining your own widgets is also quite easy. The GUI itself can either be designed graphically (using Qt Designer), or manually (by instantiating and initializing the widgets yourself). When the GUI has been defined, you simply use the "connect" macro to map events (signals) to your own methods (slots). If you're interested, they have extensive tutorials and examples here to get you started.
Here's an example of defining your own widget in Qt, I wrote it when going through their tutorial:
class LCDRange : public QWidget
{
public:
LCDRange(QWidget *parent = NULL);
};
LCDRange :: LCDRange(QWidget *parent) : QWidget(parent)
{
// Instantiate widgets
QLCDNumber *lcd = new QLCDNumber(2);
QSlider *slider = new QSlider(Qt::Horizontal);
QVBoxLayout *layout = new QVBoxLayout;
// Initialize widgets
lcd -> setSegmentStyle(QLCDNumber::Filled);
slider -> setRange(0,99);
slider -> setValue(0);
// Connect signals to slots
connect(slider, SIGNAL(valueChanged(int)), lcd, SLOT(display(int)));
// Configure layout
layout -> addWidget(lcd);
layout -> addWidget(slider);
setLayout(layout);
}
Other popular alternatives include
wxwidgets and
gtkmm. I've never used them before, so I can't speak for those libraries :)
[edit]
If you're interested in creating your own distribution, you should also take a look at the Linux From Scratch project. They provide a mature handbook that'll hold your hand through the entire process ;)