Menu

#2 retrn the same object for the same pointer

open
nobody
5
2003-05-05
2003-05-05
No

In C I can open display, get a screen pointer with
screen = XScreenOfDisplay (display, XDefaultScreen
(display)), get the same display pointer with
XDisplayOfScreen(screen), and get the same screen
pointer again by calling XScreenOfDisplay (display,
XDefaultScreen (display)) second time.
Since I did not find any word about releasing the
pointer I get this way in the Xlib documentation it
should always behave like this.
In xlib_wrap/ruby I get diffrerent ojects and there is
no way to tell the objects refer to the same Xlib object.
This also makes it harder to extend the objects to add
some intelligence because I cannot subclass them
directly (I would have different objects and instance
variable sets for the same thing). Instead, I'd have
to remember from which X wrapper object a new object is
created so that I could track the single Display object
representing its connection.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.