GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Oct 24, 2014 6:51 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Ruby language and Shoes DSL - GTK+2 Vertical scrollbar Linux
PostPosted: Fri Sep 13, 2013 7:07 am 
Offline

Joined: Thu Sep 12, 2013 9:01 pm
Posts: 2
Background
Shoes uses Slots made from Stacks and Flows for layout control which results in a liquid css like behavior. Loosely speaking, Flows position visible objects dynamically (as the window is resized) from left to right wrapping down the page if there is insufficient space to be displayed without clipping. When vertical space runs out a vertical scroll bar is displayed within the window being redrawn.
My Problem
The vertical scroll bar appears inside the window area which would be ok if the returned window width was reduced by the width of the scroll bar. Unfortunately the visible width is not reduced which results in the scroll bar covering parts of displayed elements.

I am a GTK+2 noob. The relevant ruby calls are:-
Code:
      swin = Gtk::ScrolledWindow.new
      swin.set_size_request args[:width], args[:height]
      swin.set_policy Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC
      swin.vadjustment.step_increment = 10
      layout = Gtk::Layout.new
      swin.add layout

I would be able to achieive what I need if I could test if the vertical scroll bar was visible or not during a resize event.
Any ideas ?


Top
 Profile  
 
 Post subject: Re: Ruby language and Shoes DSL - GTK+2 Vertical scrollbar L
PostPosted: Sat Sep 14, 2013 6:31 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 764
Location: UK
Hello,

I have not used Ruby so therefore never used Shoes. By the look of it Shoes is another wrapper library like WxWidgets. So on Linux it will use GTK+, but on Windows it will use the Windows XP API.

By the looks of it you are mixing the Shoes API and GTK+ API and expecting the Shoes renderer to understand what to do with the placement of the GTK+ widget Shoes has not created.

You may be better to ask in a forum or mailing list that deals with Shoes see - http://shoesrb.com/get_help.html or switch to using just GTK+ only if Shoes does not have all the features that you need.

_________________
E.


Top
 Profile  
 
 Post subject: Re: Ruby language and Shoes DSL - GTK+2 Vertical scrollbar L
PostPosted: Sat Sep 14, 2013 11:18 am 
Offline

Joined: Thu Sep 12, 2013 9:01 pm
Posts: 2
Hi,
Thank you for the response. The Shoes DSL uses ruby to calculate the position of visible objects according to the behavioral rules of Stacks and Flows. It places objects within a Flow on the canvas such that the displayable width is not exceeded (they flow down the page). When the vertical space is exceeded then GTK+ displays a vscrollbar.

The GTK+ layout object knows nothing about how Stacks and Flows are meant to behave so the ruby code needs to know when the vscrollbar is visible in order to subtract the slider width from the available horizontal space in order to prevent objects from being obscured by the vscrollbar.

Perhaps my question should be: How can the ruby code be informed of the presence of the vscrollbar ?

Best regards,
ozpos


Top
 Profile  
 
 Post subject: Re: Ruby language and Shoes DSL - GTK+2 Vertical scrollbar L
PostPosted: Thu Sep 19, 2013 6:31 pm 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 764
Location: UK
This is more of a Shoes API question and it would be better to ask the question in a Shoes specific forum or mailing list. This forum is for GTK+ and does not really cover all the other graphical tool kits derived from GTK+ such as Shoes, WxWidgets etc.

Good luck with solving your code

_________________
E.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group