View Single Post
Posts: 112 | Thanked: 122 times | Joined on Dec 2009 @ London, United Kingdom
#76
Originally Posted by No!No!No!Yes! View Post
I confess I liked the timer Beard-Trick ("Barbatrucco")!!!
And learnt a lot by your coding!!!


PHP Code:
.........snip.........
    
gtk_window_resize (GTK_WINDOW (self), (int)(SIZE_WIDTH_ALL*0.118), SIZE_HEIGHT_LINE);

    
g_timeout_add (500, (GSourceFunc)desktop_cmd_exec_resize_hackself);
........
snip.........

gboolean desktop_cmd_exec_resize_hack(DesktopCmdExec *self)
{
//     g_warning("HACK");
    
if(self->priv->widgetID != NULL)
    {
        
desktop_cmd_exec_read_settings (self);
        
desktop_cmd_exec_update_content (self);

//g_warning("W %d H %d",(int)(SIZE_WIDTH_ALL*self->priv->widthRatio),(int)(SIZE_HEIGHT_LINE*self->priv->heightRatio));//AP
//        gtk_widget_set_size_request (GTK_WIDGET (self), (int)(SIZE_WIDTH_ALL*self->priv->widthRatio), SIZE_HEIGHT_LINE);//AP
//        gtk_window_resize (GTK_WINDOW (self), (int)(SIZE_WIDTH_ALL*self->priv->widthRatio), SIZE_HEIGHT_LINE);//AP
        
gtk_widget_set_size_request (GTK_WIDGET (self), (int)(SIZE_WIDTH_ALL*self->priv->widthRatio), (int)(SIZE_HEIGHT_LINE*self->priv->heightRatio));//AP
        
gtk_window_resize (GTK_WINDOW (self), (int)(SIZE_WIDTH_ALL*self->priv->widthRatio), (int)(SIZE_HEIGHT_LINE*self->priv->heightRatio));//AP
    
}
//     else
//     {
//         g_warning("HACK unsuccessful");
//     }

    
return FALSE;
}
.........
snip......... 
Good that it helped someone!
That hack was necessary when I started with custom width. Without it, the "X" (close) bt for the widget would go to the top-right corner when the widget is loaded but it would continue there forever...
I you shrank the widget you would get a flying "X" in the middle of nothing =0. The hack is to always load the widget with the small size (to put the X bt beside the Conf one) and then resize it some time later..
__________________
Happy n900 owner!
Check my apps: n900fly, accdisplay and the "desktop command execution" widget!
 

The Following User Says Thank You to cpscotti For This Useful Post: