Mailinglist Archive: libyui-devel (8 mails)

< Previous Next >
Re: [libyui-devel] busy and normal cursor
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Il 03/02/2014 11:04, Martin Vidner ha scritto:
On Sat, Feb 01, 2014 at 08:31:41PM +0100, Angelo Naselli wrote:
I seem i cannot see it working in GTK. Is it only me?

Hi Angelo,

I have modified this example from the YaST bindings
https://github.com/yast/yast-ycp-ui-bindings/blob/0ba1d246d77b477513b9db7db6760b1f360d6f89/examples/PollInput1.rb


to add UI.BusyCursor, and I do get a busy cursor with

/sbin/yast2 --gtk PollInput1.rb

Please look in the yast bindings to find the working usage. Maybe
some other bindings or documentation need a fix, but I don't know
what you are using.

I don't have suse here at the moment, but at quick sight, i seem is
very similar to the attached c++ example, in which i cannot see
any cursor changing in gtk and ncurses (if that ever makes sense).

Am I wrong in something?

Angelo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlL1R0MACgkQqEs9DA4DquClNQCePuHulRKu+eexj4wBYm8BnxN/
B80An2L0Zal5J2HNahYiERIKv/WX6gls
=UsP6
-----END PGP SIGNATURE-----
/*
Copyright (c) 2000 - 2012 Novell, Inc.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/


// Trivial libyui example.
//
// Compile with:
//
// g++ -I/usr/include/yui -lyui BusyCursor.cc -o BusyCursor

#include "YUI.h"
#include "YApplication.h"
#include "YWidgetFactory.h"
#include "YDialog.h"
#include "YLayoutBox.h"
#include "YEvent.h"
#include "YPushButton.h"

int main( int argc, char **argv )
{
YDialog * dialog = YUI::widgetFactory()->createPopupDialog();
YLayoutBox * vbox = YUI::widgetFactory()->createVBox( dialog );
YUI::widgetFactory()->createLabel ( vbox, "Hello, press ChangeCursor to
change cursor!" );
YPushButton* changeCursor = YUI::widgetFactory()->createPushButton( vbox,
"&Change cursor" );
YPushButton* quitButton = YUI::widgetFactory()->createPushButton( vbox,
"&Quit" );

while (1)
{
YEvent* pEvent = dialog->waitForEvent();

if (pEvent->eventType() == YEvent::CancelEvent) {
break;
}
else if ( pEvent->widget() == changeCursor )
{
YUI::app()->busyCursor();
usleep(5000000);
YUI::app()->normalCursor();
}
else if ( pEvent->widget() == quitButton )
break;
}

dialog->destroy();
}
< Previous Next >
List Navigation
Follow Ups