ok. I recommend a look at IupShow function code.

  Here is an inside look.

  When you show a dialog (IupShow/IupShowXY/IupPopup), the first thing it
will do is to call IupMap, that will recursively created all the controls
inside the dialog, by calling the Map method of the Iclass structure for
each element.

  Then IupMap will call iupLayoutCompute, so the layout will be computed.
This part is independent from the native system. This will
call ComputeNaturalSize, SetChildrenCurrentSize and SetChildrenPosition
methods. They are all independent of the native system.

  And right after, IupMap will call iupLayoutUpdate, this will call
the LayoutUpdate method. This is where you update the native size and
position of the control in the native system.

  This sequence, iupLayoutCompute + iupLayoutUpdate is also performed by
IupRefresh if you need that an already mapped dialog has its layout updated.

  So everything is actually an automatic process. The native driver never
worries about the layout, only about setting the size and the position of
the control.

  The UTF-8 support can be left as it is for now, later we can understand
it better.

Best,
Scuri






On Wed, Jul 29, 2015 at 5:15 AM, Eric Wing <ewmail...@gmail.com> wrote:

> On 7/27/15, Eric Wing <ewmail...@gmail.com> wrote:
> > On 7/26/15, Antonio Scuri <sc...@tecgraf.puc-rio.br> wrote:
> >>  Take a look at the iupgtk_image.c. The necessary conversions can be
> >> copied
> >> from there.
> >>
> >>   iupdrvImageCreateImageRaw() and iupdrvImageGetRawData()
> >> are opposite functions I doubt that you will be able to reuse
> >> code. iupdrvImageCreateImageRaw and iupdrvImageCreateImage also get the
> >> data from different sources, so the code will be similar but the data
> >> access will be different.
> >>
> >> Best,
> >> Scuri
> >>
> >
> > Okay, I have the 32, 24, and 8-bit images working for
> > iupdrvImageCreateImage().
> >
> > I still don't know what calls iupdrvImageCreateImageRaw and
> > iupdrvImageGetRawData or how to test them, so I'm skipping them for
> > now.
> >
> >
> >
> > Attached is a picture of the label.c test program. I hacked the layout
> > positions for the images and horizontal/vertical separators so I can
> > see them, otherwise everything is on top of each other like the text.
> >
> >
> > I need guidance about what to do with things like UTF8MODE.
> >
> >   if (IupGetInt(NULL, "UTF8MODE"))
> >   {
> >     IupSetAttribute(label, "TITLE", "Text Labels (çãõáóé)");
> >   }
> >   else
> >   {
> >       IupSetAttribute(label, "TITLE", "Text Labels (Á„ı·ÛÈ)");
> >   }
> >
> > Internally, in Cocoa I've been assuming UTF8. (But I have not set any
> > Iup flags like UTF8MODE). The string in the if-part of the above case
> > works. The string in the else-case actually triggers a Clang compiler
> > warning: "Illegal character encoding in string literal". I'm currently
> > avoiding this case to avoid problems.
> >
> >
> > Second, as you can see from the picture, I need to start looking at
> > layout and window sizing. Can you give me a walkthrough of how this
> > works in Iup and what I should be doing to get this window created at
> > the correct size and position, and with all those test elements laid
> > out correctly in the window?
> >
> > Thanks,
> > Eric
> >
>
> Bump.
>
> I've made a tiny bit of progress with dialog positioning, but I am
> still having a hard time understanding how sizes and positioning are
> done.
>
> I see these two variables seem very important to the process, but I
> don't understand how they get set or how to fill them with the proper
> values.
> ih->currentwidth
> ih->currentheight
>
> I've found the function
> void iupdrvBaseLayoutUpdateMethod(Ihandle *ih)
>
> It looks like this is a good time to set the size and position of
> widgets. However, I don't think the ih->currentwidth and
> ih->currentheight values are valid. I don't think Iup yet has proper
> sizing information for my widgets, like the minimum fit size for a
> button or label is. And I don't understand how the dialog finally gets
> its total fit information.
>
> Thanks,
> Eric
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Iup-users mailing list
> Iup-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
------------------------------------------------------------------------------
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to