FVWM Bug Tracking notification new message incoming/896
Message summary for PR#896 From: [EMAIL PROTECTED] Subject: resize bugs Date: Wed, 26 Jun 2002 21:16:23 -0500 0 replies 0 followups ====> ORIGINAL MESSAGE FOLLOWS <==== >From [EMAIL PROTECTED] Wed Jun 26 21:16:27 2002 Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 17NOpf-0008UM-00 for [EMAIL PROTECTED]; Wed, 26 Jun 2002 21:16:27 -0500 Received: from malifon.math.uh.edu ([129.7.128.13] ident=mail) by util2.math.uh.edu with esmtp (Exim 4.04) id 17NOpf-0000Qy-00 for [EMAIL PROTECTED]; Wed, 26 Jun 2002 21:16:27 -0500 Received: from localhost ([127.0.0.1] ident=65534) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 17NOpb-0008UI-00 for [EMAIL PROTECTED]; Wed, 26 Jun 2002 21:16:23 -0500 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: resize bugs Message-Id: <[EMAIL PROTECTED]> Date: Wed, 26 Jun 2002 21:16:23 -0500 Full_Name: Neil Zanella Version: 2.4.8 CVS_Date: OS: X_Server: Submission from: (NULL) (129.128.206.243) The following code works under twm, mwm, window maker, and sawfish but not under fvwm2. Under Red hat 7.3 compile it by placing it in a file main.cpp under a directory called main. Then compile with: qmake -project; qmake; make and run with ./main There are two problems: 1) Upon startup the grid is not 10x10 as it is under twm. 2) When the window is grabbed with the mouse, made really thin, then really tall and wide, and this is done many times quickly before the mouse is released, the window exhibits some strange resizing behavior and ends up resizing itself to some unreasonable size. --- main.cpp --- #include <qapplication.h> #include <qpopupmenu.h> #include <qmenubar.h> #include <qpainter.h> #include <qvbox.h> #define H 40 #define W 60 class Foo: public QVBox { public: Foo(QWidget *parent = 0): QVBox(parent) { bar = new QMenuBar(this); one = new QPopupMenu(bar); two = new QPopupMenu(bar); thr = new QPopupMenu(bar); bar->insertItem("The ", one); bar->insertItem("Menu ", two); bar->insertItem("Bar ", thr); setSizeIncrement(W, H); resize(10 * W, 10 * H + bar->height()); } protected: void paintEvent(QPaintEvent *); private: QMenuBar *bar; QPopupMenu *one; QPopupMenu *two; QPopupMenu *thr; }; void Foo::paintEvent(QPaintEvent *) { int contentHeight = height() - bar->height(); if (contentHeight % H != 0) { setBaseSize(W, bar->height() + H); resize(width(), height() - contentHeight % H); } QPainter p(this); int i, j; for (i = 0; i < height() / H; i++) for (j = 0; j < width() / W; j++) p.drawRect(j * W, i * H + bar->height(), W, H); } int main(int argc, char **argv) { QApplication app(argc, argv); Foo foo; app.setMainWidget(&foo); foo.show(); return app.exec(); } -- Visit the official FVWM web page at <URL:http://www.fvwm.org/>. To unsubscribe from the list, send "unsubscribe fvwm-workers" in the body of a message to [EMAIL PROTECTED] To report problems, send mail to [EMAIL PROTECTED]