#nuvie@irc.freenode.net logs for 17 Aug 2003 (GMT)

Archive Today Yesterday Tomorrow
Nuvie homepage


[01:55:53] --> Kirben has joined #nuvie
[05:44:53] <-- kefka has left IRC (Remote closed the connection)
[05:46:12] --> kefka has joined #nuvie
[05:52:37] --> Yuv422 has joined #nuvie
[10:43:20] --> wjp has joined #nuvie
[10:44:58] <Yuv422> hi wjp
[10:45:32] <wjp> hi
[10:46:24] <Yuv422> I'm just working on the gui widget redraw issues
[10:49:09] <Yuv422> then I might look at converting some of the existing views over to the new gui system
[11:08:23] <Yuv422> wjp: You might be able to enlighten me on this one. In C++ is there such a thing as a method pointer?
[11:09:33] <wjp> yes
[11:10:03] <Yuv422> so I can pass a pointer to a method function as an argument to another method?
[11:10:11] <wjp> yes
[11:10:28] <Yuv422> is there a trick to it
[11:10:47] <Yuv422> when I was passing my method pointer it was coming up an unknown type.
[11:10:54] <Yuv422> an/as
[11:11:45] <wjp> what type did you give the argument?
[11:14:14] <Yuv422> GUI_status (*GUI_ActiveProc)(void *data);
[11:14:45] <Yuv422> should there be a class:: in there someware?
[11:14:52] <wjp> yes
[11:15:01] <wjp> before the *
[11:15:09] <Yuv422> ah k
[11:15:22] <Yuv422> hmm
[11:15:25] <wjp> (not literally class::, btw)
[11:15:39] <Yuv422> but then I'm stuck with one class. :(
[11:15:55] <wjp> yes
[11:15:57] <Yuv422> hehe
[11:16:29] <Yuv422> in obj-c you can pass any method to any class as an argument :)
[11:16:43] <Yuv422> I guess I'm spoilt.
[11:17:12] <wjp> you can probably use some template tricks
[11:19:53] <Yuv422> so you can have a templated method pointer?
[11:21:38] <wjp> I'm not exactly sure of the details, but I was thinking of having a templated class with a static member function
[11:24:13] <wjp> not really sure if it'll work, though
[11:24:17] <Yuv422> could you do it with a virtual method?
[11:24:46] <wjp> yes
[11:27:06] <Yuv422> do you use a callback system for your gump system in pentagram?
[11:27:58] <wjp> no, we have 'event functions' in the Gump class that get called when something happens
[11:28:08] <wjp> OnMouseDown(), etc..
[11:28:18] <wjp> (virtual)
[11:28:38] <Yuv422> what happens if you've got two buttons
[11:28:56] <Yuv422> are they different classes?
[11:28:57] <wjp> OnMouseDown has parameters
[11:29:20] <wjp> oh, two gui buttons, not two mouse buttons :-)
[11:29:31] <Yuv422> yeah. :)
[11:29:36] <wjp> they can be the same class, but they're different instances
[11:30:07] <Yuv422> so you'd need some sort of callback hook to tell the button what to do when pressed?
[11:31:40] <wjp> not sure yet how we'll handle that exactly
[11:31:50] <wjp> exult subclasses the button class
[11:32:13] <Yuv422> so a different class for each button instance?
[11:32:16] <wjp> sometimes with multiple functions in a single button
[11:32:26] <wjp> (with a class member to select which function)
[11:32:39] <Yuv422> ah k
[11:32:47] <Yuv422> sounds a little evil.
[11:41:12] <Yuv422> maybe I'll do that too. Have a generic virtual callback method then pass back some sort of button tag.
[11:41:43] <Yuv422> then get the recipent to handle the callback based on the tag.
[13:49:15] <Yuv422> time for bed
[13:49:16] <Yuv422> cya
[13:49:18] <-- Yuv422 has left IRC ("[BX] I'm out like a light...")
[18:15:28] <-- wjp has left IRC ("bbl")
[19:02:55] <-- Kirben has left IRC (Read error: 104 (Connection reset by peer))