On Fri, 2003-08-08 at 05:49, Mark Martin wrote:
> While I've been getting wxWindows compiled on Solaris, Win32, Linux, and =
> boxen, I threw together a very rough shot of what I'm thinking I'll be do=
> for a GUI console...
> This was a prototype I did up in Interface Builder on the Mac. Obviously=
> need to work on exactly the right functionatlity for each dialog, but I'm=
> thinking it would work something like this:
> The dialog in the upper left would be the main window. Clicking on Jobs =
> Media would bring up the other two dialogs. The Listboxes on the tabs wo=
> show a multi-field list of jobs, media, or whatever.
Yes, they look really nice. I like the way you divided it up.
> Again, I'm going with wxWindows for this, and I'll be borrowing a lot fro=
> the existing console. At least for the networking/connect stuff.
> Where I think the only challenge is for me is parsing the the text stream=
> from the director into TextFields and the like.. Not a big deal, but wil=
> be the majority of the work.
Getting the text from the Director is relatively straight forward. If
you want to see how to do it, you might look at the gnome-console, which
does a bit of parsing. Look at get_and_fill_combo in console.c
The real trick to getting wxWindows to work is to figure out how to
make the "core" of wxWindows listen on the console->director socket
and to call your code. That is when wxWindows is in its inner loop
waiting for something to happen, it needs to know to break out
when the socket becomes active.=20
In gnome, this is done in the routine in
<bacula>/src/gnome-console/console.c subroutine start_director_reader.
It does a call to gdk_input_add(socket-fd, INPUT, subroutine-to-call,
...). That makes the gdk code aware to monitor data coming from
the Director. Hopefully wxWindows has something similar. If not,
you may need to simulate Bacula sockets with their socket class.