Re: [UFO-devel] Some quick questions about libUFO (Ich spreche auch Deutsch!)
Status: Beta
Brought to you by:
schmidtjf
|
From: Johannes S. <sch...@us...> - 2007-05-08 10:03:01
|
Hi Andrew,
CCing to the ufo devel list, as this might be interesting for others as well.
Am Mittwoch, 2. Mai 2007 03:11 schrieb Andrew Hvatum:
> Hi,
>
> I have a few quick questions about libUFO, first of all, how does one
> use the
> setResizable function? I've pasted my code below, I'm trying to make a
> second
> small window which should not be resizable, to hold the tools for my
> program (a la
> photoshop). This window shouldn't be resizable, otherwise silly users might
> resize it and not be able to figure out how to access all the tools.
>
> As far as I can tell the code below should restrict the window from
> being resizable
> but it can still be resized.
Well, might be a bug. I have to review the X11 driver ...
But you could try to set all window parameters before calling setVisible.
Perhaps some attributes are not updated after creating the window.
> Also, is it possible to remove the maximize and close buttons from the
> top of windows?
>
> I know these are drawn by the window manager, so is there some command
> libUFO can
> pass (in Linux) so the window appears without a close button?
To modify the window frame, you have to adjust the frame style attribute:
UXFrame::setFrameStyle
(see ufo/ufo_types.hpp, enum FrameStyle).
The GLX driver uses the motif window hints to indicate which frame style the
window manager should use (see src/ux/uxglxdriver, line 1031).
Perhaps it works if you play around with the frame style parameter ...
The maximize button should already be hidden when the window isn't resizable
anymore.
> Code:
> int main(int argc, char ** argv) {
> // Creates the toolkit object, tells UFO to start
> UXToolkit tk;
> // loads the video driver and creates a central event queue
> UXDisplay display;
>
> // Creates a central frame
> UXFrame * tool_window = display.createFrame();
> tool_window->setBounds(74, 208, 74, 208);
> tool_window->setVisible(true);
> tool_window->setSize(74, 208);
> tool_window->setResizable(false);
> tool_window->setTitle("Tools");
Try to make setVisible(true) the last command.
SDL and probably some UFO drivers don't like it if window parameter are set
after the window is shown.
Regards,
Johannes
|