Hi dre,
setPixmap habe ich gefunden da fehlten mir nur Header.
Also einen Pixmap-button habe ich schon geschaft.
Aber das mit dem hide(); haut nicht hin!
Schau mal: ok2->hide();
C
#include <plugin.h>
#include <stdio.h>
#include <lib/gui/ewindow.h>
#include <lib/gui/ebutton.h>
#include <lib/gui/emessage.h>
class eTestMainWindow: public eWindow
{
eButton *ok, *ok2;
void message1();
void message2();
public:
eTestMainWindow();
~eTestMainWindow();
};
extern "C" int plugin_exec( PluginParam *par )
{
eTestMainWindow dlg;
dlg.show();
int result=dlg.exec();
dlg.hide();
return result;
}
eTestMainWindow::eTestMainWindow(): eWindow(1)
{
cmove(ePoint(100, 100));
cresize(eSize(520, 376));
setText("Test");
eButton * ok = new eButton(this);
ok->setText("OK");
ok->move(ePoint((clientrect.width() - 200)/2, clientrect.height() - 60));
ok->resize(eSize(90, 40));
ok->loadDeco();
CONNECT(ok->selected, eTestMainWindow::message1);
setFocus(ok);
eButton * ok2 = new eButton(this);
ok2->setText("Testbtn");
ok2->move(ePoint((clientrect.width())/2, clientrect.height() - 60));
ok2->resize(eSize(90, 40));
ok2->loadDeco();
CONNECT(ok2->selected, eTestMainWindow::message2);
}
void eTestMainWindow::message1()
{ ok2->hide(); //<<<<<<<<<<<Da geht halt gar nichts
eMessageBox msg("Button weg", "Info", eMessageBox::iconInfo|eMessageBox::btOK);
msg.show();
msg.exec();
msg.hide();
}
void eTestMainWindow::message2()
{
eMessageBox box("Beenden?", "Frage", eMessageBox::btYes|eMessageBox::btNo|eMessageBox::iconQuestion, eMessageBox::btYes);
box.show();
int button = box.exec();
box.hide();
if (button == eMessageBox::btYes)
{
eWidget::accept();
}
}
eTestMainWindow::~eTestMainWindow()
{
}
Alles anzeigen
Ich weiß nicht was falsch ist
Gruss Emanuel