Re: Unified libraries to allow porting code to other oses

new topic     » goto parent     » topic index » view thread      » older message » newer message
jmduro said...

I would have expected something more like that which seems to me close to Euphoria's style:

constant panel = create(GtkBox, win, VERTICAL) 
 
constant lbl1 = create(GtkLabel, panel) 
    set(lbl1,"markup",docs) 
     
constant img1 = create(GtkImage, panel, icon) 
    
constant lbl2 = create(GtkLabel, panel, icon) 
 
main(win) 

I guess this can't be done because it does not seem to be compatible with use of sizers (which usage I still don't understand).

Jean-Marc

The 'more Euphoria's style' example would be easy to match with EuGTK. But doing that would limit your options. For example, sometimes you want an object (label, image, or whatever) to take all the space available. Other times you might want it to only take as much space as it needs, or to share space equally (or not equally) with the other objects in the same container. To do that using the style you suggest would get tricky. That's why you have 3 possible calls - add, pack_start, and pack_end. The 2 pack calls have several options to control how the 'sharing' takes place.

Secondly, you don't always want to add controls to containers in the same order as you create them, or at the time you create them. To require that would force you to write more complex Eu code.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu