[scribus-dev] trying to figure this out

Gregory Pittman gpittman at iglou.com
Tue May 23 01:09:50 UTC 2017


On 05/22/2017 04:18 PM, dockattt wrote:
> hi,
> 
> sorry Craig about the last message not being clear enough.  I'm working
> on some code to use in the python console.   I've created a function
> that makes TextFrame.  I reused the code in cmdobj.cpp for creating a
> text frame.  That function is called: *scribus_newtext.  It creates a
> text frame with this code:
> 
>     int i =
> ScCore->primaryMainWindow()->doc->itemAdd(PageItem::TextFrame,
> PageItem::Unspecified,
>                                 pageUnitXToDocX(x),
>                                 pageUnitYToDocY(y),
>                                 ValueToPoint(w),
>                                 ValueToPoint(h),
> ScCore->primaryMainWindow()->doc->itemToolPrefs().shapeLineWidth,
> CommonStrings::None,
> ScCore->primaryMainWindow()->doc->itemToolPrefs().textColor);
> 
> 
> in the Scribus 1.5.2 python console I write:
> 
> createText(40,40,100,100)
> 
> and it creates a giant Text Frame way off to the bottom left of the page
> I'm on.   

Sounds like your page units are something other than points. I just ran
this in the console in 1.5.3svn and it works fine.

Greg



More information about the scribus-dev mailing list