Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » OS Problems etc., Win32, POSIX, MacOS, FreeBSD, X11 etc » some drawing problems in X11
some drawing problems in X11 [message #6998] Wed, 06 December 2006 23:16 Go to next message
evert is currently offline  evert
Messages: 6
Registered: December 2006
Location: The Netherlands
Promising Member
Hi,

I have created a small ataxx (virus) game in U++ as part of my programming course at the university. The code is ugly, I'm a beginner, the comments are in Dutch, but it works, at least in Win32. In X11 I have to disable a few things like auto-resizing the window.

Some code snippets that causes problems:

w.DrawEllipse(startx, starty, virusgrootte/2, virusgrootte/2, Yellow());

(it seems like DrawEllipse does not like the divisions - Win32 does not complain though)

centrumpunt = GetWorkArea().CenterPoint();
centreerx = centrumpunt.x-(int)(.5*raambreedte);
centreery = centrumpunt.y-(int)(.5*raamhoogte);
SetRect(centreerx, centreery, raambreedte, raamhoogte);

(something goes wrong with GetWorkArea().CenterPoint(); or with SetRect, not sure which is causing the problem)

I'm working with upp_0.612.1-1_i386.deb

(in windows, i work with the 605 release, works splendid)

Just to let you know there errors ocurred. I've to show my work tomorrow so I will not care much myself about these problems - I just show the win32 version and my teacher will be happy.

Thanks for U++ !!
Re: some drawing problems in X11 [message #6999 is a reply to message #6998] Wed, 06 December 2006 23:35 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12105
Registered: November 2005
Ultimate Member
Do you think you could post the whole package as testcase?

Mirek
Re: some drawing problems in X11 [message #7011 is a reply to message #6999] Thu, 07 December 2006 13:08 Go to previous messageGo to next message
evert is currently offline  evert
Messages: 6
Registered: December 2006
Location: The Netherlands
Promising Member
Sure. Unzip to MyApps and it's ready to compile.

But the code quality is below standards, and comments are in Dutch...
  • Attachment: ataxx.zip
    (Size: 9.71KB, Downloaded 1785 times)

[Updated on: Thu, 07 December 2006 13:18]

Report message to a moderator

Re: some drawing problems in X11 [message #7012 is a reply to message #7011] Thu, 07 December 2006 14:59 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12105
Registered: November 2005
Ultimate Member
Ooops. By mistake, you placed the .lay file into other directory ("Open any file.."), so it did not get zipped.

Please send it:)

Mirek
Re: some drawing problems in X11 [message #7013 is a reply to message #6998] Thu, 07 December 2006 16:44 Go to previous messageGo to next message
evert is currently offline  evert
Messages: 6
Registered: December 2006
Location: The Netherlands
Promising Member
bordselectie.lay is in the zip file

there is no other .lay file, the topwindows is made without a layout file with void MyAppWindow::Paint(Draw& w)
Re: some drawing problems in X11 [message #7028 is a reply to message #7011] Fri, 08 December 2006 10:38 Go to previous messageGo to next message
andrei-catalin is currently offline  andrei-catalin
Messages: 62
Registered: May 2006
Location: Romania
Member
Hi!

After some modifications I succeded to run your app.

The main problem is placing SetRect method in Paint routine.

A hint is to separe this method as a individual method.

Andrei
Re: some drawing problems in X11 [message #7029 is a reply to message #7028] Fri, 08 December 2006 10:50 Go to previous messageGo to next message
evert is currently offline  evert
Messages: 6
Registered: December 2006
Location: The Netherlands
Promising Member
@ luzr, andrei-catalin:

Thanks a lot. I would never have figured that out. I will try and recompile it in Ubuntu this weekend and let you know about it.
Re: some drawing problems in X11 [message #7055 is a reply to message #6998] Sun, 10 December 2006 12:19 Go to previous messageGo to next message
evert is currently offline  evert
Messages: 6
Registered: December 2006
Location: The Netherlands
Promising Member
Have tried it. Compiles OK, and no crash during runtime any more. But resizing is still a problem. How to programatically Resize the app window at runtime? In win32, the SetRect method does a fine job, but in X11, it only works when the window is first initialized. Using a SetRect (oudside of the Paint method) in X11 results in a windows with zero width and height.

I have tried things like GuiFlush(), Restore() and Layout() after the SetRect but the problem persists.

Actually I don't need it anymore (got a nice mark for my little program) but I feel like resizing windows should work in X11 if it works in win32.

Ubuntu 6.10
U++ 612-dev1

Regards, Evert
Re: some drawing problems in X11 [message #7060 is a reply to message #7055] Sun, 10 December 2006 20:02 Go to previous messageGo to next message
andrei-catalin is currently offline  andrei-catalin
Messages: 62
Registered: May 2006
Location: Romania
Member
You could try my version (tested only in win32). Perhaps it will work in X11, too.

Good luck,
Andrei
  • Attachment: ataxx.zip
    (Size: 9.81KB, Downloaded 300 times)
Re: some drawing problems in X11 [message #7061 is a reply to message #6998] Sun, 10 December 2006 22:07 Go to previous messageGo to next message
evert is currently offline  evert
Messages: 6
Registered: December 2006
Location: The Netherlands
Promising Member
Your version didn't compile at first (you commented out a few files) but after fixing that, it did compile fine. I should have made a Makefile, probably, and fix the modulatity.

The problem in your version is solved - programatically rezising the window now works Razz I'm still figuring out how you did it. Is it in this part of the code? Does one need a Backpaint() to resize a window at runtime?

GUI_APP_MAIN {
	MyAppWindow ataxx;
	ataxx.BackPaint();
	ataxx.Run();
}

Re: some drawing problems in X11 [message #7062 is a reply to message #7061] Sun, 10 December 2006 22:23 Go to previous message
andrei-catalin is currently offline  andrei-catalin
Messages: 62
Registered: May 2006
Location: Romania
Member
Major changes are in main.cpp lines 156-170 and 500-514.

BackPaint is only for eliminate flickering.

Andrei

[Updated on: Sun, 10 December 2006 22:25]

Report message to a moderator

Previous Topic: freebsd fluxbox theide
Next Topic: Why glibc-2.4 and not glibc-2.3 is needed for U++ on Linux?
Goto Forum:
  


Current Time: Wed Nov 20 13:23:44 CET 2019

Total time taken to generate the page: 0.01374 seconds